/* =============================================================================
   WBI GOODIES — auth.css
   Composant commun aux pages d'authentification autonomes (login, inscription).
   Ces pages ne passent pas par le header commun : elles ont leur propre <head>.
   Ce fichier remplace les anciens blocs <style> inline dupliqués (classes
   .login-* / .reg-*) par un composant unique .auth-* branché sur les tokens du
   design system (style.css doit être chargé AVANT ce fichier).

   Modifieurs conservés pour les différences VOLONTAIRES :
     • .auth-right--center      → login centre son formulaire verticalement
     • .auth-form-wrap--narrow  → login (420px) vs inscription (460px par défaut)
     • .auth-left--login        → bannière compacte + illustration masquée en mobile
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
    background: var(--bg-page);
}

/* ── Grille plein écran ──────────────────────────────────────────────────── */
.auth-row { min-height: 100vh; }

/* ── Panneau gauche (bleu WBI) ───────────────────────────────────────────── */
.auth-left {
    background: linear-gradient(145deg,
                var(--wbi-600) 0%, var(--wbi-700) 55%, var(--wbi-800) 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: ''; position: absolute;
    width: 500px; height: 500px; border-radius: 50%;
    background: rgba(255,255,255,.04);
    top: -120px; right: -100px; pointer-events: none;
}
.auth-left::after {
    content: ''; position: absolute;
    width: 380px; height: 380px; border-radius: 50%;
    background: rgba(255,255,255,.03);
    bottom: -80px; left: -80px; pointer-events: none;
}

/* Contenu du panneau gauche (accroche + étapes d'inscription) */
.auth-left__title { font-size: 1.75rem; color: #fff; letter-spacing: -.02em; line-height: 1.2; }
.auth-left__lead  { color: rgba(255,255,255,.65); font-size: .9rem; line-height: 1.7; max-width: 340px; }
.auth-steps { margin-top: 2rem; display: flex; flex-direction: column; gap: .875rem; }
.auth-step  { display: flex; align-items: center; gap: .875rem; }
.auth-step__icon {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.auth-step__icon i { color: #fff; font-size: .85rem; }
.auth-step__text   { font-size: .85rem; color: rgba(255,255,255,.75); line-height: 1.4; }

/* Décor login : logo mobile + illustration SVG */
.auth-logo-mobile  { font-size: 1rem; opacity: .9; }
.auth-illustration { width: 100%; max-width: 380px; height: auto; }

/* ── Panneau droit (formulaire) ──────────────────────────────────────────── */
.auth-right {
    background: #fff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;      /* défaut : formulaires longs (inscription) */
    justify-content: center;
    overflow-y: auto;
}
.auth-right--center { align-items: center; }   /* login : centrage vertical */

.auth-form-wrap { width: 100%; max-width: 460px; padding: 2.5rem 2.25rem; }
.auth-form-wrap--narrow { max-width: 420px; }

.auth-form-title { color: var(--tx-1); font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.auth-link       { color: var(--wbi-600); }
.auth-form--blocked { opacity: .5; pointer-events: none; }

/* Champs — font-size 1rem (≥16px) empêche le zoom automatique sur iOS */
.auth-form-wrap .form-control,
.auth-form-wrap .form-select {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: 1rem;
    padding: .6rem .9rem;
    color: var(--tx-1);
    background: #fff;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.auth-form-wrap .form-control:focus,
.auth-form-wrap .form-select:focus {
    border-color: var(--wbi-400);
    box-shadow: var(--sh-focus);
    outline: none;
}
.auth-form-wrap .form-label {
    font-weight: 500; font-size: .875rem;
    color: var(--tx-1); margin-bottom: .35rem;
}
.auth-form-wrap .alert { border-radius: var(--r-md); font-size: .875rem; }

/* Bouton principal (ex-.btn-register) */
.auth-btn {
    background: var(--wbi-600);
    border: none; border-radius: var(--r-md);
    color: #fff; font-size: 1rem; font-weight: 600;
    padding: .75rem 1.5rem; width: 100%;
    transition: background var(--tr), box-shadow var(--tr);
    box-shadow: 0 2px 8px rgba(0,30,90,.22);
}
.auth-btn:hover, .auth-btn:focus {
    background: var(--wbi-700);
    box-shadow: 0 4px 14px rgba(0,30,90,.30);
    color: #fff;
}

/* Indicateur de force du mot de passe (inscription) */
.pwd-strength { height: 4px; border-radius: 4px; background: var(--gray-150); margin-top: 6px; overflow: hidden; }
.pwd-strength__bar { height: 100%; width: 0; border-radius: 4px; transition: width .3s ease, background .3s ease; }

/* Carte succès (inscription) */
.success-card {
    background: var(--ok-50);
    border: 1.5px solid #bbf7d0;
    border-radius: var(--r-lg);
    padding: 2rem; text-align: center;
}
.success-card__icon {
    width: 64px; height: 64px;
    background: #dcfce7; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem; color: var(--ok-600);
}
.success-card__title { font-size: 1.25rem; font-weight: 700; color: var(--ok-700); margin: 0 0 .5rem; }
.success-card__text  { font-size: .9rem;   color: #166534; line-height: 1.6; margin: 0 0 .5rem; }
.success-card__note  { font-size: .875rem; color: #166534; line-height: 1.6; margin: 0 0 1.5rem; }
.success-card__btn {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--wbi-600); color: #fff;
    font-size: .875rem; font-weight: 600;
    padding: .55rem 1.25rem; border-radius: 9px; text-decoration: none;
}

/* Carte maintenance (maintenance.php) — même gabarit que .success-card,
   palette ambre plutôt que verte (pas une réussite, un état temporaire). */
.maintenance-card {
    background: var(--wn-50);
    border: 1.5px solid var(--wn-100);
    border-radius: var(--r-lg);
    padding: 2rem; text-align: center;
}
.maintenance-card__icon {
    width: 64px; height: 64px;
    background: var(--wn-100); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem; color: var(--wn-600);
}
.maintenance-card__title { font-size: 1.25rem; font-weight: 700; color: var(--wn-700); margin: 0 0 .5rem; }
.maintenance-card__text  { font-size: .9rem; color: var(--tx-1); line-height: 1.6; margin: 0; white-space: pre-line; }

/* ── Responsive commun ───────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .auth-left  { min-height: 200px; }
    .auth-right { min-height: unset; }
    .auth-form-wrap { padding: 2rem 1.5rem; }
}
@media (max-width: 575.98px) {
    .auth-form-wrap { padding: 1.5rem 1rem; }
    /* Zones tactiles ≥ 48px sur mobile */
    .auth-form-wrap .form-control,
    .auth-form-wrap .form-select,
    .auth-form-wrap .input-group-text,
    .auth-form-wrap .btn { min-height: 48px; }
}

/* ── Responsive spécifique login ─────────────────────────────────────────────
   Sur mobile, le panneau bleu devient une bannière compacte (logo seul) :
   l'illustration SVG et l'accroche sont masquées. */
@media (max-width: 991.98px) {
    .auth-left--login { min-height: 0; padding: 1.25rem 1.5rem !important; }
    .auth-left--login .flex-grow-1,
    .auth-left--login .mt-auto { display: none !important; }
    .auth-right--center { min-height: unset; flex: 1; align-items: flex-start; padding-top: 0; }
    .auth-form-wrap--narrow { padding: 2rem 1.5rem 2.5rem; max-width: 100%; }
}
@media (max-width: 575.98px) {
    .auth-left--login { padding: 1rem 1.25rem !important; }
    .auth-form-wrap--narrow { padding: 1.75rem 1.25rem 2.5rem; }
}

/* Support viewport dynamique mobile (notch, barre nav) */
@supports (min-height: 100dvh) {
    .auth-right { min-height: 100dvh; }
}

/* ── Correctif mobile : formulaire de login visible ──────────────────────────
   La grille flex (.row) avec min-height:100vh étirait les deux colonnes sur
   toute la hauteur (align-content: stretch) : le bandeau bleu occupait ~tout
   l'écran et poussait le formulaire hors de vue. On empile donc les panneaux
   en blocs sur mobile — chacun prend la hauteur de son contenu.
   Placé en fin de fichier pour passer après le bloc @supports ci-dessus. */
@media (max-width: 991.98px) {
    .auth-row { display: block; min-height: 0; }
    .auth-left,
    .auth-right { min-height: 0; }
    .auth-left--login { min-height: 0 !important; }
}
