/*
 * Pages OAuth du parent (/oauth/login, /oauth/mfa, /oauth/forgot-password) et pages des liens
 * mail (/verify-email, /account/confirm-email, /reset-password) : charte NEOW, sans aucune
 * ressource tierce. Servi en statique sous /auth/, jamais sous /oauth ni /api.
 *
 * Thème clair ou sombre selon prefers-color-scheme. Sous 480 px (navigateur système de l'app),
 * pas de carte : la page occupe l'écran. À partir de 480 px, carte centrée de 400 px (OAuth)
 * ou 440 px (liens mail). Champs de 48 px en 16 px (pas de zoom iOS), cibles de 44 px minimum.
 *
 * Aucun style en ligne dans les templates : les pages des liens mail ont une CSP style-src 'self'.
 */

/* Inter auto-hébergée par le back-office (LOT 1) ; repli sur la police système tant qu'elle manque. */
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/admin/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    --neow-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --neow-bg: #fafafa;
    --neow-surface: #ffffff;
    --neow-subtle: #f6f5f9;
    --neow-line: #eceaf2;
    --neow-line-strong: #dcdce2;
    --neow-control: #8a8896;
    --neow-ink: #171717;
    --neow-muted: #5c5c66;
    --neow-link: #5b32d6;
    --neow-lav: #f5f3ff;
    --neow-lav-line: #dcd4fb;
    --neow-primary-bg: #171717;
    --neow-primary-fg: #ffffff;
    --neow-focus: #6a3df0;
    --neow-ring: rgba(106, 61, 240, .15);
    --neow-disabled-bg: #f4f4f6;
    --neow-ok-bg: #f0fad2;
    --neow-ok-fg: #3d5200;
    --neow-warn-bg: #fff1e6;
    --neow-warn-fg: #8a3b00;
    --neow-danger-bg: #fdecef;
    --neow-danger-fg: #9f1239;
}

@media (prefers-color-scheme: dark) {
    :root {
        --neow-bg: #0e0d13;
        --neow-surface: #16151e;
        --neow-subtle: #1e1c29;
        --neow-line: #2a2837;
        --neow-line-strong: #3a3849;
        --neow-control: #6b6880;
        --neow-ink: #f3f2f8;
        --neow-muted: #a9a7b8;
        --neow-link: #bba6ff;
        --neow-lav: #221c38;
        --neow-lav-line: #3b3160;
        --neow-primary-bg: #f3f2f8;
        --neow-primary-fg: #121117;
        --neow-focus: #8b5cff;
        --neow-ring: rgba(139, 92, 255, .25);
        --neow-disabled-bg: #1e1c29;
        --neow-ok-bg: #26310b;
        --neow-ok-fg: #d2ee6b;
        --neow-warn-bg: #3a2313;
        --neow-warn-fg: #ffb98a;
        --neow-danger-bg: #3a1620;
        --neow-danger-fg: #ffb3c1;
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--neow-bg);
    color: var(--neow-ink);
    font-family: var(--neow-font);
    font-size: 16px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

h1, h2, p, ol, ul { margin: 0; }
a { color: var(--neow-link); }
:focus-visible { outline: 2px solid var(--neow-focus); outline-offset: 2px; }

.neow-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.neow-icon { display: block; flex: none; }

/* Page et carte */
.neow-page {
    flex: 1 0 auto;
    width: 100%;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.neow-page--public { gap: 28px; }

@media (min-width: 480px) {
    body { align-items: center; justify-content: center; padding: 48px 24px; }
    .neow-page {
        flex: none;
        max-width: 400px;
        padding: 32px;
        background: var(--neow-surface);
        border: 1px solid var(--neow-line);
        border-radius: 24px;
    }
    .neow-page--public { max-width: 440px; gap: 20px; }
}

.neow-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.neow-logo { display: block; align-self: flex-start; height: 48px; width: auto; margin: -8px -14px; }
.neow-page--public .neow-logo { height: 40px; }

.neow-intro { display: flex; flex-direction: column; gap: 8px; }
.neow-title { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.5px; }
.neow-page--public .neow-title { font-size: 22px; line-height: 28px; letter-spacing: -.4px; }
.neow-title:focus { outline: none; }
.neow-title:focus-visible { outline: 2px solid var(--neow-focus); outline-offset: 4px; border-radius: 6px; }
.neow-lead { font-size: 15px; color: var(--neow-muted); }
.neow-body { overflow-wrap: anywhere; }
.neow-lead strong, .neow-body strong, .neow-note strong {
    color: var(--neow-ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Formulaires */
.neow-form { margin: 0; display: flex; flex-direction: column; gap: 16px; }
.neow-page--public .neow-form { gap: 20px; }
.neow-field { display: flex; flex-direction: column; gap: 8px; }
.neow-field > label { font-size: 14px; line-height: 20px; font-weight: 600; }
.neow-page--public .neow-field > label { font-size: 15px; }

.neow-input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 20px;
    border: 1px solid var(--neow-control);
    border-radius: 9999px;
    background: var(--neow-surface);
    color: var(--neow-ink);
    font: inherit;
    font-size: 16px;
}
/* Bordure de 2 px dessinée par l'ombre (pas de saut de mise en page) ; l'outline transparent
   reste visible en mode contraste élevé, où les ombres disparaissent. */
.neow-input:focus {
    border-color: var(--neow-focus);
    box-shadow: 0 0 0 1px var(--neow-focus), 0 0 0 5px var(--neow-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}
.neow-input[aria-invalid="true"] {
    border-color: var(--neow-danger-fg);
    box-shadow: 0 0 0 1px var(--neow-danger-fg);
}
.neow-input[aria-invalid="true"]:focus { outline-color: var(--neow-focus); }

.neow-input--code {
    height: 56px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: .35em;
    text-indent: .35em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.neow-password { position: relative; }
.neow-password .neow-input { padding-right: 52px; }
.neow-reveal {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--neow-muted);
    cursor: pointer;
}
.neow-reveal[aria-pressed="true"] { background: var(--neow-lav); color: var(--neow-link); }
.neow-reveal[aria-pressed="true"] .neow-icon-show,
.neow-reveal[aria-pressed="false"] .neow-icon-hide { display: none; }

.neow-hint { font-size: 13px; line-height: 1.45; color: var(--neow-muted); }
.neow-page--public .neow-hint { font-size: 14px; line-height: 20px; }
.neow-hint ul { margin: 2px 0 0; padding: 0 0 0 20px; }
.neow-hint ul + p { margin-top: 4px; }

.neow-field-errors { display: flex; flex-direction: column; gap: 4px; }
.neow-field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--neow-danger-fg);
}
.neow-field-error .neow-icon { margin-top: 2px; }

/* Boutons : un seul primaire par écran */
.neow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: var(--neow-primary-bg);
    color: var(--neow-primary-fg);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.neow-btn:hover { opacity: .88; }
.neow-btn--secondary { background: var(--neow-surface); border-color: var(--neow-control); color: var(--neow-ink); }
.neow-btn:disabled {
    background: var(--neow-disabled-bg);
    border-color: var(--neow-line);
    color: var(--neow-muted);
    opacity: 1;
    cursor: not-allowed;
}
/* Envoi en cours : le bouton garde son apparence, avec un indicateur. */
.neow-btn[aria-busy="true"]:disabled {
    background: var(--neow-primary-bg);
    border-color: transparent;
    color: var(--neow-primary-fg);
    cursor: progress;
}
.neow-btn--secondary[aria-busy="true"]:disabled {
    background: var(--neow-surface);
    border-color: var(--neow-control);
    color: var(--neow-ink);
}
.neow-btn .neow-spinner,
.neow-btn .neow-wait-icon { display: none; }
.neow-btn[aria-busy="true"] .neow-spinner { display: block; animation: neow-spin .9s linear infinite; }
.neow-btn[data-neow-waiting] .neow-wait-icon { display: block; }
@keyframes neow-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .neow-btn[aria-busy="true"] .neow-spinner { display: none; }
}

/* Liens */
.neow-link {
    align-self: center;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--neow-link);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.neow-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 44px;
    margin: -12px 0 -4px -8px;
    padding: 0 12px 0 4px;
    border-radius: 9999px;
    color: var(--neow-link);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}
.neow-back:hover { text-decoration: underline; }

/* Messages */
.neow-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}
.neow-alert .neow-icon { margin-top: 1px; }
.neow-alert--danger { background: var(--neow-danger-bg); color: var(--neow-danger-fg); }
.neow-alert--ok { background: var(--neow-ok-bg); color: var(--neow-ok-fg); }

.neow-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--neow-muted);
}
.neow-note .neow-icon { margin-top: 1px; }
/* Horodatage d'une page d'erreur 5xx (templates/bundles/TwigBundle/Exception) */
.neow-note time { color: var(--neow-ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Adresse à garder sur une ligne : le trait d'union de flow@neow-kids.com ne doit pas la couper. */
.neow-nowrap { white-space: nowrap; }
@media (min-width: 480px) {
    .neow-note { padding: 12px 16px; border-radius: 14px; background: var(--neow-subtle); }
}

.neow-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 9999px;
    background: var(--neow-lav);
    color: var(--neow-link);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Aide de connexion, identique pour tous les comptes */
.neow-help { border: 1px solid var(--neow-line); border-radius: 16px; background: var(--neow-surface); }
@media (min-width: 480px) { .neow-help { background: var(--neow-subtle); } }
.neow-help summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}
.neow-help summary::-webkit-details-marker { display: none; }
.neow-help[open] .neow-chevron { transform: rotate(180deg); }
.neow-help ul {
    list-style: none;
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    line-height: 1.45;
}
.neow-help li { display: flex; align-items: flex-start; gap: 10px; }
.neow-help li .neow-icon { margin-top: 1px; color: var(--neow-muted); }
.neow-help a { font-weight: 600; text-underline-offset: 3px; }

/* « Lien envoyé » */
.neow-sent {
    align-self: flex-start;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--neow-ok-bg);
    color: var(--neow-ok-fg);
}
.neow-steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.45; }
.neow-steps li { display: flex; align-items: flex-start; gap: 12px; }
.neow-steps strong { font-weight: 600; }
.neow-step {
    flex: none;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--neow-lav);
    color: var(--neow-link);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Pages des liens mail : composant d'état (_public_macros.status) */
.neow-status {
    width: 48px;
    height: 48px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
}
.neow-status--ok { background: var(--neow-ok-bg); color: var(--neow-ok-fg); }
.neow-status--neutre { background: var(--neow-lav); color: var(--neow-link); }
.neow-status--danger { background: var(--neow-danger-bg); color: var(--neow-danger-fg); }
.neow-page--public .neow-intro { gap: 10px; }

.neow-next {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--neow-lav-line);
    border-radius: 16px;
    background: var(--neow-lav);
    font-size: 15px;
    line-height: 22px;
    overflow-wrap: anywhere;
}
.neow-next h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    color: var(--neow-link);
}

.neow-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 22px;
}
.neow-box .neow-icon { margin-top: 1px; }
.neow-box p { display: flex; flex-direction: column; gap: 2px; }
.neow-box strong { font-weight: 700; }
.neow-box--warn { background: var(--neow-warn-bg); color: var(--neow-warn-fg); }
