/*
 * Impact — l'identité des pages sans session : connexion, déconnexion, erreur de connexion
 * (templates/auth/_identite.html.twig ; docs/impact/page-connexion.md).
 *
 * Chargée seulement par ces pages, après impact.css : elle en reprend les jetons (--ink, --surface, --ai…), clair et
 * sombre par light-dark(). Le dégradé de marque lavande → cyan fait le fond et la tuile d'état ; le filet violet → cyan
 * fait le liseré du haut, celui de la carte et le trait sous le crédo. Ondes concentriques en écho au logo, sans
 * animation. Contrastes AA vérifiés en clair et en sombre (texte courant 4,5:1 au moins).
 */

.cx {
    --cx-lavande: #A6A3EE;
    --cx-cyan: #C8EFF6;
    --cx-violet: #7659F1;
    --cx-cyan-vif: #52DBF5;
    --cx-filet: linear-gradient(90deg, var(--cx-violet) 0%, var(--cx-cyan-vif) 100%);
    --cx-fond-1: light-dark(color-mix(in oklab, var(--cx-lavande) 26%, #FFFFFF), color-mix(in oklab, var(--cx-lavande) 12%, #18181A));
    --cx-fond-2: light-dark(color-mix(in oklab, var(--cx-cyan) 45%, #FFFFFF), color-mix(in oklab, var(--cx-cyan) 8%, #18181A));
    --cx-violet-texte: light-dark(#5B3FD9, #BDB2FF); /* 5,6:1 sur le fond clair, 8,8:1 sur le sombre */

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 40px 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cx-fond-1) 0%, var(--cx-fond-2) 100%);
    color: var(--ink);
}

/* Le liseré du haut : violet → cyan sur ces pages. */
body:has(.cx) .brandline { height: 3px; background: linear-gradient(90deg, #7659F1 0%, #52DBF5 100%); }

.cx-ondes { position: absolute; width: 680px; height: 680px; top: -240px; right: -220px; opacity: .32; pointer-events: none; }
[data-bs-theme="dark"] .cx-ondes { opacity: .26; }

.cx-grille { position: relative; width: 100%; display: grid; gap: 28px; }

/* Marque : logo Eudonet | Impact */
.cx-marque { grid-area: marque; display: flex; align-items: center; gap: 12px; }
.cx-marque img { height: 24px; width: auto; }
.cx-marque .logo-impact { height: 28px; width: 28px; }
[data-bs-theme="dark"] .cx-marque img:not(.logo-impact) { filter: invert(1) brightness(1.1); }
.cx-marque b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; border-left: 1px solid var(--line-2); padding-left: 12px; line-height: 24px; }

/* Le crédo */
.cx-credo { grid-area: credo; }
.cx-devise { margin: 0; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.04; font-weight: 700; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.cx-devise span { display: block; }
.cx-devise::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 18px; border-radius: 2px; background: var(--cx-filet); }
.cx-accroche { margin: 16px 0 0; max-width: 34rem; font-size: 15px; line-height: 1.5; color: var(--ink-2); }


/* La carte d'action : le bouton principal, évident */
.cx-action { grid-area: action; position: relative; overflow: hidden; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-pop); }
.cx-action::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--cx-filet); }
.cx-action .card-body { padding: 32px 28px 28px; }
.cx-etat { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; color: #242424;
    background: linear-gradient(135deg, var(--cx-cyan) 0%, var(--cx-lavande) 100%); }
.cx-etat svg { width: 26px; height: 26px; }
.cx-etat.ok { background: var(--ok-soft); color: var(--ok); }
.cx-etat.bad { background: var(--bad-soft); color: var(--bad); }
.cx-action h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.cx-action .intro { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cx-action ol.pistes { padding-left: 1.2rem; margin: 0 0 18px; color: var(--ink-2); font-size: 13px; }
.cx-action .btn { white-space: normal; text-align: center; } /* un libellé long tient à 360 px */
.cx-action .btn-lg { font-size: 15px; }
.cx-action .btn svg { flex: none; width: 18px; height: 18px; margin-right: 8px; }
.cx-bouton { min-height: 50px; font-weight: 600; }
.cx-credo-pied { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }

/* Connexion : une colonne sur téléphone, deux sur grand écran. */
.cx-pleine .cx-grille { max-width: 1080px; grid-template-areas: "marque" "credo" "action"; }
@media (min-width: 900px) {
    .cx-pleine .cx-grille { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); column-gap: clamp(48px, 7vw, 112px); row-gap: 36px;
        grid-template-areas: "marque marque" "credo action"; align-items: start; }
    .cx-pleine .cx-action { align-self: center; }
    .cx-ondes { width: 820px; height: 820px; top: -300px; right: -260px; }
}

/* Déconnexion, erreur : la même identité, plus légère. */
.cx-legere .cx-grille { max-width: 30rem; grid-template-areas: "marque" "action"; }
.cx-legere .cx-marque { justify-content: center; }

@media (max-width: 480px) {
    .cx { padding: 28px 16px; place-items: start center; }
    .cx-grille { gap: 22px; }
    .cx-action .card-body { padding: 26px 20px 22px; }
    .cx-action .btn:not(.btn-lg) { font-size: 13px; padding-inline: 12px; }
    .cx-ondes { width: 420px; height: 420px; top: -250px; right: -240px; }
}

@media (prefers-reduced-motion: reduce) { .cx *, .cx *::before, .cx *::after { transition: none !important; animation: none !important; } }
