/* Pages hors session (includes/auth_layout.php) — propre à la zone ; charte : docs/design.md, gabarit « Pages hors
   session ». Le socle (assets/base.css) fournit champs, boutons, messages et cartes ; les couleurs et les tailles de
   texte viennent toutes de assets/reglages.css.
   Règle iOS (CLAUDE.md) : fonds en flux normal, jamais de dégradé, aucun voile ; seule la bande de la zone de l'heure
   est fixe (fin du fichier). */

html, body { background: var(--bg); }
.auth-shell {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    min-height: 100vh; min-height: 100lvh;
}

/* ── Panneau bleu (à partir de 820 px) : le bleu est peint par le panneau, en flux normal ; son contenu seul reste
   collé en haut de la fenêtre quand la page est longue (Confidentialité), si la fenêtre est assez haute ── */
.auth-panel { background: var(--auth-bg); color: var(--auth-ink); }
.auth-panel-in {
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-8);
    min-height: 100vh; min-height: 100lvh;
    padding: var(--s-12); padding-top: calc(var(--s-12) + env(safe-area-inset-top));
}
@media (min-width: 820px) and (min-height: 560px) {
    .auth-panel-in { position: sticky; top: 0; height: 100vh; min-height: 0; }
}
.auth-logo { display: block; align-self: flex-start; width: auto; height: 44px; }
.auth-panel-title {
    max-width: 14ch; font-family: var(--font-title); font-size: var(--t-3xl); font-weight: 500;
    line-height: 1.15; letter-spacing: -.02em; color: var(--auth-ink);
}
.auth-panel-lead { max-width: 38ch; margin-top: var(--s-4); font-size: var(--t-lg); line-height: 1.5; color: var(--auth-ink-2); }
.auth-features { list-style: none; display: grid; gap: var(--s-3); font-size: var(--t-md); color: var(--auth-ink-3); }
.auth-features li { display: flex; align-items: center; gap: 10px; }
.auth-features .ico { flex: none; }
.auth-panel-help { font-size: var(--t-sm); color: var(--auth-ink-2); }
.auth-panel-help a { color: var(--auth-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.auth-panel-help a:hover { text-decoration: underline; }
.auth-panel a:focus-visible { outline-color: var(--auth-ink); }

/* ── Colonne du contenu : 420 px, 680 px pour un texte long ── */
.auth-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4);
    min-width: 0; padding: var(--s-8) var(--s-5); padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom));
}
.auth-main > * { width: 100%; max-width: var(--field-max); min-width: 0; }
.auth-main > .auth-card-wide { max-width: 680px; }
.auth-band { display: none; }
.auth-card { display: grid; gap: 18px; }
.auth-card > * { margin: 0; min-width: 0; }
.auth-head { display: grid; gap: 6px; }
.auth-title { font-family: var(--font-title); font-weight: 600; font-size: var(--t-2xl); line-height: 1.2; color: var(--title); }
.auth-sub { font-size: var(--t-md); color: var(--muted); overflow-wrap: anywhere; }
.auth-desc { font-size: var(--t-md); line-height: 1.55; color: var(--text-soft); }
.auth-desc strong, .auth-card .alert strong { overflow-wrap: anywhere; }

/* Formulaire : briques du socle (ui_field(), ui_check(), ui_btn()), libellés en clair comme sur la maquette */
.auth-form { display: grid; gap: var(--s-4); }
.auth-form > *, .auth-form .form-group { margin: 0; min-width: 0; }
.auth .form-label { font-family: var(--font-ui); font-size: var(--t-sm); text-transform: none; letter-spacing: 0; color: var(--title); }
.auth-form .form-label-row a { font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; color: var(--primary); text-decoration: none; }
.auth-form .form-label-row a:hover { text-decoration: underline; }
.code-input, .recovery-input { min-height: 52px; font-family: var(--font-mono); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.code-input { font-size: var(--t-xl); letter-spacing: .18em; }
.recovery-input { font-size: var(--t-lg); letter-spacing: .12em; text-transform: uppercase; }

/* Clés d'accès (composants 59 et 71) : bouton au-dessus du formulaire, séparateur « ou », session verrouillée, second
   facteur. L'attribut hidden prime sur .btn et .alert (display imposé par le socle). */
.pk-login[hidden], .pk-login [hidden], .pk-unlock [hidden], .pk-mfa[hidden], .pk-mfa [hidden] { display: none !important; }
.pk-login, .pk-unlock, .pk-mfa { display: grid; gap: var(--s-3); }
.pk-login > *, .pk-unlock > *, .pk-mfa > * { margin: 0; min-width: 0; }
.auth-pk-note { font-size: var(--t-sm); line-height: 1.4; color: var(--muted); }
.auth-or { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-sm); color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Sous le formulaire : retour, autres moyens, mention de sécurité */
.auth-back { font-size: var(--t-sm); color: var(--text-soft); text-align: center; }
.auth-back a { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-weight: 600; color: var(--primary); text-decoration: none; }
.auth-back a:hover { text-decoration: underline; }
.auth-back > span { display: block; }
.mfa-other { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--text-soft); text-align: center; }
.mfa-other a { font-weight: 600; }
.auth-secure { display: flex; align-items: flex-start; justify-content: center; gap: var(--s-2); font-size: var(--t-sm); line-height: 1.45; color: var(--muted); }
.auth-secure .ico { flex: none; margin-top: 2px; color: var(--primary); }

/* Inscription obligatoire à la double authentification (composant 71) : cartes du socle dans la colonne large */
.auth-card .pk-add { margin-bottom: 0; }
.auth-out { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* Sous la colonne : téléphone (une colonne seulement) et lien « Confidentialité et cookies » */
.auth-help-mobile { display: none; }
.auth-help-mobile, .auth-legal { text-align: center; font-size: var(--t-sm); color: var(--muted); }
.auth-help-mobile a { font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.auth-legal a { color: var(--muted); }

/* ── Sous 820 px : une colonne, bandeau bleu avec le logo, contenu dessous ; tout ce qui se touche fait 44 px ── */
@media (max-width: 819px) {
    .auth-shell { display: block; }
    .auth-panel { display: none; }
    .auth-main { justify-content: flex-start; padding: 0 0 calc(var(--s-6) + env(safe-area-inset-bottom)); }
    .auth-main > * { width: calc(100% - 2 * var(--s-5)); }
    .auth-main > .auth-band {
        display: flex; justify-content: center; width: 100%; max-width: none; margin-bottom: var(--s-2);
        padding: calc(22px + env(safe-area-inset-top)) var(--s-5) 22px; background: var(--auth-bg);
    }
    .auth-band img { display: block; width: auto; height: 40px; }
    .auth-help-mobile { display: block; }
    .auth-back a, .auth-back .btn-link, .mfa-other a, .auth-legal a, .auth-help-mobile a, .auth-form .form-label-row a {
        display: inline-flex; align-items: center; min-width: var(--tap); min-height: var(--tap);
    }
    .auth .check-line { min-height: var(--tap); }
    .auth-card .btn, .auth-card .btn-sm { min-height: var(--tap); max-width: 100%; white-space: normal; padding-top: 8px; padding-bottom: 8px; text-align: center; }
    .auth-card .btn-icon { padding: 0; }
}

/* iOS 26 (branche fix/mobile-ios) — 3. Connexion sous 820 px : la zone de l'heure prend le bleu du
   bandeau. Safari 26 ignore theme-color et peint le haut avec le fond d'un élément fixe collé au bord
   haut (sinon celui de body) : bande fixe, bleue, de la hauteur de la zone sûre seulement
   (0 hors iPhone). Le contenu, le bas de page et le fond de body ne changent pas. Règle indépendante,
   peut être retirée seule. */
@media (max-width: 819px) {
    .auth-shell::before {
        content: ''; position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
        height: env(safe-area-inset-top, 0px); background: var(--auth-bg);
    }
}

/* Ajustements du 14/11/2026 (essai sur iPhone en production) : la bande ci-dessus ne suffit pas, la zone de l'heure restait
   grise (hauteur nulle en portrait). Le bandeau bleu lui-même devient collant au bord haut : Safari 26 reprend le fond d'un
   élément collé en haut de l'écran. Il remonte de la hauteur du logo et de sa marge haute : une fois la page défilée, seul un
   liseré bleu de 22 px reste en haut. Règle indépendante, peut être retirée seule. */
@media (max-width: 819px) {
    .auth-main > .auth-band { position: sticky; top: calc(-22px - 40px - env(safe-area-inset-top, 0px)); z-index: 4; }
}
