/* =============================================================================
   ALM Formation Campus — feuille de style à la charte d'almformation31.fr
   Brun profond #34150F · caramel #D39858 · beiges #EEE0CF / #EACEAA
   Titres : Playfair Display · Texte : Albert Sans
   Contrastes vérifiés (WCAG AA) : le caramel n'est jamais utilisé pour du
   texte courant sur fond clair (on emploie alors --alm-caramel-fonce).
   ============================================================================= */

:root {
  --alm-brun: #34150F;
  --alm-brun-2: #4A2219;
  --alm-brun-rouge: #773D29;
  --alm-caramel: #D39858;
  --alm-caramel-fonce: #8E5A22;   /* texte sur fond clair : contraste 5,6:1 */
  --alm-beige: #EEE0CF;
  --alm-sable: #EACEAA;
  --alm-ivoire: #FAF5EE;
  --alm-texte: #2B211E;
  --alm-gris: #6B5E59;
  --alm-bord: #E6D9CB;
  --alm-succes: #2F6B3F;
  --alm-alerte: #A33A1F;

  --bs-body-font-family: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--alm-texte);
  --bs-body-bg: var(--alm-ivoire);
  --bs-link-color: var(--alm-brun-rouge);
  --bs-link-color-rgb: 119, 61, 41;
  --bs-link-hover-color: var(--alm-brun);
  --bs-border-color: var(--alm-bord);
  --bs-primary: var(--alm-brun);
  --bs-primary-rgb: 52, 21, 15;
  --bs-focus-ring-color: rgba(211, 152, 88, .45);
}

body { font-size: 1rem; line-height: 1.6; }
h1, h2, h3, .h1, .h2, .h3, .font-titre {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--alm-brun);
  letter-spacing: -.01em;
}
h4, h5, h6, .h4, .h5, .h6 { font-weight: 600; color: var(--alm-brun); }
.text-caramel { color: var(--alm-caramel-fonce) !important; }
.text-muted { color: var(--alm-gris) !important; }
.bg-brun { background: var(--alm-brun) !important; color: #fff; }
.bg-ivoire { background: var(--alm-ivoire) !important; }
.bg-beige { background: var(--alm-beige) !important; }
.bg-caramel { background-color: var(--alm-caramel) !important; color: var(--alm-brun) !important; }
.text-bg-caramel { background-color: var(--alm-sable) !important; color: var(--alm-brun) !important; }
.border-caramel { border-color: var(--alm-caramel) !important; }

a { text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--alm-caramel); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: #fff; color: var(--alm-brun); padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- Boutons ------------------------------------------------------------------ */
.btn { border-radius: 999px; font-weight: 500; padding: .5rem 1.15rem; }
.btn-sm { padding: .3rem .8rem; }
.btn-primary {
  --bs-btn-bg: var(--alm-brun); --bs-btn-border-color: var(--alm-brun);
  --bs-btn-hover-bg: var(--alm-brun-rouge); --bs-btn-hover-border-color: var(--alm-brun-rouge);
  --bs-btn-active-bg: var(--alm-brun-2); --bs-btn-active-border-color: var(--alm-brun-2);
  --bs-btn-disabled-bg: #8b7a74; --bs-btn-disabled-border-color: #8b7a74;
}
.btn-caramel {
  --bs-btn-color: var(--alm-brun); --bs-btn-bg: var(--alm-caramel); --bs-btn-border-color: var(--alm-caramel);
  --bs-btn-hover-color: var(--alm-brun); --bs-btn-hover-bg: #E0AE76; --bs-btn-hover-border-color: #E0AE76;
  --bs-btn-active-bg: #C38646; --bs-btn-active-color: var(--alm-brun);
  font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: var(--alm-brun); --bs-btn-border-color: var(--alm-brun);
  --bs-btn-hover-bg: var(--alm-brun); --bs-btn-hover-border-color: var(--alm-brun); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--alm-brun);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--alm-bord); --bs-btn-hover-bg: var(--alm-beige); }

.form-control, .form-select { border-color: #D8C7B5; border-radius: .6rem; }
.form-control:focus, .form-select:focus { border-color: var(--alm-caramel); box-shadow: 0 0 0 .2rem rgba(211,152,88,.25); }
.form-check-input:checked { background-color: var(--alm-brun); border-color: var(--alm-brun); }
.form-label { font-weight: 500; }
.form-text { color: var(--alm-gris); }

.card { border-color: var(--alm-bord); border-radius: 1rem; box-shadow: 0 1px 2px rgba(52,21,15,.04); }
.card-header { background: transparent; border-bottom-color: var(--alm-bord); font-weight: 600; }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--alm-gris); font-weight: 600; border-bottom-width: 1px; }
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; }
.badge.text-bg-secondary { background: #E9E2DC !important; color: #4B3F3A !important; }
.badge.text-bg-warning { background: #F6DFB7 !important; color: #6A3D06 !important; }
.badge.text-bg-info { background: #DCE9EF !important; color: #20485A !important; }
.badge.text-bg-success { background: #D8EBDD !important; color: #1F4D2B !important; }
.badge.text-bg-danger { background: #F4D6CE !important; color: #7A2412 !important; }
.badge.text-bg-dark { background: #4B3F3A !important; color: #fff !important; }
.badge-demo { background: #FFF1D6; color: #7A4A00; border: 1px dashed #C8902E; }
.alert { border-radius: .8rem; }
.progress { height: .55rem; border-radius: 999px; background: #EFE4D8; }
.progress-bar { background: var(--alm-caramel); }
.progress-bar.bg-success { background: var(--alm-succes) !important; }

/* --- Authentification ------------------------------------------------------------ */
.auth-body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 80% -10%, #5a2a1e 0%, transparent 60%), var(--alm-brun);
  display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { border: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-logo { width: 240px; max-width: 70%; display: block; margin: 0 auto 1.5rem; }
.auth-tagline { color: var(--alm-sable); text-align: center; font-family: "Playfair Display", serif; margin-bottom: 1.5rem; }

/* --- Gestion : barre latérale ----------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 260px; flex: 0 0 260px; background: var(--alm-brun); color: #F3E7DA;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.admin-sidebar .brand { padding: 1.25rem 1.25rem .5rem; }
.admin-sidebar .brand img { width: 180px; }
.admin-sidebar .brand small { display: block; color: var(--alm-caramel); letter-spacing: .14em; text-transform: uppercase; font-size: .68rem; margin-top: .25rem; }
.admin-nav { list-style: none; padding: .75rem .75rem 1rem; margin: 0; }
.admin-nav .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #B99A86; padding: 1rem .75rem .35rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: .6rem;
  color: #F3E7DA; text-decoration: none; font-size: .95rem;
}
.admin-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-nav a.active { background: var(--alm-caramel); color: var(--alm-brun); font-weight: 600; }
.admin-nav .count { margin-left: auto; background: var(--alm-caramel); color: var(--alm-brun); border-radius: 999px; font-size: .72rem; padding: .05rem .5rem; font-weight: 700; }
.admin-nav a.active .count { background: var(--alm-brun); color: #fff; }
.admin-nav svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.admin-sidebar .sidebar-foot { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.admin-sidebar .sidebar-foot a, .admin-sidebar .sidebar-foot button { color: var(--alm-sable); }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--alm-bord); padding: .75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1010;
}
.admin-content { padding: 1.75rem 1.5rem 3rem; max-width: 1400px; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: 1.9rem; }
.page-head .lead-sm { color: var(--alm-gris); margin: .25rem 0 0; }

@media (max-width: 991.98px) {
  .admin-sidebar { position: fixed; left: -280px; z-index: 1050; transition: left .2s ease; height: 100vh; }
  .admin-sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .admin-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1040; }
  .admin-backdrop.show { display: block; }
  .admin-content { padding: 1.25rem 1rem 3rem; }
}
@media (min-width: 992px) { .menu-toggle { display: none; } }

/* --- Indicateurs --------------------------------------------------------------- */
.stat-card { padding: 1.1rem 1.25rem; border-radius: 1rem; background: #fff; border: 1px solid var(--alm-bord); height: 100%; text-decoration: none; display: block; color: inherit; }
a.stat-card:hover { border-color: var(--alm-caramel); }
.stat-card .stat-label { font-size: .8rem; color: var(--alm-gris); text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-family: "Playfair Display", serif; font-size: 2.1rem; color: var(--alm-brun); line-height: 1.15; }
.stat-card .stat-hint { font-size: .82rem; color: var(--alm-gris); }
.stat-card.is-alert { border-left: 4px solid var(--alm-caramel); }

.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid #F1E8DE; font-size: .92rem; }
.activity li:last-child { border-bottom: 0; }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--alm-caramel); margin-top: .55rem; flex: 0 0 8px; }
.activity time { color: var(--alm-gris); font-size: .8rem; white-space: nowrap; }

/* --- Espace stagiaire ----------------------------------------------------------- */
.learner-header { background: var(--alm-brun); color: #fff; }
.learner-header .navbar-brand img { height: 46px; }
.learner-header .nav-link { color: #F3E7DA; border-radius: 999px; padding: .4rem .9rem !important; }
.learner-header .nav-link:hover, .learner-header .nav-link.active { color: var(--alm-brun); background: var(--alm-sable); }
.learner-header .navbar-toggler { border-color: rgba(255,255,255,.4); }
.learner-header .navbar-toggler-icon { filter: invert(1); }
.preview-banner { background: #FFF1D6; color: #5E3A00; border-bottom: 1px solid #E8C98E; font-size: .9rem; }
.learner-hero { background: linear-gradient(180deg, var(--alm-beige), var(--alm-ivoire)); padding: 2.25rem 0 1.5rem; }
.course-card { border-radius: 1.1rem; overflow: hidden; background: #fff; border: 1px solid var(--alm-bord); display: flex; flex-direction: column; height: 100%; }
.course-card .course-band { background: var(--alm-brun); color: var(--alm-sable); padding: 1rem 1.25rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.course-card .course-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.course-card h2 { font-size: 1.35rem; }

.module-block { border: 1px solid var(--alm-bord); border-radius: 1rem; background: #fff; margin-bottom: 1rem; overflow: hidden; }
.module-block .module-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: #FDF9F4; border-bottom: 1px solid var(--alm-bord); }
.module-block .module-num { width: 38px; height: 38px; border-radius: 50%; background: var(--alm-brun); color: var(--alm-sable); display: grid; place-items: center; font-family: "Playfair Display", serif; flex: 0 0 38px; }
.module-block.locked .module-num { background: #B8A79D; }
.lesson-row { display: flex; align-items: center; gap: .85rem; padding: .7rem 1.25rem; border-bottom: 1px solid #F3EBE2; text-decoration: none; color: inherit; }
.lesson-row:last-child { border-bottom: 0; }
a.lesson-row:hover { background: #FBF6F0; }
.lesson-status { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #D6C4B2; display: grid; place-items: center; flex: 0 0 26px; font-size: .8rem; }
.lesson-status.done { background: var(--alm-succes); border-color: var(--alm-succes); color: #fff; }
.lesson-status.exempt { border-style: dashed; color: var(--alm-gris); }
.lesson-status.current { border-color: var(--alm-caramel); background: #FFF4E6; }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; }
@media (max-width: 1199.98px) { .lesson-layout { grid-template-columns: 1fr; } }
.lesson-body { font-size: 1.05rem; }
.lesson-body h1 { font-size: 1.7rem; margin-top: 1.5rem; }
.lesson-body h2 { font-size: 1.4rem; margin-top: 1.4rem; }
.lesson-body h3 { font-size: 1.15rem; margin-top: 1.2rem; font-family: "Albert Sans", sans-serif; font-weight: 700; }
.lesson-body ul, .lesson-body ol { padding-left: 1.4rem; }
.side-panel { position: sticky; top: 1rem; }
.notes-area { min-height: 220px; resize: vertical; font-size: .95rem; background: #FFFDF9; }
.save-status { font-size: .82rem; color: var(--alm-gris); }
.save-status.is-dirty { color: #7A4A00; }
.save-status.is-error { color: var(--alm-alerte); font-weight: 600; }
.save-status.is-ok { color: var(--alm-succes); }
.exchange { border-left: 3px solid var(--alm-sable); padding: .5rem 0 .5rem .85rem; margin-bottom: .85rem; }
.exchange .answer { background: #F7F0E7; border-radius: .6rem; padding: .6rem .8rem; margin-top: .5rem; }

/* --- Lecteurs vidéo ------------------------------------------------------------ */
.player-shell { background: var(--alm-brun); border-radius: 1rem; overflow: hidden; position: relative;
  box-shadow: 0 18px 40px -18px rgba(52,21,15,.55), 0 0 0 1px rgba(211,152,88,.25); }
.player-shell:focus { outline: none; }
.player-shell:focus-visible { box-shadow: 0 0 0 3px var(--alm-caramel); }

/* Vignette avant lecture : brun ALM, halo caramel, grand bouton play */
.player-poster {
  position: absolute; inset: 0; z-index: 4; border: 0; padding: 1.5rem; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center;
  color: #F3E7DA; cursor: pointer;
  background:
    radial-gradient(60% 70% at 50% 45%, rgba(211,152,88,.28) 0%, rgba(211,152,88,0) 70%),
    radial-gradient(120% 90% at 100% 0%, #5A2A1E 0%, rgba(90,42,30,0) 55%),
    linear-gradient(160deg, #3E1912 0%, var(--alm-brun) 55%, #240D09 100%);
}
.player-poster::after { /* fin liseré intérieur */
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(211,152,88,.35); border-radius: .7rem; pointer-events: none;
}
.poster-kicker { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--alm-caramel); }
.poster-title { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.15rem, 2.6vw, 1.9rem); line-height: 1.2; max-width: 34ch; color: #fff; }
.poster-play { width: clamp(64px, 11vw, 96px); height: clamp(64px, 11vw, 96px); margin: .4rem 0; transition: transform .25s ease; }
.poster-play svg { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 50%; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.poster-play .ring { fill: var(--alm-caramel); stroke: rgba(255,255,255,.55); stroke-width: 1.5; }
.poster-play .tri { fill: var(--alm-brun); }
.poster-meta { font-size: .9rem; color: #E8D3BE; }
.player-poster:hover .poster-play, .player-poster:focus-visible .poster-play { transform: scale(1.08); }
.player-poster:hover .poster-play .ring { fill: #E0AE76; }
.player-poster:focus-visible { outline: 3px solid var(--alm-caramel); outline-offset: -6px; }
@keyframes poster-pulse { 0% { box-shadow: 0 0 0 0 rgba(211,152,88,.55); } 100% { box-shadow: 0 0 0 22px rgba(211,152,88,0); } }
.poster-play { border-radius: 50%; animation: poster-pulse 2.4s ease-out infinite; }
.player-poster.is-loading { cursor: progress; }
.player-poster.is-loading .poster-play { animation: none; }
.player-poster.is-loading .poster-play svg { animation: poster-spin 1.1s linear infinite; }
.player-poster.is-loading .poster-play .tri { opacity: .35; }
.player-poster.is-loading .poster-play .ring { stroke: #fff; stroke-width: 3; stroke-dasharray: 60 140; }
@keyframes poster-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .poster-play, .player-poster.is-loading .poster-play svg { animation: none; } }

/* Commandes du lecteur fichier (MP4/WebM) */
.player-shell.has-custom-controls video { cursor: pointer; background: #000; }
.video-controls {
  display: flex; align-items: center; gap: .55rem; padding: .55rem .8rem;
  background: linear-gradient(180deg, #3A170F, var(--alm-brun)); color: #F3E7DA; border-top: 1px solid rgba(211,152,88,.3);
}
.vc-btn { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: #F3E7DA; display: grid; place-items: center; padding: 0; }
.vc-btn svg { width: 22px; height: 22px; }
.vc-btn:hover { background: rgba(211,152,88,.18); color: #fff; }
.vc-btn:focus-visible { outline: 2px solid var(--alm-caramel); outline-offset: 1px; }
.vc-play { background: var(--alm-caramel); color: var(--alm-brun); }
.vc-play:hover { background: #E0AE76; color: var(--alm-brun); }
.vc-track { position: relative; flex: 1 1 auto; height: 8px; border-radius: 999px; cursor: pointer; touch-action: none;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 6px, rgba(255,255,255,.16) 6px 12px); }
.vc-track:focus-visible { outline: 2px solid var(--alm-caramel); outline-offset: 4px; }
.vc-reach { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: rgba(234,206,170,.35); }
.vc-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--alm-caramel); }
.vc-thumb { position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px; transform: translateY(-50%); border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--alm-caramel); transition: transform .15s; }
.vc-track:hover .vc-thumb { transform: translateY(-50%) scale(1.15); }
.vc-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: .85rem; min-width: 7.5em; text-align: center; color: #F3E7DA; }
.vc-volume { width: 80px; accent-color: var(--alm-caramel); }
.vc-speed { background: transparent; color: #F3E7DA; border: 1px solid rgba(211,152,88,.5); border-radius: 999px; font-size: .8rem; padding: .1rem .4rem; }
.vc-speed option { color: var(--alm-texte); }
.player-shell:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.player-shell:fullscreen .player-frame { flex: 1; aspect-ratio: auto; }
@media (max-width: 575.98px) {
  .vc-volume, .vc-back { display: none; }
  .vc-time { min-width: 0; font-size: .78rem; }
}
.player-frame { position: relative; aspect-ratio: 16 / 9; width: 100%; }
.player-frame > video, .player-frame > iframe, .player-frame > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Sous-titres : par-dessus la vidéo, sans gêner les clics sur le lecteur */
.player-frame > .player-captions { inset: auto 4% 9% 4%; width: auto; height: auto; z-index: 3; display: none;
  flex-direction: column; align-items: center; gap: .15rem; pointer-events: none; text-align: center; }
.player-frame > .player-captions.show { display: flex; }
.player-captions span { display: inline-block; max-width: 100%; padding: .12em .5em; border-radius: .3rem; background: rgba(28,10,7,.78);
  color: #fff; font-size: clamp(.85rem, 2.3vw, 1.35rem); line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.player-shell:fullscreen .player-captions span { font-size: clamp(1.1rem, 2.6vw, 2.1rem); }
.vc-cc { opacity: .55; }
.vc-cc.is-on { opacity: 1; color: var(--alm-caramel); }
.cc-toggle { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--alm-bord); background: #fff; color: var(--alm-texte);
  border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; }
.cc-toggle svg { width: 18px; height: 18px; }
.cc-toggle.is-on { background: var(--alm-brun); border-color: var(--alm-brun); color: #F3E7DA; }
.cc-toggle.is-on svg { color: var(--alm-caramel); }
.cc-toggle:focus-visible { outline: 3px solid var(--alm-caramel); outline-offset: 2px; }
.player-message { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: #F3E7DA; background: rgba(18,8,6,.92); z-index: 5; }
.player-message.show { display: flex; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .7rem 1rem; background: #FDF9F4; border: 1px solid var(--alm-bord); border-top: 0; border-radius: 0 0 1rem 1rem; font-size: .88rem; }
.player-bar .progress { flex: 1 1 160px; }
.player-shell + .player-bar { margin-top: -1rem; padding-top: 1.7rem; }

/* --- Images de leçon : image seule ou diaporama --------------------------------- */
.lesson-image img { display: block; max-width: 100%; max-height: 640px; margin: 0 auto; border-radius: 1rem; }
.lesson-image figcaption { text-align: center; }
.lesson-slider { background: #fff; border: 1px solid var(--alm-bord); border-radius: 1rem; padding: .75rem; }
.lesson-slider:focus-visible { outline: 3px solid var(--alm-caramel); }
.slider-stage { position: relative; background: #FBF7F2; border-radius: .75rem; overflow: hidden; min-height: 200px; display: flex; align-items: center; justify-content: center; }
.slider-slide { margin: 0; width: 100%; text-align: center; }
.slider-slide img { display: block; max-width: 100%; max-height: 560px; margin: 0 auto; }
.slider-slide figcaption { padding: .5rem 1rem; color: var(--alm-gris); }
.slider-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(52,21,15,.75); color: #fff; font-size: 1.8rem; line-height: 1; display: grid; place-items: center; }
.slider-nav:hover { background: var(--alm-brun); }
.slider-prev { left: .75rem; } .slider-next { right: .75rem; }
.slider-dots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; padding-top: .75rem; }
.slider-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--alm-caramel); background: transparent; padding: 0; }
.slider-dot.is-active { background: var(--alm-caramel); }
.image-row { display: flex; gap: .75rem; align-items: center; border: 1px solid var(--alm-bord); border-radius: .75rem; padding: .5rem; margin-bottom: .5rem; background: #fff; }
.image-row img { width: 96px; height: 64px; object-fit: cover; border-radius: .4rem; flex: 0 0 96px; }

/* --- Résultat d'évaluation -------------------------------------------------------- */
.score-hero {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.25rem; padding: 2rem 2.25rem;
  border-radius: 1.25rem; color: #F3E7DA; overflow: hidden;
  background:
    radial-gradient(70% 120% at 0% 50%, rgba(211,152,88,.30) 0%, rgba(211,152,88,0) 60%),
    linear-gradient(150deg, #42190F 0%, var(--alm-brun) 60%, #250D08 100%);
  box-shadow: 0 22px 50px -24px rgba(52,21,15,.6);
}
.score-hero::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(211,152,88,.3); border-radius: 1rem; pointer-events: none; }
.score-hero.is-failed { background: radial-gradient(70% 120% at 0% 50%, rgba(181,96,62,.30) 0%, rgba(181,96,62,0) 60%), linear-gradient(150deg, #3D1A13 0%, #2E1410 60%, #1E0B08 100%); }
.score-gauge { position: relative; z-index: 1; flex: 0 0 auto; width: 168px; height: 168px; padding: 0; border: 0; background: none; border-radius: 50%; color: inherit; }
.score-gauge:not(:disabled) { cursor: pointer; }
.score-gauge:disabled { cursor: default; opacity: 1; }
.score-gauge:focus-visible { outline: 3px solid var(--alm-caramel); outline-offset: 4px; }
.score-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gauge-track { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 10; }
.gauge-value { fill: none; stroke: var(--alm-caramel); stroke-width: 10; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(211,152,88,.55)); }
.is-failed .gauge-value { stroke: #C8735A; filter: none; }
.gauge-threshold { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; opacity: .85; }
.gauge-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.gauge-number { font-family: "Playfair Display", Georgia, serif; font-size: 2.9rem; color: #fff; font-variant-numeric: tabular-nums; }
.gauge-number small { font-size: 1.3rem; margin-left: .1rem; color: var(--alm-sable); }
.gauge-caption { margin-top: .35rem; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--alm-caramel); }
.score-gauge:not(:disabled):hover svg { filter: brightness(1.12); }
.is-revealed.is-passed .score-gauge { animation: score-pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes score-pop { 0% { transform: scale(1); } 50% { transform: scale(1.07); } 100% { transform: scale(1); } }
.score-body { position: relative; z-index: 1; flex: 1 1 320px; min-width: 0; }
.score-kicker { margin: 0 0 .35rem; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--alm-caramel); }
.score-title { margin: 0 0 .5rem; color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.score-lead { margin: 0 0 1rem; color: #E8D3BE; max-width: 52ch; }
.score-chips { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.score-chips li { padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; background: rgba(255,255,255,.08); border: 1px solid rgba(211,152,88,.35); color: #F3E7DA; }
.score-chips li strong { color: #fff; }
.score-chips li.is-muted { opacity: .75; }
.score-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.score-actions .btn-outline-light { --bs-btn-color: #F3E7DA; --bs-btn-border-color: rgba(243,231,218,.5); --bs-btn-hover-bg: rgba(243,231,218,.12); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #F3E7DA; }
.score-link { color: var(--alm-sable); }
.score-link:hover { color: #fff; }
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }
@media (max-width: 575.98px) {
  .score-hero { padding: 1.5rem 1.25rem; justify-content: center; text-align: center; }
  .score-chips, .score-actions { justify-content: center; }
  .score-gauge { width: 140px; height: 140px; }
  .gauge-number { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) { .is-revealed.is-passed .score-gauge { animation: none; } }

/* --- QCM ----------------------------------------------------------------------- */
.quiz-question { border: 1px solid var(--alm-bord); border-radius: 1rem; background: #fff; padding: 1.25rem; margin-bottom: 1rem; }
.quiz-option { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid #E3D5C6; border-radius: .75rem; padding: .7rem .9rem; margin-bottom: .5rem; cursor: pointer; background: #fff; }
.quiz-option:hover { border-color: var(--alm-caramel); }
.quiz-option input { margin-top: .3rem; }
.quiz-option.is-correct { border-color: var(--alm-succes); background: #EEF7F0; }
.quiz-option.is-wrong { border-color: var(--alm-alerte); background: #FBEDE9; }
.quiz-media img { max-width: 100%; max-height: 420px; border-radius: .75rem; }
.explanation { background: #F7F0E7; border-radius: .75rem; padding: .75rem 1rem; margin-top: .75rem; font-size: .95rem; }

/* --- Éditeur de formation ------------------------------------------------------- */
.editor-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1199.98px) { .editor-shell { grid-template-columns: 1fr; } }
.editor-toolbar-sticky { position: sticky; top: 57px; z-index: 1000; background: var(--alm-ivoire); padding: .75rem 0; margin-top: -.75rem; border-bottom: 1px solid var(--alm-bord); margin-bottom: 1.25rem; }
.outline { background: #fff; border: 1px solid var(--alm-bord); border-radius: 1rem; padding: .75rem; position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; }
.outline .outline-item { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; background: none; border: 0; border-radius: .55rem; padding: .45rem .6rem; color: var(--alm-texte); font-size: .92rem; }
.outline .outline-item:hover { background: #FBF6F0; }
.outline .outline-item.active { background: var(--alm-beige); font-weight: 600; }
.outline .outline-module { font-weight: 600; }
.outline .outline-lesson { padding-left: 1.6rem; font-size: .88rem; }
.outline .tag { font-size: .7rem; color: var(--alm-gris); margin-left: auto; white-space: nowrap; }
.editor-panel { background: #fff; border: 1px solid var(--alm-bord); border-radius: 1rem; padding: 1.5rem; }
.rte { border: 1px solid #D8C7B5; border-radius: .7rem; background: #fff; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; border-bottom: 1px solid #EADDCF; background: #FCF8F3; border-radius: .7rem .7rem 0 0; }
.rte-toolbar button { border: 1px solid transparent; background: none; border-radius: .4rem; padding: .25rem .55rem; font-size: .85rem; color: var(--alm-brun); min-width: 34px; }
.rte-toolbar button:hover { background: var(--alm-beige); }
.rte-toolbar button[aria-pressed="true"] { background: var(--alm-sable); border-color: var(--alm-caramel); }
.rte-toolbar .sep { width: 1px; background: #E2D3C3; margin: .2rem .25rem; }
.rte-area { min-height: 260px; padding: .9rem 1rem; outline: none; }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(211,152,88,.35); border-radius: 0 0 .7rem .7rem; }
.rte-area h1 { font-size: 1.6rem; } .rte-area h2 { font-size: 1.35rem; } .rte-area h3 { font-size: 1.1rem; font-family: "Albert Sans", sans-serif; font-weight: 700; }
.rte-area:empty::before { content: attr(data-placeholder); color: #A99A91; }
.option-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.option-row .form-check-input { margin: 0; width: 1.25rem; height: 1.25rem; flex: 0 0 1.25rem; }
.media-preview { background: #FAF5EE; border: 1px dashed #D8C7B5; border-radius: .75rem; padding: .75rem; margin-top: .5rem; }
.media-preview img { max-width: 100%; max-height: 220px; border-radius: .5rem; }
.media-preview iframe, .media-preview video { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: .5rem; background: #000; }
.save-indicator { font-size: .85rem; }
.error-list { max-height: 220px; overflow: auto; }

/* --- Divers -------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--alm-gris); }
.empty-state .font-titre { font-size: 1.4rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.mail-body { white-space: pre-wrap; background: #FBF7F2; border: 1px solid var(--alm-bord); border-radius: .75rem; padding: 1rem; font-size: .92rem; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.dl-grid dt { color: var(--alm-gris); font-weight: 500; }
.dl-grid dd { margin: 0; }
.table-responsive { border-radius: 1rem; }
.filters { background: #fff; border: 1px solid var(--alm-bord); border-radius: 1rem; padding: 1rem; margin-bottom: 1rem; }
.nav-pills .nav-link { border-radius: 999px; color: var(--alm-brun); }
.nav-pills .nav-link.active { background: var(--alm-brun); }
.nav-tabs .nav-link { color: var(--alm-gris); }
.nav-tabs .nav-link.active { color: var(--alm-brun); font-weight: 600; border-bottom-color: #fff; }
.toast-zone { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast-zone .alert { box-shadow: 0 10px 30px rgba(52,21,15,.18); margin: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .admin-sidebar, .admin-topbar, .learner-header, .no-print { display: none !important; } }
