/* =========================================================================
   Module Account — onboarding & auth (inscription douce, Story 1.1)
   S'appuie sur le design system partagé. Reprend la douceur de l'actuel
   (split avec image, titres serif, confirmation calme) sans le front legacy.
   ========================================================================= */

@import url("design-system-ASgwQJf.css");

.account-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
}

/* ---- Panneau chaleureux (gauche en desktop, bandeau doux en mobile) ---- */
.account-aside {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 240px;
    padding: var(--sp-8) var(--sp-6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--sp-6);
    background: var(--surface-sunken);
}

.account-aside__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.account-aside__scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(43, 39, 51, .76) 0%, rgba(43, 39, 51, .34) 50%, rgba(43, 39, 51, .20) 100%);
}

.account-aside__caption { z-index: 1; }

.account-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    color: #fff;
    z-index: 1;
}

.account-brand img { height: 36px; width: auto; }

.account-aside__poem {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(22px, 3.6vw, 30px);
    line-height: 1.32;
    color: #fff;
    max-width: 20ch;
    margin: 0;
}

.account-aside__sub {
    color: rgba(255, 255, 255, .86);
    font-size: 15px;
    margin: var(--sp-3) 0 0;
    max-width: 34ch;
}

/* ---- Colonne principale (formulaire) ---- */
.account-main {
    display: flex;
    flex-direction: column;
    padding: var(--sp-5) var(--sp-5) var(--sp-12);
}

.account-card {
    width: 100%;
    max-width: 30rem;
    margin: var(--sp-2) auto 0;
}

.account-card__header { margin-bottom: var(--sp-6); }

.account-card__header .ds-display { margin-bottom: var(--sp-3); }

/* Aide de champ (mot de passe) — rendue par le thème de formulaire (.help-text) */
.account-card .help-text {
    margin-top: var(--sp-2);
    font-size: 14px;
    color: var(--ink-secondary);
}

/* ---- Quatre statuts à ÉGALITÉ STRICTE (AC4) ---- */
.ds-fieldset {
    border: none;
    margin: 0 0 var(--sp-5);
    padding: 0;
}

.ds-fieldset > legend {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink-primary);
    margin-bottom: var(--sp-3);
    padding: 0;
}

/* Le widget EnumType expanded rend <div><input radio><label>…  */
.ds-radio-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
}

.ds-radio-cards input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ds-radio-cards label {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 56px;
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-raised);
    border: 1.5px solid var(--border-hairline);
    border-radius: var(--r-md);
    font-size: 16px;
    color: var(--ink-primary);
    cursor: pointer;
}

/* Pastille identique pour les quatre — aucun badge, aucune hiérarchie */
.ds-radio-cards label::before {
    content: "";
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-strong);
    background: var(--surface-base);
}

.ds-radio-cards label:hover { border-color: var(--border-strong); }

.ds-radio-cards input:checked + label {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.ds-radio-cards input:checked + label::before {
    border-color: var(--primary);
    background:
        radial-gradient(circle at center, var(--surface-raised) 0 4px, transparent 5px),
        var(--primary);
}

.ds-radio-cards input:focus-visible + label {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 22%, transparent);
}

/* ---- Consentement intention ---- */
.ds-consent {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: var(--sp-3);
    margin: 0 0 var(--sp-6);
    padding: var(--sp-4);
    background: var(--secondary-soft);
    border-radius: var(--r-md);
}

.ds-consent input[type="checkbox"] {
    appearance: none;
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0;
    border: 2px solid var(--secondary);
    border-radius: 7px;
    background: var(--surface-raised);
    cursor: pointer;
}

.ds-consent input[type="checkbox"]:checked {
    background: var(--secondary);
    box-shadow: inset 0 0 0 4px var(--surface-raised);
}

.ds-consent input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 30%, transparent);
}

.ds-consent label {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-primary);
    cursor: pointer;
}

.ds-consent ul { grid-column: 1 / -1; }

.account-foot {
    margin-top: var(--sp-5);
    text-align: center;
    font-size: 15px;
    color: var(--ink-secondary);
}

/* ---- Écran de confirmation ---- */
.account-confirm { text-align: center; }

.account-confirm__seal {
    width: 76px;
    height: 76px;
    margin: 0 auto var(--sp-5);
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    background: var(--secondary-soft);
    color: var(--secondary);
}

.account-confirm__seal svg { width: 38px; height: 38px; }

.account-confirm .ds-display { margin-bottom: var(--sp-3); }

/* ---- Desktop : split chaleureux ---- */
@media (min-width: 62rem) {
    .account-shell { grid-template-columns: 1.1fr minmax(26rem, 34rem); }

    .account-aside {
        position: sticky;
        top: 0;
        height: 100dvh;
        align-self: start;
        padding: var(--sp-16) var(--sp-12);
        justify-content: space-between;
    }

    .account-main {
        justify-content: center;
        padding: var(--sp-12);
    }

    .account-card { margin-top: 0; }

    .ds-radio-cards { grid-template-columns: 1fr 1fr; }

    .ds-consent { grid-column: 1 / -1; }
}

/* ---- Écrans hors-auth SANS aside (discovery, matching, game, coplay, billing) ----
   Le grid 2-col ci-dessus les poussait dans la colonne gauche à 1440. Même patron
   que le chat : shell en flux block + colonne centrée 40rem (alignée .chat-page). */
.account-shell:has(.account-page),
.account-shell:has(.game-page) { display: block; }

.account-page,
.game-page {
    width: 100%;
    max-width: 40rem;
    margin-inline: auto;
    /* Gouttières latérales (patron chat) : sans elles, cartes et encarts collent
       aux bords en mobile. border-box : le 40rem desktop les absorbe. */
    padding-inline: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

/* Cartes pleine largeur de la colonne (le plafond 30rem centré créerait un décalage). */
.account-page .account-card,
.game-page .account-card { max-width: none; }

/* ---- Cartes à cocher (genre recherché, multi-sélection, Story 1.4) ----
   Mêmes cartes touch-friendly que .ds-radio-cards, mais case carrée arrondie en
   vert sauge pour signaler le choix MULTIPLE (vs la pastille ronde rose du choix
   unique). Liste vide = « peu importe ». */
.ds-check-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
}

.ds-check-cards input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ds-check-cards label {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 56px;
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-raised);
    border: 1.5px solid var(--border-hairline);
    border-radius: var(--r-md);
    font-size: 16px;
    color: var(--ink-primary);
    cursor: pointer;
}

.ds-check-cards label::before {
    content: "";
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 2px solid var(--border-strong);
    background: var(--surface-base);
}

.ds-check-cards label:hover { border-color: var(--border-strong); }

.ds-check-cards input:checked + label {
    border-color: var(--secondary);
    background: var(--secondary-soft);
}

.ds-check-cards input:checked + label::before {
    border-color: var(--secondary);
    background: var(--secondary);
    box-shadow: inset 0 0 0 4px var(--surface-raised);
}

.ds-check-cards input:focus-visible + label {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 22%, transparent);
}

@media (min-width: 62rem) {
    .ds-check-cards { grid-template-columns: 1fr 1fr; }
}

/* ---- Jauge de complétion douce (Story 1.4, Slice B — AC3) ----
   Track en creux, remplissage vert sauge (var(--secondary)), entièrement
   arrondi. JAMAIS de rouge, jamais de pourcentage anxiogène. La couleur n'est
   jamais la SEULE porteuse d'info : le message et le compteur aria « x / y »
   accompagnent toujours la jauge (neuro-inclusif). */
.completion { margin-bottom: var(--sp-6); }

.completion-meter {
    height: 12px;
    background: var(--surface-sunken);
    border-radius: var(--r-full);
    overflow: hidden;
}

.completion-meter__fill {
    display: block;
    height: 100%;
    min-width: 0;
    background: var(--secondary);
    border-radius: var(--r-full);
}

.completion__lead {
    margin: var(--sp-3) 0 var(--sp-4);
    font-size: 16px; /* message principal de la jauge : corps >= 16px (neuro-inclusif) */
    line-height: 1.55;
    color: var(--ink-secondary);
}

.completion__visibility { margin-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
    .completion-meter__fill { transition: width var(--motion) ease; }
}

/* ── Galerie de photos (Story 1.6) ───────────────────────────────────────
   Grille mobile-first, vignettes à coins arrondis, photo principale plus
   grande. Statut de modération : pastille texte + couleur (la couleur n'est
   jamais seule porteuse d'info), un refus reste sobre (danger « sourd »,
   jamais un rouge d'alarme). */
.photo-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--sp-4);
}

.photo-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.photo-tile__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border-hairline);
}

.photo-tile--main {
    grid-column: span 2;
}

/* Sous ~400px, une seule colonne de 140px tient dans la carte : ne pas forcer le span
   (sinon 2e colonne implicite + débordement horizontal ; revue Codex). */
@media (max-width: 400px) {
    .photo-tile--main {
        grid-column: auto;
    }
}

.photo-tile__badge {
    position: absolute;
    top: var(--sp-2);
    left: var(--sp-2);
    padding: 2px var(--sp-2);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-primary);
    background: var(--surface-raised);
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-full);
}

.photo-status {
    align-self: flex-start;
    padding: 2px var(--sp-3);
    font-size: 14px;
    border-radius: var(--r-full);
}

.photo-status--en_attente { color: var(--info); background: var(--info-soft); }
.photo-status--valide { color: var(--success); background: var(--success-soft); }
/* Un refus n'est JAMAIS rouge/alarmant (ton neuro-inclusif non négociable, AC4) :
   ambre « caution », jamais le token `danger`. */
.photo-status--refuse { color: var(--caution); background: var(--caution-soft); }

/* Badge « photo claire de soi » : sobre, vert sauge, posé en bas pour ne pas chevaucher
   le badge « principale ». */
.photo-tile__badge--clear {
    top: auto;
    bottom: var(--sp-2);
    color: var(--secondary);
    background: var(--secondary-soft);
    border-color: transparent;
}

/* Actions par photo : cibles tactiles >= 48px, espacees, ton calme. La suppression
   reste sobre (jamais un rouge d'alarme). */
.photo-tile__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.photo-tile__actions form {
    margin: 0;
}

.photo-action {
    min-height: var(--sp-12);
    padding: var(--sp-2) var(--sp-3);
    font-size: 14px;
    color: var(--ink-primary);
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    cursor: pointer;
}

.photo-action:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Anneau de focus visible au clavier : la règle globale `:focus-visible` neutralise
   l'outline par défaut (design-system.css) — sans ce rappel, les boutons d'action de
   photo n'auraient AUCUN indicateur de focus (WCAG 2.4.7 ; revue Codex). */
.photo-action:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 35%, transparent);
}

.photo-action--quiet {
    color: var(--ink-secondary);
}

/* =========================================================================
   Écrans de RÉGLAGES (colonne unique centrée, sans panneau marketing).
   Utilisés par account/settings_layout.html.twig — page à part des écrans
   d'auth/onboarding. Réglages notifications = liste compacte à interrupteurs.
   ========================================================================= */
.settings-shell {
    min-height: 100dvh;
    padding: var(--sp-6) var(--sp-5) var(--sp-16);
    display: flex;
    justify-content: center;
}

.settings-page {
    width: 100%;
    max-width: 34rem;
}

.settings-page__head {
    margin: var(--sp-5) 0 var(--sp-6);
}

.settings-page__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 4.4vw, 30px);
    line-height: 1.18;
    letter-spacing: -.01em;
    margin: 0 0 var(--sp-2);
}

.settings-page__intro {
    color: var(--ink-secondary);
    font-size: 15.5px;
    line-height: 1.55;
    margin: 0;
    max-width: 42ch;
}

.settings-flash {
    margin: 0 0 var(--sp-5);
    padding: var(--sp-3) var(--sp-4);
    background: var(--secondary-soft);
    color: color-mix(in srgb, var(--secondary) 88%, var(--ink-primary));
    border-radius: var(--r-md);
    font-size: 14.5px;
}

/* ---- Liste des réglages : carte à filets, colonnes canal alignées ---- */
.pref-list {
    --pref-cell: 4.75rem;
    background: var(--surface-raised);
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.pref-list__cols,
.pref-row {
    display: grid;
    grid-template-columns: 1fr var(--pref-cell) var(--pref-cell);
    align-items: center;
}

.pref-list__cols {
    padding: var(--sp-3) var(--sp-4) var(--sp-2);
    border-bottom: 1px solid var(--border-hairline);
}

.pref-list__col {
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-secondary);
}

.pref-row {
    padding: var(--sp-4);
    gap: var(--sp-3);
}

.pref-row + .pref-row {
    border-top: 1px solid var(--border-hairline);
}

.pref-row__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pref-row__name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-primary);
    line-height: 1.3;
}

.pref-row__desc {
    font-size: 13px;
    color: var(--ink-secondary);
    line-height: 1.4;
}

.pref-row__cell {
    display: flex;
    justify-content: center;
}

.pref-row__na {
    color: var(--ink-disabled);
    font-size: 15px;
    user-select: none;
}

/* ---- Interrupteur (sauge = activé, calme ; jamais rouge). Case réelle cachée,
   piste + bouton stylés ; cible ≥44px via le padding du label. ---- */
.pref-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 6px;
    cursor: pointer;
}

.pref-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.pref-switch__track {
    position: relative;
    display: block;
    width: 44px;
    height: 26px;
    border-radius: var(--r-full);
    background: var(--border-strong);
    border: 1px solid color-mix(in srgb, var(--border-strong) 70%, var(--ink-secondary));
}

.pref-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: var(--r-full);
    background: var(--surface-raised);
    box-shadow: 0 1px 2px rgba(43, 39, 51, .28);
}

.pref-switch input:checked + .pref-switch__track {
    background: var(--secondary);
    border-color: var(--secondary);
}

.pref-switch input:checked + .pref-switch__track::after {
    left: 20px;
}

.pref-switch input:focus-visible + .pref-switch__track {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 40%, transparent);
}

.settings-note {
    margin: var(--sp-5) 0 0;
    padding-left: var(--sp-1);
    font-size: 13.5px;
    color: var(--ink-secondary);
    line-height: 1.55;
}

.settings-actions {
    margin-top: var(--sp-6);
}

.settings-actions .ds-btn {
    width: 100%;
}

/* Cartes du compte posées en colonne réglages : pleine largeur de la colonne,
   alignées sur le retour et les titres (sinon 30rem centrées → décalage). */
.settings-page .account-card { max-width: none; }

/* ---- Centre de notifications (spec §5) : liste au calme ---- */
.notifications-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.notification {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-8);
}

.notification + .notification { border-top: 1px solid var(--border-hairline); }

.notification:hover { background: color-mix(in srgb, var(--surface-sunken) 45%, var(--surface-raised)); }

@media (prefers-reduced-motion: no-preference) {
    .notification { transition: background var(--motion) ease; }
}

/* Point non-lu : sauge, jamais rouge ; l'espace à gauche est réservé pour toutes
   les rangées (alignement constant, lu ou non). */
.notification--unread::before {
    content: "";
    position: absolute;
    left: var(--sp-3);
    top: calc(var(--sp-4) + 7px);
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--secondary);
}

.notification__link {
    color: var(--ink-primary);
    text-decoration: none;
    font-size: 15.5px;
    line-height: 1.45;
}

.notification--unread .notification__link { font-weight: 700; }

/* Toute la rangée est la cible (≥44px), pas le seul texte du lien. */
.notification__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.notification__link:focus-visible { outline: none; }

.notification__link:focus-visible::after {
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--focus-ring) 35%, transparent);
}

.notification__time {
    font-size: 13px;
    color: var(--ink-secondary);
}

.notifications-empty {
    margin: 0;
    padding: var(--sp-6) var(--sp-4);
    background: var(--surface-raised);
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-lg);
    color: var(--ink-secondary);
    text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
    .pref-switch__track,
    .pref-switch__track::after {
        transition: background var(--motion) ease, border-color var(--motion) ease, left var(--motion) ease;
    }
}

@media (min-width: 40rem) {
    .settings-shell { padding-top: var(--sp-10); }
    .settings-actions .ds-btn { width: auto; min-width: 14rem; }
}

/* =========================================================================
   Barre haute du compte : accès notifications (module in-app, spec §4).
   Statique, jamais sticky/overlay : position apprise identique partout,
   zéro chevauchement de contenu (prévisibilité neuro-inclusive).
   ========================================================================= */
.account-topbar {
    display: flex;
    justify-content: flex-end;
    padding: var(--sp-3) var(--sp-4) 0;
}

.account-topbar__notif {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: 21px;
    line-height: 1;
    text-decoration: none;
    background: var(--surface-raised);
    border: 1px solid var(--border-hairline);
    border-radius: var(--r-full);
    box-shadow: var(--shadow-1);
}

.account-topbar__notif:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-2);
}

.account-topbar__notif:focus-visible {
    outline: none;
    box-shadow: var(--shadow-1), 0 0 0 3px color-mix(in srgb, var(--focus-ring) 35%, transparent);
}

/* Compteur non-lus : bordeaux action (jamais un rouge d'alarme), halo clair
   pour le détacher de la cloche. */
.account-topbar__count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: var(--on-primary);
    background: var(--btn);
    border: 2px solid var(--surface-raised);
    border-radius: var(--r-full);
}

@media (prefers-reduced-motion: no-preference) {
    .account-topbar__notif { transition: border-color var(--motion) ease, box-shadow var(--motion) ease; }
}

@media (min-width: 62rem) {
    .account-topbar { padding: var(--sp-4) var(--sp-6) 0; }
}
