/* ════════════════════════════════════════════════════════════════════
   Page Connexion — réglages LOCAUX (au design du design system).
   La carte, les champs et les boutons viennent de auth-ds.css + atelier.css.
   Ici : bascule du logo selon le thème, onglets (segmenté), puces de langue.
   ════════════════════════════════════════════════════════════════════ */

/* Logo bi-thème : noir en clair, blanc en sombre. */
.auth-logo-w { display: none; }
[data-theme="dark"] .auth-logo-b { display: none; }
[data-theme="dark"] .auth-logo-w { display: block; }

/* Langue : puce du DS (.chip) qui ouvre un menu M3 du DS (.menu, choix = menuitemradio). */
.auth-lang-t { background: var(--md-sys-color-surface); }   /* posée sur l'illustration : fond opaque */

.auth-lang-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 200px; }   /* placement uniquement */
.auth-lang-menu[hidden] { display: none; }

/* Sur un petit écran, la pastille se réduit au drapeau + au code de la langue. */
@media (max-width: 420px) {
  .auth-lang { top: 10px; right: 10px; }
  .auth-lang-t .auth-lang-nom { display: none; }
}

/* Case de consentement RGPD (inscription) : case native + liens de marque. */
.auth-consent { margin: 2px 0 4px; }   /* case du DS (.ex-check--box) ; placement uniquement */
.auth-consent-txt { font: var(--md-sys-typescale-body-small); color: var(--muted); }
.auth-consent-txt a { white-space: nowrap; }

/* Aide sous un champ (ex. date de naissance, « comment nous as-tu découverts »). */
.auth-form .ex-hint { display: block; margin-top: 0; font-size: var(--md-sys-typescale-label-medium-size); line-height: 1.4; color: var(--muted); }
.auth-form .ex-opt { font-weight: 400; color: var(--muted); }
/* Tant que le placeholder (option désactivée) est affiché, on grise le texte du
   select pour qu'il se lise comme une invite à choisir — pas comme une réponse. */
.auth-form .ex-field select:has(option:disabled:checked) { color: var(--muted); }

/* Champ mot de passe : champ à suffixe du DS (.ex-affix) + bouton icône du DS (.ibtn) en fin pour afficher / masquer. */

/* ════════════════════════════════════════════════════════════════════
   DEUX VOLETS (demande du porteur, 2026-09-14, d'après sa maquette) :
   à gauche un panneau sombre avec la promesse et les 3 étapes de
   l'inscription, à droite le formulaire. Tokens du DS ; les champs et
   boutons restent les composants .ex-field / .cbtn.
   ════════════════════════════════════════════════════════════════════ */
body.ds-auth { padding: 0; min-height: 100vh; align-items: stretch; }
/* Plein écran (demande du porteur : « vraiment immersif ») : le cadre prend tout
   l'écran, le volet gauche est un mur noir sur toute la hauteur. */
.auth-shell { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; width: 100%; min-height: 100vh; background: var(--panel); }

/* Volet gauche : noir + halo rose SydePlay (la maquette avait un halo violet ;
   le violet n'existe pas dans le DS hors tags, on reste sur la marque). */
/* Couleurs du volet tirées des jetons du DS (rôles « sur un média ») : noir et blanc dans
   les deux thèmes, voulu (le logo blanc y est posé). Plus de couleur écrite en dur ici. */
.auth-side { position: relative; padding: 0;
  --auth-side-bg: color-mix(in srgb, var(--md-sys-color-scrim) 94%, var(--md-sys-color-on-media));
  --auth-side-fg: var(--md-sys-color-on-media); }
.auth-side-in { position: relative; height: 100%; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 56px 48px; background: var(--auth-side-bg); color: var(--auth-side-fg); text-align: center; overflow: hidden; }
.auth-side-in::before { content: ""; position: absolute; inset: -40% -20% auto; height: 90%;
  background: radial-gradient(60% 55% at 50% 30%, color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent), color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent) 55%, transparent 75%); pointer-events: none; }
.auth-side-in::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 50% at 50% 100%, color-mix(in srgb, var(--md-sys-color-scrim) 55%, transparent), transparent); pointer-events: none; }
.auth-side-in > * { position: relative; z-index: 1; }
.auth-side-in::before, .auth-side-in::after { z-index: 0; }
.auth-side-logo { height: 30px; width: auto; margin-bottom: 26px; }
.auth-side-title { font: var(--md-sys-typescale-display-small); line-height: 1.15; margin: 0 0 10px; letter-spacing: -0.02em;  }
.auth-side-sub { margin: 0 0 36px; font-size: var(--md-sys-typescale-title-medium-size); line-height: 1.5; color: color-mix(in srgb, var(--auth-side-fg) 72%, transparent); max-width: 320px; }
.auth-side-login { margin: 0; font-size: var(--md-sys-typescale-title-medium-size); line-height: 1.55; color: color-mix(in srgb, var(--auth-side-fg) 72%, transparent); max-width: 320px; }

/* Étapes : pilules empilées, la courante en blanc, les faites cochées. */
.auth-steps { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.auth-steps li { font: var(--md-sys-typescale-title-small); display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 10px;
 background: color-mix(in srgb, var(--auth-side-fg) 8%, transparent); color: color-mix(in srgb, var(--auth-side-fg) 70%, transparent); transition: background .2s, color .2s; }
.auth-step-n { font: var(--md-sys-typescale-label-medium); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
 background: color-mix(in srgb, var(--auth-side-fg) 14%, transparent); }
/* Étape faite : la coche Lucide (plus de coche dessinée en CSS, qui tombait sous le centre). */
.auth-step-n svg { display: none; width: 16px; height: 16px; }
.auth-steps li.is-current { background: var(--auth-side-fg); color: var(--auth-side-bg); }
.auth-steps li.is-current .auth-step-n { background: var(--auth-side-bg); color: var(--auth-side-fg); }
.auth-steps li.is-done { color: var(--auth-side-fg); }
.auth-steps li.is-done .auth-step-n { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.auth-steps li.is-done .auth-step-d { display: none; }
.auth-steps li.is-done .auth-step-n svg { display: block; }

/* Le volet gauche s'adapte au mode : en connexion il montre la promesse, en inscription les étapes. */
.auth-shell[data-mode="login"] .auth-steps, .auth-shell[data-mode="login"] .auth-side-sub { display: none; }
.auth-shell[data-mode="register"] .auth-side-login { display: none; }

/* Volet droit : le formulaire, centré, 360 px de large. */
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 48px; }
/* Bouton « étape précédente » : chevron en haut à gauche du volet blanc (composant .ibtn du DS). */
.auth-prev { position: absolute; top: 20px; left: 20px; width: 44px !important; max-width: none; }
.auth-prev[hidden] { display: none !important; }
.auth-main > * { width: 100%; max-width: 360px; }
/* Le logo du volet droit ne sert qu'en mobile (le volet gauche le porte en bureau). */
.auth-logo-link { display: none; text-align: center; }
.auth-logo { display: block; height: 24px; width: auto; margin: 0 auto 22px; }
.auth-pane[hidden] { display: none; }
/* Inscription : plus de sous-titre sous le titre (23/09/2026), le titre garde donc l'écart
   qu'avait le sous-titre avant le formulaire. */
#pane-register .auth-title { margin-bottom: 22px; }
.auth-fs { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.auth-fs[hidden] { display: none !important; }
.auth-nav { display: flex; gap: 10px; margin-top: 4px; }
.auth-nav .cbtn { margin: 0; }
.auth-nav .auth-next, .auth-nav .auth-submit { flex: 1; }
.auth-switch { margin: 0; font-size: var(--md-sys-typescale-body-small-size); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.auth-switch button { background: none; border: 0; padding: 0; cursor: pointer; font-size: var(--md-sys-typescale-body-small-size);  }
.auth-back { margin-top: 18px; justify-content: center; font-size: var(--md-sys-typescale-body-small-size);  }
.auth-error { margin-top: 14px; }

/* Écran fixe (retour du porteur 23/09/2026) : sur ordinateur, le cadre tient toute la
   hauteur sans défilement de la page, le formulaire reste centré. Sur un écran très bas,
   seul le volet du formulaire défile, jamais la page. Téléphone : la page défile. */
@media (min-width: 901px) {
  body.ds-auth { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .auth-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .auth-side-in { min-height: 0; }
  .auth-main { min-height: 0; overflow-y: auto; }
}

/* Étape 2 : photo ou avatar (avatar 84 du DS) à côté de ses deux boutons ; Nom et Pays
   sur une ligne ; date en 3 menus. Mise en page uniquement. */
.auth-ava-row { display: flex; align-items: center; gap: 12px; }
.auth-ava-row .ava { flex: none; }
.auth-ava-btns { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.auth-form .auth-ava-btns .cbtn { margin: 0; }
.auth-row { display: flex; align-items: flex-end; gap: 12px; }
.auth-row > * { min-width: 0; }
.auth-row-grow { flex: 1; }
.auth-country { flex: none; width: 150px; }

/* Fenêtre « Crée ton avatar » : aperçu (avatar 112 du DS) centré, puis les trois choix. */
/* .avm-body, .avm-preview, .avm-group : mise en page de l'éditeur, dans atelier.css (DS). */

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); min-height: 100vh; }   /* minmax : la colonne ne s'élargit jamais au-delà de l'écran */
  .auth-side { padding: 0; }
  .auth-side-in { min-height: 0; padding: 22px 20px; }
  .auth-prev { top: 12px; left: 12px; }
  .auth-side-logo { display: none; }
  .auth-logo-link { display: block; }
  .auth-side-title { font-size: var(--md-sys-typescale-headline-small-size);  }
  .auth-side-sub, .auth-side-login { display: none !important; }
  .auth-steps { flex-direction: row; gap: 6px; max-width: none; }
  /* min-width 0 : sans lui, « Dernière étape » élargissait la page au-delà de l'écran du téléphone. */
  .auth-steps li { flex: 1; min-width: 0; height: 40px; padding: 0 10px; font-size: var(--md-sys-typescale-body-small-size);  }
  .auth-steps li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth-main { padding: 24px 20px 28px; }
}

/* Connexion en deux temps : l'e-mail validé s'affiche dans un champ du DS (.ex-field + .ex-affix,
   même bloc que le mot de passe, pleine largeur), photo ou initiale à gauche, « Modifier » à
   droite (retour du porteur 25/09/2026). Placement uniquement. */
.auth-known-field { margin: 0 0 16px; }
.auth-known { gap: 10px; padding-left: 7px; }   /* avatar de 30 px centré dans le champ de 44 px */
.auth-known-mail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--md-sys-color-on-surface); }
.auth-known-edit { flex: none; }

/* Connexion Google : bouton contour avec le « G » officiel, séparateur « ou ». */
.auth-google { width: 100%; justify-content: center; gap: 10px; margin-bottom: 4px; background: var(--panel); }
.auth-google .auth-g { flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; font-size: var(--md-sys-typescale-label-medium-size); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-or[hidden], .auth-google[hidden] { display: none; }
/* Connexion Google pas branchée côté serveur (login.js interroge /api/auth/google/config). */
.auth-shell[data-google="off"] :is(.auth-google, .auth-or) { display: none; }
.auth-google-msg { margin: 0 0 14px; }
.auth-google-msg[hidden] { display: none; }
.auth-google-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--raised); font-size: var(--md-sys-typescale-body-medium-size);  }
.auth-google-chip[hidden] { display: none; }
.auth-google-chip-ic { display: inline-flex; }
.auth-google-chip > span { display: flex; flex-direction: column; min-width: 0; }
.auth-google-chip b { font-weight: 600; color: var(--ink); }
.auth-google-chip i { font-style: normal; font-size: var(--md-sys-typescale-body-small-size); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Confirmation de l'e-mail : le code de test (sans e-mail branché) au-dessus du champ ; placement uniquement. */
.auth-verify-dev { margin: 0 0 16px; }
.auth-verify-dev[hidden] { display: none; }
