@font-face {
    font-family: "Sora";
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url("../fonts/sora-variable-latin-0lDiYxg.woff2") format("woff2-variations");
}

:root {
    color-scheme: light;
    --navy: #10254d;
    --blue: #0b3e8a;
    --blue-dark: #082f6a;
    --violet: #6d3fe0;
    --surface: #f7f8fb;
    --white: #ffffff;
    --line: #d8dce6;
    --muted: #4c5a74;
    --success: #24623b;
    --success-bg: #e4f3e9;
    --warning: #725718;
    --warning-bg: #f8edc9;
    --danger: #842525;
    --danger-bg: #f8e6e6;
    /* Le dégradé du logo (navy -> blue -> violet), repris comme fil conducteur sur les
       accents (boutons primaires, onglet actif, bordures de cards) plutôt que des aplats. */
    --gradient-brand: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, var(--violet) 100%);
    --font-display: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius-sm: .5rem;
    --radius-md: .75rem;
    --radius-lg: 1.1rem;
    --shadow-sm: 0 1px 2px rgba(16, 37, 77, .06), 0 1px 1px rgba(16, 37, 77, .05);
    --shadow-md: 0 6px 16px rgba(16, 37, 77, .08), 0 2px 6px rgba(16, 37, 77, .05);
    --shadow-lg: 0 20px 44px rgba(16, 37, 77, .16), 0 6px 14px rgba(16, 37, 77, .07);
    --shadow-violet: 0 10px 26px rgba(109, 63, 224, .24);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: var(--navy);
    background: var(--surface);
}

* { box-sizing: border-box; }
html { min-width: 20rem; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--surface); color: var(--navy); line-height: 1.55; }
body, button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--violet); }
h1, h2, h3 { color: var(--navy); font-family: var(--font-display); line-height: 1.2; }
h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(1.15rem, 2vw, 1.35rem); font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }

.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .7rem 1rem; transform: translateY(-150%); border-radius: .35rem; color: var(--white); background: var(--violet); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
#main-content:focus { outline: 3px solid var(--violet); outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

.site-header { position: relative; color: var(--white); background: linear-gradient(112deg, #0a1830 0%, #10254d 52%, #182a5c 100%); }
.site-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--navy), var(--blue) 45%, var(--violet)); }
.site-header__inner { display: flex; width: min(76rem, calc(100% - 2rem)); min-height: 4.5rem; align-items: center; justify-content: space-between; gap: 2rem; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--white); font-family: var(--font-display); font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--white); }
.brand__logo { width: 2.35rem; height: 2.35rem; object-fit: contain; border-radius: var(--radius-sm); background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.role-badge { padding: .3rem .6rem; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #eef1ff; background: linear-gradient(120deg, rgba(255,255,255,.14), rgba(109,63,224,.32)); font-family: var(--font-display); font-size: .68rem; font-weight: 700; letter-spacing: .05em; white-space: nowrap; }
.site-header nav { display: flex; align-items: center; gap: .25rem; }
.site-header nav a { padding: .55rem .8rem; border-radius: 999px; color: rgba(255,255,255,.78); font-family: var(--font-display); font-size: .87rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.site-header nav a:hover { color: var(--white); background: rgba(255, 255, 255, .1); }
.site-header nav a.is-active { color: var(--white); font-weight: 700; background: linear-gradient(120deg, rgba(255,255,255,.16), rgba(109,63,224,.4)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.main-nav--learner { gap: .1rem !important; }
.header-navigation { display: flex; align-items: center; gap: .5rem; }
.mobile-menu-toggle { display: none; padding: .45rem .6rem; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-sm); color: var(--white); background: transparent; font-size: 1.1rem; cursor: pointer; }
.nav-logout-form { margin: 0; }
.nav-logout-button { padding: .55rem .8rem; border: 0; border-radius: 999px; color: rgba(255,255,255,.68); background: transparent; font: inherit; font-family: var(--font-display); font-size: .87rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.nav-logout-button:hover, .nav-logout-button:focus-visible { color: var(--white); background: rgba(255, 255, 255, .1); }
.break-all { overflow-wrap: anywhere; }
.site-footer { display: flex; width: min(72rem, calc(100% - 2rem)); justify-content: space-between; gap: 1rem; margin: 2rem auto 0; padding: 1.5rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; }

/* Les apprenants bénéficient d’une atmosphère plus douce ; l’espace staff reste dense et opérationnel. */
.app-shell--learner { --surface: #fbfaf7; --learner-cream: #fff6e8; --learner-accent: #e87855; }
.app-shell--learner .site-header::after { background: linear-gradient(90deg, var(--navy), var(--learner-accent) 60%, #f4a26e); }
.app-shell--learner .page-container { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.app-shell--staff .card { border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.app-shell--staff .page-container { width: min(78rem, calc(100% - 2rem)); }
.app-shell--staff .page-heading { padding-bottom: .9rem; border-bottom: 1px solid var(--line); }

.app-shell-layout { display: flex; align-items: stretch; min-height: 100vh; }
.app-topbar { display: none; }
.app-sidebar { display: flex; flex: 0 0 15.5rem; flex-direction: column; gap: 1.1rem; width: 15.5rem; padding: 1.25rem 1rem 1.5rem; color: var(--white); background: linear-gradient(180deg, #0a1830 0%, #10254d 55%, #182a5c 100%); }
.app-sidebar__brand { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; padding: 0 .35rem .9rem; border-bottom: 1px solid rgba(255,255,255,.14); }
.app-sidebar__brand .brand { font-size: .95rem; }
.app-sidebar__nav { display: flex; flex: 1 1 auto; flex-direction: column; gap: .35rem; overflow-y: auto; }
.app-sidebar a { padding: .5rem .7rem; border-radius: .6rem; color: rgba(255,255,255,.78); font-family: var(--font-display); font-size: .87rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.app-sidebar a:hover { color: var(--white); background: rgba(255, 255, 255, .1); }
.app-sidebar a.is-active { color: var(--white); font-weight: 700; background: linear-gradient(120deg, rgba(255,255,255,.16), rgba(109,63,224,.4)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.nav-group summary { display: flex; align-items: center; justify-content: space-between; padding: .5rem .7rem; border-radius: .6rem; color: rgba(255,255,255,.9); font-family: var(--font-display); font-size: .87rem; font-weight: 700; letter-spacing: .01em; list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '▸'; color: rgba(255,255,255,.55); font-size: .75rem; transition: transform .15s ease; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover { background: rgba(255, 255, 255, .1); }
.nav-group__items { display: flex; flex-direction: column; gap: .1rem; padding: .2rem 0 .3rem .6rem; }
.nav-group__items a { font-weight: 600; font-size: .84rem; }
.app-sidebar__footer { display: flex; flex-direction: column; gap: .25rem; padding-top: .9rem; border-top: 1px solid rgba(255,255,255,.14); }
.app-sidebar__footer .nav-logout-form { margin: 0; }
.app-sidebar__footer .nav-logout-button { padding: .5rem .7rem; border: 0; border-radius: .6rem; color: rgba(255,255,255,.68); background: transparent; font: inherit; font-family: var(--font-display); font-size: .87rem; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.app-sidebar__footer .nav-logout-button:hover, .app-sidebar__footer .nav-logout-button:focus-visible { color: var(--white); background: rgba(255, 255, 255, .1); }
.app-main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.app-main .site-footer { margin-top: auto; }

.page-container { width: min(72rem, calc(100% - 2rem)); min-height: calc(100vh - 11rem); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) 0; }
.page-container--narrow { width: min(44rem, calc(100% - 2rem)); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .9rem; padding: 0; list-style: none; font-size: .85rem; }
.breadcrumb li { display: flex; align-items: center; gap: .35rem; }
.breadcrumb li:not(:last-child)::after { content: '/'; color: var(--line); }
.breadcrumb a { color: var(--blue); font-weight: 650; text-decoration: none; }
.breadcrumb a:hover { color: var(--violet); text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--muted); font-weight: 650; }

.page-heading, .dashboard-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.page-heading { margin-bottom: 1.5rem; }
.section-heading { margin-bottom: 1rem; }
.section-heading h2 { margin: 0; }
.eyebrow, .welcome__eyebrow { margin: 0 0 .45rem; color: var(--blue); font-family: var(--font-display); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.card { padding: clamp(1.2rem, 3vw, 1.75rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-md); }

.welcome { min-height: 100vh; display: grid; place-content: center; padding: 2rem; text-align: center; }
.welcome__logo { width: min(13rem, 55vw); height: auto; margin: 0 auto 2rem; }
.welcome h1 { max-width: 48rem; }
.welcome__text { max-width: 40rem; margin: 1.25rem auto 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: linear-gradient(145deg, rgba(11, 62, 138, .05), rgba(109, 63, 224, .035)); }
.auth-card { position: relative; overflow: hidden; width: min(29rem, 100%); }
.auth-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gradient-brand); }
.auth-card__logo { display: block; width: 7rem; max-width: 45%; margin: 0 auto 1.5rem; }
.auth-card h1 { margin-bottom: 1.25rem; text-align: center; }
.auth-card__intro { margin: -.25rem 0 1.25rem; color: var(--muted); line-height: 1.6; }
.auth-card__intro--center { margin-top: 0; text-align: center; }
.auth-card__eyebrow { margin: 0 0 .45rem; color: #b85436; font-family: var(--font-display); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.auth-card--security::before { background: linear-gradient(135deg, var(--blue), var(--violet)); }
.auth-shell .flash { margin-bottom: 1rem; }
.auth-card__link { display: block; margin-top: .85rem; text-align: center; }
.confirmation-mark { display: grid; width: 3.25rem; height: 3.25rem; place-items: center; margin: 0 auto 1rem; border-radius: 50%; color: var(--success); background: var(--success-bg); font-size: 1.75rem; font-weight: 800; }

/* Chaque ligne de champ Symfony est un <div> commençant par son <label>, direct enfant du
   <form> ou du conteneur englobant que form_widget(form) génère pour tout rendre d'un coup :
   on cible le <label> plutôt que la profondeur d'imbrication, qui varie selon le template. */
form div:has(> label) { margin-bottom: 1rem; }
label { display: block; margin-bottom: .35rem; color: var(--navy); font-size: .9rem; font-weight: 700; }
input, select, textarea { width: 100%; padding: .7rem .8rem; border: 1px solid #aeb7ca; border-radius: var(--radius-md); background: var(--white); color: var(--navy); font: inherit; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--blue); }

/* Interrupteur (à la place de la case à cocher classique) pour les réglages on/off — pas
   pour les sélections multiples (listes à cocher, réponses de quiz), qui restent des cases
   à cocher standard. */
input.toggle { appearance: none; -webkit-appearance: none; position: relative; width: 2.75rem; height: 1.5rem; flex-shrink: 0; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--line); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
input.toggle::after { content: ''; position: absolute; top: 1px; left: 1px; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm); transition: transform .15s ease; }
input.toggle:checked { border-color: transparent; background: var(--gradient-brand); }
input.toggle:checked::after { transform: translateX(1.25rem); }
input.toggle:disabled { cursor: not-allowed; opacity: .5; }
div:has(> input.toggle) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1.25rem; row-gap: .35rem; }
div:has(> input.toggle) > label { order: 1; margin: 0; }
div:has(> input.toggle) > input.toggle { order: 2; }
div:has(> input.toggle) > .help-text { order: 3; flex-basis: 100%; margin: 0; }
textarea { resize: vertical; }
select[multiple] { min-height: 12rem; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(109, 63, 224, .22); outline-offset: 1px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 5.5rem; }
.password-field__toggle { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); display: inline-grid; width: 2rem; height: 2rem; place-items: center; padding: .35rem; border: 0; border-radius: .3rem; background: transparent; color: var(--blue); cursor: pointer; }
.password-field__toggle svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.password-field__toggle:hover { background: rgba(109, 63, 224, .1); }
.password-field__toggle:focus-visible { outline: 3px solid rgba(109, 63, 224, .3); outline-offset: 1px; }
.password-field + .form-error, .password-field + .form-error-list { margin-bottom: 1rem; }
.password-field { margin-bottom: .7rem; }
.form-text, .help-text { display: block; margin-top: .35rem; color: var(--muted); font-size: .8rem; }
.form-error-message, .invalid-feedback, form ul li { color: var(--danger); }
.button { display: inline-flex; min-height: 2.5rem; align-items: center; justify-content: center; padding: .62rem .95rem; border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; font: inherit; font-family: var(--font-display); font-size: .89rem; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: var(--white); background: var(--gradient-brand); box-shadow: 0 4px 14px rgba(16, 37, 77, .16); }
.button--primary:hover { color: var(--white); background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 55%, var(--violet) 100%); box-shadow: var(--shadow-violet); }
.button--secondary { border-color: #bdc9dc; color: var(--blue); background: var(--white); }
.button--secondary:hover { border-color: var(--blue); color: var(--blue); background: #f1f4fa; }
.button--danger { border-color: #e4b9b9; color: var(--danger); background: var(--danger-bg); }
.button--danger:hover { color: #681818; background: #f2d5d5; }
.button--small { min-height: 2rem; padding: .4rem .65rem; font-size: .82rem; }
.button--full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button.is-loading { cursor: progress; opacity: .6; pointer-events: none; }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.5rem; margin-bottom: 0; }
.form-actions form { margin: 0; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; margin-bottom: 1.25rem; }
.filter-bar label { flex: 0 0 auto; width: auto; min-width: 12rem; }
.filter-bar select { width: auto; min-width: 12rem; }

.flash-container { width: min(72rem, calc(100% - 2rem)); margin: 1rem auto 0; }
.flash { padding: .8rem 1rem; border: 1px solid currentColor; border-radius: .4rem; font-size: .9rem; }
.flash--success { color: var(--success); background: var(--success-bg); }
.flash--error { color: var(--danger); background: var(--danger-bg); }
.flash--warning { color: var(--warning); background: var(--warning-bg); margin-bottom: 1.25rem; }
.settings-preview { max-width: 14rem; max-height: 6rem; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.course-framing { margin-top: 1.5rem; }
.course-framing h2 { margin-top: 0; }
.course-framing ul { padding-left: 1.2rem; }
.definition-list { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .5rem 1.5rem; margin: 0 0 1rem; }
.definition-list dt { font-weight: 600; color: var(--muted); }
.definition-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) { .definition-list { grid-template-columns: 1fr; gap: .15rem; } .definition-list dd { margin-bottom: .6rem; } }
.session-page > .card + .card { margin-top: 1.25rem; }
.signature-pad { display: block; width: 100%; height: 11rem; margin: .5rem 0 .75rem; border: 2px dashed var(--line); border-radius: var(--radius-sm); background: var(--white); touch-action: none; cursor: crosshair; }
.signature-alternative { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.signature-alternative summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.signature-alternative form { margin-top: .9rem; }
.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1rem; }
.checkbox-row input { margin-top: .25rem; }
.attendance-qr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; }
.attendance-qr img { width: 14rem; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.attendance-qr > div { flex: 1 1 18rem; }
.attendance-link { overflow-wrap: anywhere; }
.attendance-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.attendance-callout p { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.assessment-card { margin: 0 0 1.25rem; min-width: 0; }
.assessment-card legend { padding: 0; }
.assessment-card legend h2 { margin: 0 0 .5rem; }
.assessment-row { display: grid; grid-template-columns: 1fr minmax(11rem, 14rem); align-items: center; gap: .5rem 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.assessment-row label { margin: 0; }
@media (max-width: 40rem) { .assessment-row { grid-template-columns: 1fr; } }
.staff-summary strong { white-space: nowrap; }
.stack-table th[scope="row"] { font-weight: 600; }
/* Tableaux empilés sur petit écran : chaque ligne devient une fiche, chaque cellule affiche
   l'intitulé de sa colonne (data-label) ; aucun défilement horizontal (RGAA 10.11). */
@media (max-width: 40rem) {
    .table-wrapper:has(.stack-table) { overflow-x: visible; }
    .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .stack-table, .stack-table tbody, .stack-table tr, .stack-table th, .stack-table td { display: block; width: 100%; }
    .stack-table tr { padding: .9rem 0; border-bottom: 1px solid var(--line); }
    .stack-table th, .stack-table td { padding: .2rem 0; border: 0; }
    .stack-table th[scope="row"] { margin-bottom: .3rem; font-size: 1rem; text-transform: none; letter-spacing: 0; }
    .stack-table td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: .85rem; }
    .stack-table td[data-label] select, .stack-table td[data-label] input { display: block; width: 100%; margin-top: .25rem; }
    .stack-table__actions { padding-top: .6rem !important; }
}
.form-alert { display: grid; gap: .2rem; margin-bottom: 1.25rem; }

.avatar { object-fit: cover; border: 2px solid var(--line); border-radius: 50%; }
.avatar--large { width: 4.5rem; height: 4.5rem; }
.table-wrapper { position: relative; overflow-x: auto; padding: 0; }
.table-wrapper.has-scroll-left::before, .table-wrapper.has-scroll-right::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 1; width: 1.1rem; pointer-events: none; }
.table-wrapper.has-scroll-left::before { left: 0; background: linear-gradient(to right, rgba(16, 37, 77, .12), transparent); }
.table-wrapper.has-scroll-right::after { right: 0; background: linear-gradient(to left, rgba(16, 37, 77, .12), transparent); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: linear-gradient(90deg, rgba(109, 63, 224, .045), rgba(109, 63, 224, 0) 60%); }
th { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.user-picker { max-height: 26rem; overflow-y: auto; }
.user-picker thead th { position: sticky; top: 0; z-index: 1; background: var(--white); }
.user-picker input[type="checkbox"] { accent-color: var(--blue); }
.table-actions { text-align: right; }
.action-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.action-group form, .table-actions form { margin: 0; }
.status { display: inline-block; padding: .22rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 750; }
.status--active, .status--published { color: var(--success); background: var(--success-bg); }
.status--inactive, .status--archived { color: var(--danger); background: var(--danger-bg); }
.status--draft { color: var(--warning); background: var(--warning-bg); }
.status--private { color: var(--violet); background: #f5f2fd; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.card-grid, .course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); gap: 1rem; }
.group-card { display: flex; min-height: 13rem; flex-direction: column; justify-content: space-between; gap: 1.25rem; }
.group-card--archived { opacity: .78; }
.group-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.group-card h3 { margin: 0; color: var(--navy); font-size: 1.1rem; }
.group-card p, .course-card p { color: var(--muted); line-height: 1.6; }
.group-card__meta { margin-bottom: 0; font-size: .85rem; font-weight: 700; }
.member-list, .tag-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.member-list li, .tag-list span { padding: .2rem .5rem; border: 1px solid #ddd3f8; border-radius: 999px; color: #5030a5; background: #f3effd; font-size: .75rem; }
.section-spaced { margin-top: 2.5rem; }
/*
 * Rendu volontairement auto-suffisant (bordure, fond, arrondi tout déclarés ici) plutôt que
 * de compter sur .card : cette classe est aussi posée seule sur un <span>/<div> ou une
 * <td> de tableau (border-collapse fausse sinon la largeur/couleur des bordures).
 */
.empty-state { padding: 1.5rem; border: 1px dashed var(--line); border-radius: .7rem; background: var(--white); color: var(--muted); text-align: center; box-shadow: none; }
.empty-state h2 { margin-top: 0; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }
.pagination__status { color: var(--muted); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.pagination [aria-disabled] { opacity: .48; pointer-events: none; }

/* Bascule d'onglets « Rédiger directement / Importer un fichier » : purement CSS, radios masqués. */
.content-mode-toggle { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.content-mode-tabs { display: flex; gap: .5rem; margin: 1.25rem 0 1rem; border-bottom: 1px solid var(--line); }
.content-mode-tabs label { padding: .55rem .9rem; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; font-size: .9rem; cursor: pointer; }
#content-mode-write:checked ~ .content-mode-tabs label[for="content-mode-write"],
#content-mode-import:checked ~ .content-mode-tabs label[for="content-mode-import"] { color: var(--blue); border-bottom-color: var(--blue); }
.content-mode-panel { display: none; }
#content-mode-write:checked ~ .content-mode-panel--write { display: block; }
#content-mode-import:checked ~ .content-mode-panel--import { display: block; }

.editor-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.editor-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.editor-columns__input textarea { min-height: 24rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88rem; }
.editor-columns__preview { min-height: 24rem; padding: 1rem; border: 1px solid var(--line); border-radius: .4rem; overflow-y: auto; background: var(--white); }
.editor-columns--compact .editor-columns__input textarea, .editor-columns--compact .editor-columns__preview { min-height: 12rem; }

.markdown-guide { width: min(40rem, calc(100% - 2rem)); padding: 0; border: 1px solid var(--line); border-radius: .7rem; box-shadow: 0 1rem 2.5rem rgba(16, 37, 77, .18); }
.markdown-guide::backdrop { background: rgba(16, 37, 77, .45); }
.markdown-guide__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.markdown-guide__heading h2 { margin: 0; font-size: 1.1rem; }
.markdown-guide__body { padding: 1.1rem 1.4rem 1.4rem; max-height: 60vh; overflow-y: auto; }
.markdown-guide__body table { margin-bottom: 1.25rem; }
.markdown-guide__body pre { overflow-x: auto; padding: .9rem; border: 1px solid var(--line); border-radius: .35rem; background: #f2f4f8; }

@media (max-width: 46rem) {
    .editor-columns { grid-template-columns: 1fr; }
}

.ai-chat h2 { margin-top: 0; }
.ai-chat__messages { display: flex; flex-direction: column; gap: .6rem; min-height: 8rem; max-height: 22rem; margin: 1rem 0; padding: .75rem; border: 1px solid var(--line); border-radius: .4rem; overflow-y: auto; background: var(--surface); }
.ai-chat__message { max-width: 85%; margin: 0; padding: .55rem .75rem; border-radius: .5rem; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; }
.ai-chat__message--user { align-self: flex-end; color: var(--white); background: var(--blue); }
.ai-chat__message--assistant { align-self: flex-start; background: var(--white); border: 1px solid var(--line); }
.ai-chat__message--error { align-self: flex-start; color: var(--danger); background: var(--danger-bg); }
.ai-chat__composer { display: flex; gap: .6rem; align-items: flex-end; }
.ai-chat__composer textarea { flex: 1; resize: vertical; }

.dashboard-heading { margin-bottom: 1.75rem; }
.dashboard-heading--learner { align-items: flex-start; }
.dashboard-heading__intro { max-width: 38rem; margin: .75rem 0 0; color: var(--muted); font-size: 1.05rem; }
.dashboard-heading__logo { width: 5rem; height: 5rem; object-fit: contain; }
.learner-welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.35rem; border: 0; background: linear-gradient(120deg, var(--learner-cream), #fff); box-shadow: 0 1rem 2.4rem rgba(181, 110, 68, .12), 0 .25rem .7rem rgba(181, 110, 68, .06); }
.learner-welcome::before { content: ''; position: absolute; top: -3.5rem; right: -2.5rem; width: 12rem; height: 12rem; border-radius: 50%; background: radial-gradient(circle, rgba(232, 120, 85, .14), rgba(232, 120, 85, 0) 70%); pointer-events: none; }
.learner-welcome h2 { position: relative; margin: 0 0 .35rem; font-size: 1.35rem; }
.learner-welcome p:last-child { position: relative; max-width: 42rem; margin: 0; color: var(--muted); }
.learner-welcome__spark { position: relative; display: grid; width: 3.5rem; height: 3.5rem; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--learner-accent), #f4a26e); font-size: 1.7rem; }
.app-shell--learner .course-card { border-color: #eadfd2; }
.app-shell--learner .course-card::before { background: linear-gradient(90deg, var(--learner-accent), #f4a26e); }
.app-shell--learner .course-card:hover { border-color: var(--learner-accent); box-shadow: 0 .9rem 2rem rgba(181, 110, 68, .16); }
.app-shell--learner .course-card__action { color: #b85436; }
.app-shell--learner .eyebrow { color: #b85436; }
.course-grid--learner { grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)); }
.staff-summary { display: flex; flex-wrap: wrap; gap: .75rem; margin: -0.25rem 0 1.25rem; }
.staff-summary > div { display: flex; min-width: 9rem; align-items: baseline; gap: .5rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--white); }
.staff-summary strong { color: var(--blue); font-family: var(--font-display); font-size: 1.25rem; }
.staff-summary span { color: var(--muted); font-size: .78rem; }
.course-grid--staff .course-card { min-height: 11.5rem; }
.course-grid--staff .course-card h2 { font-size: 1.08rem; }
.table-wrapper--staff { border-radius: .45rem; }
.user-cell { display: inline-flex; align-items: center; gap: .65rem; }
.user-cell__avatar { display: inline-grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: var(--white); background: linear-gradient(135deg, var(--navy), var(--violet)); font-family: var(--font-display); font-size: .7rem; font-weight: 800; }
.role-pill { display: inline-block; padding: .25rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 750; }
.role-pill--admin { color: #5030a5; background: #f3effd; }
.role-pill--trainer { color: var(--blue); background: #eaf1fb; }
.role-pill--learner { color: var(--muted); background: #eef0f4; }
.staff-section h2 { margin: 0; }
.staff-section .section-heading { align-items: end; }
.staff-section .muted { color: var(--muted); font-size: .82rem; }
.group-card--staff { min-height: 12rem; }
.group-card--staff:hover { border-color: var(--blue); box-shadow: 0 .45rem 1rem rgba(11, 62, 138, .09); }
.dashboard-link { display: flex; min-height: 9rem; flex-direction: column; justify-content: center; gap: .35rem; color: inherit; text-decoration: none; border-top: 3px solid var(--blue); }
.dashboard-link:hover, .course-card:hover { border-color: var(--violet); color: inherit; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.dashboard-link strong { color: var(--navy); font-family: var(--font-display); font-size: 1.15rem; }
.dashboard-link span { color: var(--muted); font-size: .9rem; }
.course-card { position: relative; display: flex; min-height: 13rem; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.course-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-brand); }
.course-card h2 { margin: .4rem 0; color: var(--navy); font-family: var(--font-display); font-size: 1.2rem; }
.course-card__action { margin-top: auto; padding-top: .8rem; color: var(--blue); font-weight: 750; }
.course-card--admin { justify-content: space-between; gap: 1.25rem; }
.course-card__count { color: var(--muted); font-size: .8rem; }

.truncated-text__toggle { display: inline; margin-left: .3rem; padding: 0; border: 0; background: none; color: var(--blue); font-size: inherit; font-weight: 750; cursor: pointer; }
.truncated-text__toggle:hover { text-decoration: underline; }

.editor-layout { display: grid; gap: 2.25rem; }
.editor-layout > .card, .form-card--narrow { width: min(44rem, 100%); }
.editor-layout h2 { margin-top: 0; }
.sequence-list, .learner-sequence-list, .follow-up-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.sequence-item { display: grid; grid-template-columns: auto auto auto 1fr auto; align-items: center; gap: .85rem; padding: 1rem 1.15rem; }
.sequence-item__position, .learner-sequence-list li > span { display: grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--white); font-family: var(--font-display); font-size: .85rem; font-weight: 800; }
.sequence-item__position { background: linear-gradient(135deg, var(--navy), var(--blue)); }
.learner-sequence-list li > span { background: linear-gradient(135deg, var(--learner-accent), #f4a26e); }
.sequence-item__title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.sequence-item h3, .learner-sequence-list h3 { margin: 0; color: var(--navy); }
.status-group-heading { margin: 0 0 .8rem; color: var(--navy); }
.status-group-heading .muted { font-weight: 400; font-size: .85rem; }
.sequence-item p, .learner-sequence-list p { margin: .35rem 0 0; color: var(--muted); }
.item-selector { display: grid; place-items: center; cursor: pointer; }
.item-selector input, .select-all input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--violet); }
.drag-handle { color: var(--muted); cursor: grab; font-size: 1.15rem; letter-spacing: -.2rem; user-select: none; }
.sortable-item { transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
.sortable-item:hover { border-color: color-mix(in srgb, var(--violet) 42%, var(--line)); }
.sortable-item.is-dragging { opacity: .48; border-color: var(--violet); box-shadow: var(--shadow-md); }
.select-all { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .7rem; color: var(--muted); font-size: .86rem; font-weight: 700; cursor: pointer; }
.bulk-toolbar { position: sticky; z-index: 5; top: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: 0 0 .8rem; padding: .75rem; border: 1px solid var(--line); border-left: 4px solid var(--violet); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-md); }
.bulk-toolbar[hidden], .bulk-toolbar__group[hidden] { display: none; }
.bulk-toolbar strong { margin-right: auto; color: var(--navy); font-size: .88rem; }
.bulk-toolbar select { width: auto; min-width: 12rem; margin: 0; padding: .55rem 2rem .55rem .7rem; }
.bulk-toolbar__group { margin: 0; }
.frame-flashes { margin-bottom: .8rem; }
turbo-frame { display: block; }
.sequence-actions { display: flex; align-items: center; gap: .6rem; }
.sequence-actions form { margin: 0; }
.content-visibility { display: grid; grid-column: 1 / -1; gap: .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.content-visibility form { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0; }
.content-visibility__global { margin-bottom: .25rem !important; padding: .6rem; border-left: 3px solid var(--violet); border-radius: .35rem; background: #f5f2fd; }
.visibility-state { font-size: .85rem; font-weight: 700; }
.visibility-state--visible { color: var(--success); }
.visibility-state--hidden, .visibility-hint { color: var(--muted); }
.visibility-hint { font-size: .82rem; font-style: italic; }

.course-hero { margin: 1.5rem 0 2.5rem; }
.course-hero--learner { position: relative; overflow: hidden; margin-top: 1.1rem; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid #eadfd2; border-radius: var(--radius-lg); background: linear-gradient(128deg, #fff6e8 0%, #fffaf2 55%, #fff 100%); box-shadow: 0 1rem 2.5rem rgba(181, 110, 68, .12), 0 .25rem .7rem rgba(181, 110, 68, .06); }
.course-hero--learner::before { content: ''; position: absolute; top: -4rem; right: -3rem; width: 14rem; height: 14rem; border-radius: 50%; background: radial-gradient(circle, rgba(232, 120, 85, .16), rgba(232, 120, 85, 0) 70%); pointer-events: none; }
.course-hero--learner h1 { position: relative; max-width: 36rem; }
.course-hero__meta { position: relative; display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.25rem; }
.course-hero__meta span, .course-progress-label { padding: .3rem .6rem; border-radius: 999px; color: #925039; background: #fbe6cf; font-size: .78rem; font-weight: 750; }
.course-progress-label { color: var(--muted); background: #f0f2f7; }
.learner-course-page .learner-sequence-list li { border-color: #eadfd2; box-shadow: 0 .25rem 1rem rgba(181, 110, 68, .06); }
.course-hero p:last-child { position: relative; max-width: 45rem; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.back-link { display: inline-block; color: var(--blue); font-size: .9rem; font-weight: 650; text-decoration: none; }
.learner-sequence-list li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .85rem; }
.learner-content-list { display: grid; gap: .4rem; margin: .85rem 0 0; padding: 0; list-style: none; }
.learner-content-list li { display: block; }
.learner-content-list a { display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; border-left: 3px solid var(--blue); border-radius: .35rem; color: var(--navy); background: #f2f5fa; text-decoration: none; }
.learner-content-list a:hover { border-color: var(--violet); background: #f5f2fd; }
.learner-content-list a span { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.learner-content-list a .status { margin-left: auto; }
.content-heading { margin-top: 1.25rem; }

.follow-up-entry { padding: 1.15rem; border-left: 3px solid var(--violet); }
.follow-up-entry--staff { border-left-width: 4px; border-left-color: var(--blue); border-radius: .45rem; }
.follow-up-entry__identity { display: flex; align-items: center; gap: .75rem; }
.follow-up-entry__date { display: grid; width: 2.45rem; height: 2.45rem; place-items: center; border-radius: var(--radius-sm); color: var(--blue); background: #eaf1fb; font-family: var(--font-display); font-size: .95rem; font-weight: 850; }
.follow-up-entry__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.follow-up-entry__heading time { display: block; color: var(--navy); font-size: .95rem; font-weight: 800; }
.follow-up-entry__heading span, .follow-up-entry small { color: var(--muted); font-size: .78rem; }
.follow-up-entry > p { margin: .85rem 0 .4rem; color: var(--navy); line-height: 1.65; }
.danger-zone { border-color: #dfbcbc; border-left: 3px solid var(--danger); }
.danger-zone h2 { margin-top: 0; color: var(--danger); }
.danger-zone p { line-height: 1.65; }
.secondary-card { border-radius: .55rem; }
.secondary-page .page-heading { margin-bottom: 1.25rem; }
.secondary-page .page-heading h1 { letter-spacing: -.035em; }
.legal-page { padding-top: clamp(2rem, 5vw, 3rem); }
.legal-card { border-top: 4px solid var(--blue); }
.legal-card h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.legal-card p { line-height: 1.75; }

.content-meta { display: flex; align-items: center; gap: .7rem; margin: -.25rem 0 1rem; color: var(--muted); }
.markdown-content { line-height: 1.65; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { margin-top: 1.5em; color: var(--blue); }
.markdown-content img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: .35rem; }
.markdown-content table { margin: 1.1rem 0; }
.markdown-content a.content-attachment { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--white); font-weight: 600; text-decoration: none; }
.markdown-content a.content-attachment::before { content: '⬇'; color: var(--blue); }
.markdown-content a.content-attachment:hover { border-color: var(--blue); background: #f7f8fb; }
.markdown-content pre { overflow-x: auto; padding: .9rem; border: 1px solid var(--line); border-radius: .35rem; background: #f2f4f8; }
.markdown-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-content :not(pre) > code { padding: .12rem .28rem; border-radius: .2rem; background: #eceff5; }
.markdown-content blockquote { margin-left: 0; padding: .75rem 1rem; border-left: 3px solid var(--violet); color: var(--muted); background: #f5f2fd; }
.markdown-content details { margin: 1.1rem 0; border: 1px solid var(--line); border-radius: .5rem; background: #f5f2fd; overflow: hidden; }
.markdown-content details summary { list-style: none; cursor: pointer; padding: .75rem 1rem; font-weight: 650; color: var(--violet); }
.markdown-content details summary::-webkit-details-marker { display: none; }
.markdown-content details summary::before { content: '▸'; display: inline-block; width: 1em; margin-right: .4rem; transition: transform .15s ease; }
.markdown-content details[open] summary::before { transform: rotate(90deg); }
.markdown-content details[open] summary { border-bottom: 1px solid var(--line); }
.markdown-content details > :not(summary) { margin: 1rem; }
.markdown-content details > :first-of-type { margin-top: 1rem; }
.markdown-content details > :last-child { margin-bottom: 1rem; }

.muted { color: var(--muted); }

.certificate-verification { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 1.5rem 0 0; }
.certificate-verification dt { color: var(--muted); font-weight: 650; }
.certificate-verification dd { margin: 0; }

.content-consumption { margin-top: 1.25rem; }
.content-consumption form { margin: 0; }
.deliverable-list { display: grid; gap: 0; margin: 0 0 1rem; padding: 0; list-style: none; }
.deliverable-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.deliverable-list a { font-weight: 600; overflow-wrap: anywhere; }
.deliverable-list form { margin: 0 0 0 auto; }
.deliverable-upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin: 0; }
.deliverable-upload > div { flex: 1 1 18rem; }
.deliverable-upload label { display: block; margin-bottom: .35rem; font-weight: 600; }

.content-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.content-nav__spacer { flex: 1; }
.content-nav__link { max-width: 48%; gap: .4rem; }
.content-nav__label { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.content-nav__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quiz-intro > * + * { margin-top: 1rem; }
.quiz-best-score { font-weight: 650; }
.quiz-timer { position: sticky; top: .75rem; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.1rem; margin-bottom: 1.1rem; }
.quiz-timer strong { font-variant-numeric: tabular-nums; font-size: 1.2rem; color: var(--violet); }
.quiz-question-list { list-style: none; margin: 1.25rem 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.quiz-question__text { font-weight: 650; margin: 0 0 .85rem; }
.quiz-answer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.quiz-answer-list label { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: .4rem; cursor: pointer; }
.quiz-answer-list label:hover { background: #f7f8fb; }
.quiz-answer-list input { margin-top: .2rem; }
.quiz-result__score { font-size: 1.3rem; font-weight: 700; }
.quiz-result form { margin-top: 1rem; }
.quiz-question--correct { border-left: 4px solid var(--success); }
.quiz-question--incorrect { border-left: 4px solid var(--danger); }
.quiz-question .quiz-answer-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .65rem; border-radius: .4rem; }
.quiz-answer--correct { background: var(--success-bg); }
.quiz-answer--wrong { background: var(--danger-bg); }
.quiz-answer__selected { font-size: .8rem; color: var(--muted); }

.survey-invite { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.survey-invite h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.survey-invite p { margin: 0; }
.survey-form { display: grid; gap: 1rem; }
.survey-privacy { margin-bottom: 1rem; font-size: .85rem; }
.survey-privacy h2 { margin: 0 0 .4rem; font-size: 1rem; }
.survey-privacy ul { display: grid; gap: .3rem; margin: 0; padding-left: 1.1rem; color: var(--muted); }
.survey-theme h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
.survey-question { margin: 0 0 1rem; padding: 0; border: 0; }
.survey-question:last-child { margin-bottom: 0; }
.survey-question legend { margin-bottom: .5rem; padding: 0; font-weight: 650; }
.survey-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.survey-scale label { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem .35rem; border: 1px solid var(--line); border-radius: .4rem; text-align: center; cursor: pointer; }
.survey-scale label:hover { background: #f7f8fb; }
.survey-scale label:has(input:checked) { border-color: var(--blue); background: rgba(109, 63, 224, .08); }
.survey-scale input { width: auto; margin: 0; }
.survey-scale span { color: var(--muted); font-size: .72rem; line-height: 1.25; }
.survey-results ul { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.survey-results li { display: grid; grid-template-columns: minmax(0, 1fr) 8rem 2.5rem; grid-template-areas: "label meter average" "distribution distribution distribution"; align-items: center; gap: .2rem .75rem; }
.survey-results__label { grid-area: label; }
.survey-results__meter { grid-area: meter; height: .5rem; overflow: hidden; border-radius: 999px; background: var(--line); }
.survey-results__meter span { display: block; height: 100%; background: var(--blue); }
.survey-results__average { grid-area: average; color: var(--blue); text-align: right; }
.survey-results__distribution { display: flex; grid-area: distribution; gap: .75rem; color: var(--muted); font-size: .75rem; }
.survey-comments p { margin: 0 0 .35rem; }

.error-page { min-height: calc(100vh - 8rem); display: grid; place-items: center; text-align: center; }

@media (max-width: 46rem) {
    .survey-invite { align-items: stretch; flex-direction: column; }
    .survey-scale { grid-template-columns: 1fr; }
    .survey-scale label { flex-direction: row; gap: .6rem; text-align: left; }
    .survey-results li { grid-template-columns: minmax(0, 1fr) 2.5rem; grid-template-areas: "label average" "meter meter" "distribution distribution"; }
    .site-header__inner { width: min(100% - 1.25rem, 76rem); min-height: auto; align-items: flex-start; flex-direction: column; gap: .65rem; padding: .8rem 0; }
    .header-navigation { width: 100%; display: block; }
    .mobile-menu-toggle { display: inline-flex; align-items: center; gap: .35rem; }
    .site-header nav { display: none; width: 100%; overflow: hidden; padding: .45rem 0 0; }
    .site-header nav.is-open { display: flex; flex-wrap: wrap; justify-content: flex-start; }
    .site-header nav a, .nav-logout-button { flex: 0 0 auto; padding: .48rem .58rem; font-size: .78rem; }
    .role-badge { position: absolute; top: .95rem; right: .75rem; }
    .page-container { width: min(100% - 1.25rem, 72rem); padding: 1.75rem 0 2.5rem; }
    .page-heading, .dashboard-heading, .section-heading { align-items: flex-start; flex-direction: column; gap: .8rem; }
    .dashboard-heading__logo { position: absolute; top: 6.5rem; right: 1rem; width: 3.5rem; height: 3.5rem; opacity: .72; }
    .dashboard-heading--learner { padding-right: 4.5rem; }
    .button { width: 100%; }
    .page-heading > .button, .section-heading > .button { width: auto; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .table-wrapper { margin-inline: -.1rem; }
    th, td { padding: .7rem .55rem; }
    .table-actions .action-group { align-items: stretch; flex-direction: column; }
    .table-actions .button { width: auto; white-space: nowrap; }
    .user-cell { min-width: 10rem; }
    .staff-summary > div { flex: 1 1 8rem; }
    .learner-welcome { align-items: flex-start; }
    .learner-welcome__spark { width: 2.7rem; height: 2.7rem; }
    .course-hero--learner { padding: 1.25rem; }
    .sequence-item { grid-template-columns: auto 1fr auto; gap: .55rem; }
    .sequence-item .drag-handle, .sequence-item .item-selector { display: none; }
    .content-visibility form { align-items: flex-start; flex-direction: column; }
    .content-visibility form .button { width: auto; }
    .follow-up-entry__heading { align-items: stretch; flex-direction: column; }
    .follow-up-entry__heading .action-group { justify-content: flex-start; }
    .follow-up-entry__heading .button { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.error-card { width: min(36rem, 100%); border-top: 4px solid var(--violet); }
.error-code { margin: 0 0 .5rem; color: var(--violet); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.error-card p { color: var(--muted); }

@media (max-width: 60rem) {
    .site-header__inner { align-items: flex-start; flex-direction: column; gap: .6rem; padding: .8rem 0; }
    .site-header nav { width: 100%; overflow-x: auto; padding-bottom: .25rem; }
    .app-shell-layout { flex-direction: column; }
    .app-topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; color: var(--white); background: linear-gradient(112deg, #0a1830 0%, #10254d 52%, #182a5c 100%); }
    .app-topbar .brand { font-size: .95rem; }
    /* Sur mobile, le menu ne recouvre pas le contenu : c'est un panneau plein écran, en
       ligne, qui repousse le reste de la page (même logique que .site-header nav pour les
       apprenants) — pas de tiroir latéral qui grignote la moitié de l'écran. */
    .app-sidebar { display: none; width: 100%; flex: 0 0 auto; }
    .app-sidebar.is-open { display: flex; }
    .app-sidebar__brand { display: none; }
}

@media (max-width: 42rem) {
    .page-container { width: min(100% - 1.25rem, 72rem); padding: 1.75rem 0; }
    .page-heading, .dashboard-heading, .section-heading, .follow-up-entry__heading { align-items: stretch; flex-direction: column; }
    .dashboard-heading__logo { display: none; }
    .page-heading > .button, .section-heading > .button { width: 100%; }
    .card { padding: 1rem; }
    .sequence-item { grid-template-columns: auto auto auto 1fr; }
    .sequence-actions, .content-visibility { grid-column: 1 / -1; }
    .sequence-actions, .action-group { justify-content: flex-start; }
    .content-visibility form { align-items: stretch; flex-direction: column; }
    .content-visibility form .button { width: 100%; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions > *, .form-actions form .button { width: 100%; }
    .site-footer { flex-direction: column; }
    th, td { padding: .7rem; }
}

@media (max-width: 42rem) {
    .bulk-toolbar { align-items: stretch; }
    .bulk-toolbar strong, .bulk-toolbar select, .bulk-toolbar__group, .bulk-toolbar__group select, .bulk-toolbar .button { width: 100%; }
    .drag-handle { display: none; }
    .sequence-item { grid-template-columns: auto auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.attestation-list { padding-left: 1.2rem; }
.attestation-list li + li { margin-top: .4rem; }
