/* ============================================================
   GEOFIXE — Pages d'authentification (refonte V2, thème clair)
   ============================================================ */

.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(60% 50% at 50% -10%, rgba(109,59,235,.10), transparent 70%),
        radial-gradient(40% 40% at 100% 100%, rgba(31,169,122,.07), transparent 70%),
        var(--bg);
}

.auth-wrap { width: 100%; max-width: 420px; }

.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo .brand { font-size: 1.6rem; justify-content: center; }
.auth-logo p { margin-top: .4rem; font-size: .92rem; color: var(--muted); }

.auth-card {
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--r-xl);
    padding: clamp(1.75rem, 5vw, 2.5rem);
    box-shadow: var(--shadow-lg);
}
.auth-card__header { margin-bottom: 1.6rem; }
.auth-card__header h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.auth-card__header p { font-size: .92rem; color: var(--muted); }

.secure-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--trust-100); color: var(--trust);
    border-radius: var(--r-full);
    padding: .35rem .8rem;
    font-size: .76rem; font-weight: 600;
    margin-bottom: 1.1rem;
}

/* Messages */
.msg {
    padding: .8rem 1rem; border-radius: var(--r-md);
    font-size: .9rem; font-weight: 500; margin-bottom: 1rem;
    display: none;
}
.msg.error   { background: #fdecee; border: 1px solid #f6c9cf; color: #c0334a; display: block; }
.msg.success { background: var(--trust-100); border: 1px solid #b8e6d3; color: var(--trust); display: block; }

/* Formulaire */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block; font-size: .8rem; font-weight: 600;
    color: var(--ink-soft); margin-bottom: .45rem; letter-spacing: .01em;
}
.form-control {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: .8rem 1rem;
    font: inherit; font-size: 1rem;
    color: var(--ink);
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    -webkit-appearance: none;
}
.form-control::placeholder { color: var(--faint); }
.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring);
}

.pw-wrap { position: relative; }
.pw-toggle {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--faint); padding: .3rem; font-size: 1rem;
}
.pw-toggle:hover { color: var(--ink-soft); }

.forgot-link {
    display: block; text-align: right; font-size: .85rem;
    color: var(--brand-600); font-weight: 600;
    margin: -.4rem 0 1.2rem;
}
.forgot-link:hover { text-decoration: underline; }

/* Bouton principal (réutilise .btn .btn-primary mais full + spinner) */
.btn-login { width: 100%; position: relative; }
.btn-login .spinner { display: none; }
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner { display: block; }
.btn-login:disabled { opacity: .55; cursor: not-allowed; }

/* État de redirection */
#redirectingState { display: none; text-align: center; padding: .75rem 0; }
#redirectingState.show { display: block; }
.redirect-icon { font-size: 1.8rem; margin-bottom: .4rem; color: var(--brand); }
#redirectingState p { color: var(--muted); font-size: .92rem; }
.redirect-bar { height: 4px; background: var(--surface-2); border-radius: var(--r-full); margin-top: 1rem; overflow: hidden; }
.redirect-fill { height: 100%; background: var(--brand); border-radius: var(--r-full); animation: load 1.5s ease forwards; }
@keyframes load { from { width: 0; } to { width: 100%; } }

/* Pied de carte */
.auth-card__footer {
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--border); text-align: center;
}
.auth-card__footer p { font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.help-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.help-links a { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.help-links a:hover { color: var(--brand-600); }

.auth-bottom { margin-top: 1.5rem; text-align: center; font-size: .82rem; color: var(--faint); }
.auth-bottom a { color: var(--faint); }
.auth-bottom a:hover { color: var(--muted); }

/* Modal reset MDP */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(27,24,48,.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 1.5rem;
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
    background: var(--surface); border: var(--card-border);
    border-radius: var(--r-xl); padding: clamp(1.75rem,5vw,2.25rem);
    width: 100%; max-width: 410px; position: relative;
    transform: translateY(12px); transition: transform .25s;
    box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); border: var(--card-border);
    color: var(--muted); font-size: 1rem;
}
.modal-close:hover { background: var(--brand-100); color: var(--brand-600); }
.modal-box h2 { font-size: 1.2rem; margin-bottom: .5rem; }
.modal-box > p { font-size: .92rem; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.6; }
#resetMessage { font-size: .9rem; min-height: 1.3rem; margin-bottom: .75rem; }
#resetMessage.ok  { color: var(--trust); }
#resetMessage.err { color: #c0334a; }
.btn-cancel {
    width: 100%; padding: .75rem; margin-top: .5rem;
    background: none; border: 1.5px solid var(--border-strong);
    border-radius: var(--r-md); font: inherit; font-weight: 600;
    color: var(--ink-soft);
}
.btn-cancel:hover { border-color: var(--brand); color: var(--brand-600); }

/* Switch thème (pages auth) : flottant en haut à droite */
.auth-theme-toggle { position: fixed; top: 1.1rem; right: 1.1rem; z-index: 50; }
