/* =============================================================================
   LENUTA-F-398 — Écrans d'authentification, direction C « Manufacture nocturne »
   (même univers que la page d'accueil F-397 ; maquette Figma « Lenuta —
   Explorations accueil », page « Connexion »).

   Feuille UNIQUE de templates/auth_base.html (app.css n'y est plus chargée).
   Toutes les règles sont portées par body.auth-page / body.auth-page : aucune autre
   page n'est touchée. Polices OFL auto-hébergées (static/fonts, licences
   jointes), aucun CDN, aucune feuille importée.

   Contrastes WCAG 2.1 mesurés (rapport de revue F-398, § Mesures) :
     ivoire  #f4efe6 sur nuit #0f0e0c / surface #191714 → 16.85 / 15.62
     gris    #b8afa0 sur nuit / surface                → 8.89 / 8.24
     laiton  #c2a06a sur nuit / surface                → 7.84 / 7.27
     nuit sur bouton ivoire                            → 16.85
     placeholder #948b7d sur champ nuit                → 5.74
     bordure champ #8a8276 sur champ / surface         → 5.09 / 4.71 (≥ 3:1)
     erreur #e8a598 sur #241815                        → 8.44
   Cibles tactiles ≥ 44 px (liens, boutons, champs).

   Cache : /static est servi `immutable` (main.py) — une police REMPLACÉE doit
   changer de nom de fichier.
   ========================================================================== */

@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

body.auth-page {
  --night: #0f0e0c;
  --surface: #191714;
  --ivory: #f4efe6;
  --muted: #b8afa0;
  --brass: #c2a06a;
  --line: #2e2a24;
  --field: #8a8276;
  --ph: #948b7d;
  --err-ink: #e8a598;
  --err-bg: #241815;
  --err-line: #6b3a33;
  --serif: "Cormorant Garamond", "Garamond", "Georgia", serif;
  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --gutter: 80px;

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-page :where(h1, p, form, ul) { margin: 0; }
.auth-page :focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.auth-page h1:focus { outline: none; }

.cx-skip { position: absolute; left: -9999px; }
.cx-skip:focus { left: 16px; top: 16px; z-index: 10; display: inline-flex; align-items: center; min-height: 44px; background: var(--ivory); color: var(--night); padding: 0 14px; }

/* ── En-tête : marque + retour à l'accueil ─────────────────────────────── */
.cx-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.cx-brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ivory); text-decoration: none; }
.cx-brand .lx-mark { width: 34px; height: 34px; color: var(--ivory); flex: none; --lx-brass: var(--brass); }
.cx-brand__name { font: 500 22px/1 var(--serif); letter-spacing: 0.3em; text-transform: uppercase; }
.cx-back {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px;
  color: var(--ivory); font: 500 15px/1.2 var(--sans); text-decoration: none;
}
.cx-back:hover .cx-back__long, .cx-back:hover .cx-back__short { text-decoration: underline; text-underline-offset: 4px; }
.cx-back__arrow { color: var(--brass); }
.cx-back__short { display: none; }

/* ── Corps : introduction | panneau ────────────────────────────────────── */
.cx-main {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 96px;
  padding: 64px var(--gutter);
}
.cx-intro { display: flex; flex-direction: column; gap: 24px; max-width: 600px; }
.cx-kicker, .cx-step { font: 500 12px/1.4 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); }
.cx-title { font: 300 68px/1 var(--serif); letter-spacing: -0.01em; color: var(--ivory); }
.cx-lead { max-width: 520px; font-size: 18px; line-height: 1.65; color: var(--muted); }

.cx-panel {
  flex: none;
  width: 440px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.auth-page .lenuta-auth { display: flex; flex-direction: column; gap: 20px; }
.cx-h { font: 300 44px/1.05 var(--serif); color: var(--ivory); }
.auth-page .auth-hint { font-size: 15px; line-height: 1.55; color: var(--muted); }
.auth-page .auth-hint strong { color: var(--ivory); font-weight: 600; overflow-wrap: anywhere; }
.auth-page .auth-hint--refus,
.auth-page .error {
  padding: 12px 14px;
  background: var(--err-bg);
  border: 1px solid var(--err-line);
  border-radius: 2px;
  color: var(--err-ink);
  font-size: 15px;
  font-weight: 500;
}
.auth-page .auth-hint--refus { margin: 0; }
.auth-page ul.auth-hint { padding-left: 1.2em; }

/* ── Formulaire ───────────────────────────────────────────────────────── */
.auth-page .lenuta-form { display: flex; flex-direction: column; gap: 8px; }
.auth-page .lenuta-form label { font: 600 12px/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ivory); }
.auth-page .lenuta-form input[type="email"],
.auth-page .lenuta-form input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--night);
  border: 1px solid var(--field);
  border-radius: 2px;
  color: var(--ivory);
  font: 400 16px/1.2 var(--sans);   /* 16 px : pas de zoom automatique sur iPhone */
}
.auth-page .lenuta-form input::placeholder { color: var(--ph); opacity: 1; }
.auth-page .lenuta-form input:focus { border-color: var(--ivory); }
.auth-page .lenuta-form input[aria-invalid="true"] { border-color: var(--err-ink); }
.auth-page .auth-code-input {
  min-height: 60px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}
.auth-page .lenuta-form button[type="submit"] {
  margin-top: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  background: var(--ivory);
  border: 1px solid var(--ivory);
  border-radius: 2px;
  color: var(--night);
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.auth-page .lenuta-form button[type="submit"]:hover { background: #fff; }

/* Liens secondaires : « Renvoyer le code » (POST) et « Changer d'adresse ». */
.auth-page .auth-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; }
.auth-page .auth-alt p { margin: 0; }
.cx-inline-form { display: inline; }
.cx-linkbtn, .cx-link, .auth-page .auth-alt a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  color: var(--ivory); font: 500 15px/1.3 var(--sans);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--brass);
}
.cx-linkbtn:hover, .cx-link:hover, .auth-page .auth-alt a:hover { text-decoration-color: var(--ivory); }

/* Raccourcis TEST/dev : discrets, séparés par un filet. */
.auth-page details.dev-only {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  word-break: break-all;
}
.auth-page details.dev-only summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--brass); }
.auth-page details.dev-only code { color: var(--ivory); font-size: 18px; letter-spacing: 0.1em; }
.auth-page details.dev-only .lenuta-form button[type="submit"] { background: transparent; color: var(--ivory); border-color: var(--field); }
.auth-page details.dev-only .lenuta-form button[type="submit"]:hover { border-color: var(--ivory); }

/* ── Pied de page ─────────────────────────────────────────────────────── */
.cx-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}

/* ── Tablette ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  body.auth-page { --gutter: 40px; }
  .cx-main { gap: 48px; }
  .cx-title { font-size: 52px; }
}

/* ── Téléphone : le formulaire d'abord, l'introduction réduite au surtitre ─ */
@media (max-width: 860px) {
  body.auth-page { --gutter: 20px; }
  .cx-header { padding: 8px var(--gutter); }
  .cx-brand .lx-mark { width: 28px; height: 28px; }
  .cx-brand__name { font-size: 18px; }
  .cx-back__long { display: none; }
  .cx-back__short { display: inline; }
  .cx-main { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 20px; padding: 28px var(--gutter); }
  .cx-intro { max-width: none; }
  .cx-title, .cx-lead { display: none; }
  .cx-panel { width: 100%; max-width: 480px; padding: 24px; }
  .cx-h { font-size: 36px; }
  .cx-footer { flex-direction: column; padding: 16px var(--gutter); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .lenuta-form button[type="submit"] { transition: none; }
}
