/* ═══ AUTH PAGE ══════════════════════════════════════════════ */

#auth-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    color-scheme: light;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: var(--r, 16px);
    padding: 32px 24px 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,.10);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-logo-img {
    height: 48px;
    width: auto;
}

.auth-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
}

.auth-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text2, #888);
    margin: 0 0 20px;
}

/* ── Tabs ── */
.auth-tabs-bar {
    display: flex;
    background: var(--b1, #F0F2F5);
    border-radius: var(--r-sm, 10px);
    padding: 3px;
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    height: 36px;
    border: none;
    border-radius: calc(var(--r-sm, 10px) - 2px);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text2, #888);
    cursor: pointer;
    transition: background .18s, color .18s;
    font-family: inherit;
}

.auth-tab-btn.active {
    background: #ffffff !important;
    color: var(--accent, #FF6B00) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.10);
}

/* ── Message ── */
.auth-message {
    padding: 10px 14px;
    border-radius: var(--r-sm, 10px);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.auth-msg-error {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.auth-msg-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

/* ── Fields ── */
.auth-field {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2, #888);
    margin-bottom: 5px;
}

.auth-pw-wrap {
    position: relative;
}

.auth-pw-wrap .form-input {
    padding-right: 44px;
}

/* ── Icônes œil mot de passe ── */
.auth-pw-toggle .pw-icon-show { display: none; }
.auth-pw-toggle.pw-visible .pw-icon-hide { display: none; }
.auth-pw-toggle.pw-visible .pw-icon-show { display: block; }

.auth-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    color: var(--text2, #888);
}

/* ── Secondary actions ── */
.auth-link-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--accent, #FF6B00);
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    padding: 6px 0;
}

.auth-reset-hint {
    font-size: 13px;
    color: var(--text2, #888);
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ── Inputs toujours fond blanc / texte noir (indépendant du dark mode) ── */
#auth-page .form-input,
#auth-page input[type="email"],
#auth-page input[type="password"],
#auth-page input[type="text"] {
    background: #ffffff !important;
    color: #0F172A !important;
    border-color: #E2E8F0 !important;
}
#auth-page .form-input:focus,
#auth-page input:focus {
    border-color: #FF6B00 !important;
}
.auth-card {
    background: #ffffff !important;
    color: #0F172A !important;
}
.auth-label { color: #475569 !important; }
.auth-title { color: #0F172A !important; }
.auth-subtitle { color: #64748B !important; }

/* ── Cache header/nav quand auth visible ── */
body:has(#auth-page:not(.hidden)) #header,
body:has(#auth-page:not(.hidden)) #bottom-nav,
body:has(#auth-page:not(.hidden)) .bnav {
    display: none !important;
}

.h-captcha {
    margin: 12px 0 !important;
}
