/* ================================================================
   CEJM SHELL — SKIN « GLASS / BENTO »
   Variante visuelle additive (chargée APRÈS cejm-shell.css)
   Inspirée des pages de sommaire (cejm.html / adoc.html) :
   glassmorphism (flou, transparence, halos) + cartes façon bento.
   N'altère ni le HTML, ni le JS, ni les variables de thème —
   uniquement un re-skin visuel.
   ================================================================ */

/* ───────────────────────── 0. HERO DE CHAPITRE ──────────────────────── */
.chap-hero{
  position: relative;
  overflow: hidden;
  margin: 14px 18px 0;
  border-radius: 1.75rem;
  min-height: 230px;
  display: flex;
  align-items: stretch;
  box-shadow: 0 22px 54px -18px rgba(0,0,0,.3);
}
.chap-hero-bg{ position:absolute; inset:0; z-index:0; }
.chap-hero-bg img{ width:100%; height:100%; object-fit:cover; }
.chap-hero-overlay{
  position:absolute; inset:0;
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--ac) 92%, transparent) 0%,
    color-mix(in srgb, var(--ac) 58%, transparent) 45%,
    color-mix(in srgb, var(--ac) 12%, transparent) 100%);
}
.chap-hero-content{
  position: relative; z-index: 1;
  padding: 34px 38px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  color: #fff;
}
.chap-hero-main{ max-width: 620px; }
.chap-hero-badge{
  display: inline-block;
  padding: 5px 14px; margin-bottom: 14px;
  border-radius: 9999px;
  font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}

/* Badge principal (titre BTS...) — même effet "verre" que le bouton
   Tableau de bord, avec inversion au survol */
.chap-hero-main > .chap-hero-badge{
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.25);
  color: #fff;
  text-decoration: none;
  transition: all .18s ease;
}
.chap-hero-main > .chap-hero-badge:hover{
  background: #fff;
  color: var(--ac);
  text-decoration: none;
}
.chap-hero-title{
  font-family: 'Manrope', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.15; letter-spacing: -.02em;
  margin-bottom: 10px;
  text-shadow: 0 2px 18px rgba(0,0,0,.18);
}
.chap-hero-sub{
  font-size: .95rem; font-weight: 500;
  opacity: .92; max-width: 480px; line-height: 1.6;
}

/* ───────────────── 0a. ACTIONS DU HERO (thème + raccourcis) ─────────── */

/* Sélecteur de thème — pill à 4 icônes, ancré en haut à droite du hero,
   synchronisé avec SHELL.setTheme() via le script "Synchro Hero" */
.chap-hero-theme{
  position: absolute; z-index: 2;
  top: 18px; right: 18px;
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 9999px; padding: 4px;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.25);
}
.chap-hero-theme .theme-btn{
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9999px;
  border: none; background: transparent; padding: 0;
  font-size: 1rem; line-height: 1; cursor: pointer;
  opacity: .65; transition: all .2s ease;
}
.chap-hero-theme .theme-btn:hover{ opacity: 1; }
.chap-hero-theme .theme-btn.active{
  background: #fff; opacity: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

/* Raccourcis Explorer / Ancrer / Agir — pastilles colorées, alignées
   à gauche sous le titre/sous-titre du hero */
.chap-hero-actions{
  display: flex; justify-content: flex-start;
  max-width: 620px;
}

/* Pastille "Découvrir, s'exercer, appliquer" — même format que le badge
   du haut (chap-hero-badge), sans la marge basse */
.chap-hero-tagline{ margin-bottom: 0; }
.hero-bento-actions{
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: #fff;
  border-radius: 9999px;
  padding: 5px;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.25);
}
.hero-bento-btn{
  display: inline-flex; align-items: center;
  padding: .22rem .7rem; border-radius: 9999px;
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: all .18s ease;
}
.hero-bento-btn.btn-explorer{
  background: color-mix(in srgb, var(--ac) 16%, #fff);
  color: var(--ac);
  border-color: color-mix(in srgb, var(--ac) 35%, transparent);
}
.hero-bento-btn:hover{ text-decoration: none; }
.hero-bento-btn.btn-explorer:hover{ background: var(--ac); color: #fff; border-color: var(--ac); }
.hero-bento-btn.btn-ancrer{
  background: color-mix(in srgb, var(--ac2) 16%, #fff);
  color: var(--ac2);
  border-color: color-mix(in srgb, var(--ac2) 35%, transparent);
}
.hero-bento-btn.btn-ancrer:hover{ background: var(--ac2); color: #fff; border-color: var(--ac2); }
.hero-bento-btn.btn-agir{
  background: color-mix(in srgb, var(--ok) 16%, #fff);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.hero-bento-btn.btn-agir:hover{ background: var(--ok); color: #fff; border-color: var(--ok); }
.hero-bento-btn.is-current{ background: var(--ac); color: #fff; border-color: var(--ac); }

/* Bouton "Tableau de bord" — ancré en bas à droite du hero */
.chap-hero-dashboard{
  position: absolute; z-index: 2;
  bottom: 18px; right: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: #fff; text-decoration: none;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.25);
  transition: all .18s ease;
}
.chap-hero-dashboard:hover{
  background: #fff; color: var(--ac);
  text-decoration: none;
}

/* ───────────────────────── 0b. BARRE D'INFOS DE CHAPITRE ────────────── */
.chap-infobar{
  display: flex; flex-wrap: wrap; align-items: center; gap: 28px;
  margin: 16px 18px 0; padding: 16px 24px;
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
  border: 1px solid color-mix(in srgb, #fff 18%, var(--bd));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 12px 30px -16px rgba(0,0,0,.14);
}
.chap-stat{ display: flex; align-items: center; gap: 12px; }
.chap-stat-ico{
  width: 44px; height: 44px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.chap-stat-lbl{
  font-size: .62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--tx2); opacity: .7;
}
.chap-stat-val{
  font-family: 'Manrope', sans-serif;
  font-weight: 800; font-size: 1.05rem; color: var(--tx);
}
.chap-steps{ display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chap-step{
  width: 38px; height: 38px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg3) 65%, transparent);
  color: var(--tx2); border: 1px solid transparent;
  font-size: .85rem; cursor: pointer;
  transition: all .2s ease;
}
.chap-step:hover{
  background: color-mix(in srgb, var(--acL) 80%, transparent);
  color: var(--ac);
}
.chap-step.done{
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
  color: var(--ok);
}
.chap-step.active{
  background: var(--gr); color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ac) 45%, transparent);
}

@media (max-width:900px){
  .chap-hero{ margin: 10px 10px 0; min-height: 190px; }
  .chap-hero-content{ padding: 24px; gap: 14px; }
  .chap-hero-theme{ top: 10px; right: 10px; padding: 3px; }
  .chap-hero-theme .theme-btn{ width: 28px; height: 28px; font-size: .9rem; }
  .chap-hero-actions{ max-width: 100%; justify-content: flex-start; }
  .chap-hero-dashboard{ bottom: 10px; right: 10px; padding: 6px 12px; font-size: .65rem; }
  .chap-infobar{ margin: 12px 10px 0; gap: 16px; }
  .chap-steps{ margin-left: 0; width: 100%; justify-content: flex-start; }
}

/* ───────────────────────── 1. FOND « AURORA » ───────────────────────── */
html{ scroll-behavior:smooth; }
body{
  background:
    radial-gradient(ellipse 900px 620px at 6% -8%,  color-mix(in srgb, var(--ac)  22%, transparent), transparent 60%),
    radial-gradient(ellipse 820px 700px at 108% 12%, color-mix(in srgb, var(--ac2) 18%, transparent), transparent 60%),
    radial-gradient(ellipse 760px 680px at 45% 115%, color-mix(in srgb, var(--ac)  14%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed, fixed, fixed, fixed;
}

/* ───────────────────────── 2. SIDEBAR EN VERRE ───────────────────────── */
.side{
  border-right: none;
  border-radius: 0 2rem 2rem 0;
  background: color-mix(in srgb, var(--bg2) 58%, transparent);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    0 25px 60px -20px rgba(0,0,0,.18),
    inset 1px 0 0 color-mix(in srgb, #fff 18%, transparent);
}
.s-brand{ border-bottom: 1px solid color-mix(in srgb, #fff 14%, var(--bd)); }
.s-ft{
  background: transparent;
  border-top: 1px solid color-mix(in srgb, #fff 14%, var(--bd));
}
.s-back a{
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg3) 70%, transparent);
  backdrop-filter: blur(8px);
}
.s-search input{
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg3) 65%, transparent);
  backdrop-filter: blur(8px);
}
.ni{ border-radius: 9999px; }
.n-ico{ border-radius: 12px; }
.ni.active{
  background: color-mix(in srgb, var(--sbAc) 80%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 18%, transparent);
}
.ni.active .n-ico{ box-shadow: 0 4px 14px color-mix(in srgb, var(--ac) 45%, transparent); }
.p-bar{ border-radius: 9999px; }

/* ───────────────────────── 3. TOPBAR FLOTTANTE ───────────────────────── */
.topbar{
  margin: 14px 18px 0;
  top: 14px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
  border: 1px solid color-mix(in srgb, #fff 22%, var(--bd));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 12px 34px -14px rgba(0,0,0,.16);
}
.ham, .help-b, .fs-toggle, .tbtn-dash, .th-ctrl{
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg3) 65%, transparent);
  backdrop-filter: blur(10px);
}

/* ───────────────────────── 4. EN-TÊTE DE SECTION (« HERO ») ─────────── */
.s-hdr{
  position: relative;
  overflow: hidden;
  padding: 22px 26px;
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--bg2) 48%, transparent);
  border: 1px solid color-mix(in srgb, #fff 18%, var(--bd));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 14px 36px -16px rgba(0,0,0,.14);
}
.s-hdr::after{
  content:"";
  position:absolute; top:-55%; right:-12%;
  width:240px; height:240px; border-radius:50%;
  background: var(--gr);
  opacity:.14; filter: blur(6px);
  pointer-events:none;
}
.s-hdr .sec-bookmark{
  top:14px; right:14px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg3) 70%, transparent);
  backdrop-filter: blur(8px);
}
.eye{
  border-radius: 9999px;
  background: color-mix(in srgb, var(--acL) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--ac) 22%, transparent);
  backdrop-filter: blur(6px);
  position: relative; z-index: 1;
}
.s-tl, .s-sub{ position: relative; z-index: 1; }

/* ───────────────────────── 5. CARTES « BENTO » EN VERRE ─────────────── */
.cd, .qq, .ap, .pptx-wrap, .sb{
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--bg2) 62%, transparent);
  border: 1px solid color-mix(in srgb, #fff 18%, var(--bd));
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition: transform .28s cubic-bezier(.4,0,.2,1), box-shadow .28s ease, border-color .25s ease;
}
.cd::before, .qq::before, .ap::before, .pptx-wrap::before, .sb::before{
  content:"";
  position:absolute; top:0; left:0; right:0; height:4px;
  background: var(--gr);
  opacity:0; transform: scaleX(.6); transform-origin:center;
  transition: opacity .25s ease, transform .25s ease;
  border-radius: 1.25rem 1.25rem 0 0;
}
.cd::after, .qq::after, .ap::after, .pptx-wrap::after, .sb::after{
  content:"";
  position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(135deg, color-mix(in srgb, #fff 16%, transparent) 0%, transparent 45%);
}
.cd:hover, .qq:hover, .ap:hover{
  transform: translateY(-4px);
  box-shadow: 0 22px 48px -14px rgba(0,0,0,.2);
  border-color: color-mix(in srgb, var(--ac) 30%, var(--bd));
}
.cd:hover::before, .qq:hover::before, .ap:hover::before{ opacity:1; transform: scaleX(1); }

/* ───────────────────────── 6. MINI-CARTES (GRILLE BENTO) ────────────── */
.cg{ gap: 16px; }
.mc{
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--bg2) 50%, transparent);
  border: 1px solid color-mix(in srgb, #fff 16%, var(--bd));
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.mc::before{
  content:"";
  position:absolute; top:0; left:0; right:0; height:3px;
  background: var(--ac);
  opacity:0; transform: scaleX(.5);
  transition: opacity .25s ease, transform .25s ease;
}
.mc:nth-child(2)::before{ background: var(--ac2); }
.mc:nth-child(3)::before{ background: var(--ok); }
.mc:nth-child(4)::before{ background: var(--wa); }
.mc:hover{
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 16px 36px -10px rgba(0,0,0,.18);
  background: color-mix(in srgb, var(--acL) 55%, transparent);
}
.mc:hover::before{ opacity:1; transform: scaleX(1); }
.mc .ttl{ align-items:center; }
.mc .ttl span{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; flex-shrink:0;
  border-radius:.65rem;
  background: var(--gr); color:#fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.16);
}

/* ───────────────────────── 7. BOÎTES MISES EN AVANT ─────────────────── */
.hb{
  border-radius: 0 1rem 1rem 0;
  background: color-mix(in srgb, var(--acL) 65%, transparent);
  backdrop-filter: blur(14px);
}
.kb{
  border-radius: 0 1.25rem 1.25rem 0;
  background: color-mix(in srgb, var(--kbBg) 65%, transparent);
  backdrop-filter: blur(14px);
}

/* ───────────────────────── 8. FLUX / DIAGRAMMES ──────────────────────── */
.fl{
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--bg3) 55%, transparent);
  border: 1px solid color-mix(in srgb, #fff 14%, var(--bd));
  backdrop-filter: blur(12px);
}
.fb-flow{
  border-radius: 1rem;
  background: color-mix(in srgb, var(--bg2) 70%, transparent);
  backdrop-filter: blur(10px);
}

/* ───────────────────────── 9. BOUTONS PILULES ────────────────────────── */
.btn{ border-radius: 9999px; position: relative; overflow: hidden; }
.bp{
  box-shadow: 0 8px 22px -6px color-mix(in srgb, var(--ac) 65%, transparent);
}
.bp::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.32) 50%, transparent 65%);
  background-size: 200% 100%; background-position: 200% 0;
  transition: background-position .45s ease;
  pointer-events:none;
}
.bp:hover::before{ background-position: -100% 0; }
.bp:hover{ transform: translateY(-2px) scale(1.015); }
.bs{
  background: color-mix(in srgb, var(--bg3) 60%, transparent);
  backdrop-filter: blur(10px);
}

/* ───────────────────────── 10. QUIZ — OPTIONS & DnD ──────────────────── */
.qop, .vfb{
  border-radius: 1rem;
  background: color-mix(in srgb, var(--qB) 70%, transparent);
  backdrop-filter: blur(8px);
}
.ddi{
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg2) 70%, transparent);
  backdrop-filter: blur(6px);
}
.ddz{
  border-radius: 1rem;
  background: color-mix(in srgb, var(--bg3) 55%, transparent);
}
.dds{
  border-radius: 1rem;
  background: color-mix(in srgb, var(--bg3) 50%, transparent);
}

/* ───────────────────────── 11. SYNTHÈSE / ONGLETS ────────────────────── */
.synth-tabs button{
  border-radius: 9999px;
  background: color-mix(in srgb, var(--bg3) 60%, transparent);
  backdrop-filter: blur(8px);
}
.synth-pane img{ border-radius: 1.25rem; }

/* ───────────────────────── 12. VIDÉOS ────────────────────────────────── */
.vw, .vw-portrait{
  border-radius: 1.5rem;
  border: 1px solid color-mix(in srgb, #fff 18%, var(--bd));
  box-shadow: 0 18px 44px -16px rgba(0,0,0,.22);
}

/* ───────────────────────── 13. SCORE FINAL ───────────────────────────── */
.fsc{
  border-radius: 1.75rem;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.32);
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
}

/* ───────────────────────── 14. MODALES / ZOOM ────────────────────────── */
.mbx{
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--bg2) 85%, transparent);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.zm img{ border-radius: 1.25rem; }

/* ───────────────────────── 15. RESPONSIVE ────────────────────────────── */
@media (max-width:900px){
  .topbar{ margin: 10px 10px 0; }
  .side{ border-radius: 0 1.5rem 1.5rem 0; }
}
