/* =====================================================================
   SOC ACADEMY - design system
   Fichier : /public/assets/css/soc.css

   Principe : le poste de travail d'un analyste. Une seule zone porte
   l'effet (le bandeau Command Center) ; tout le reste reste sobre et
   lisible pendant plusieurs heures d'affilee.
   ===================================================================== */

:root {
  /* Fond */
  --void:        #04060c;
  --deep:        #070b14;
  --surface:     #0b1120;
  --panel:       rgba(13, 20, 35, 0.72);
  --panel-solid: #0d1423;

  /* Traits */
  --line:        rgba(96, 165, 200, 0.16);
  --line-strong: rgba(34, 211, 238, 0.38);

  /* Accents */
  --cyan:   #22d3ee;
  --blue:   #3b6dff;
  --green:  #34d399;
  --amber:  #f5a524;
  --red:    #f43f5e;
  --violet: #8b7cf6;

  /* Texte */
  --text:   #dde7f2;
  --dim:    #94a8c0;
  --faint:  #61748d;

  /* Typographie */
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 4px;
  --radius-lg: 8px;
  --shell: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1100px 620px at 78% -12%, rgba(59, 109, 255, 0.13), transparent 62%),
    radial-gradient(760px 460px at 4% 8%, rgba(34, 211, 238, 0.08), transparent 60%);
  background-attachment: fixed;
}

/* ------------------------------------------------------------ typographie */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1.1em; max-width: 72ch; }
a  { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: #fff; font-weight: 600; }
code, kbd, pre, .mono { font-family: var(--mono); }

code {
  background: rgba(34, 211, 238, 0.09);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.88em;
  color: #a5f3fc;
}

pre {
  background: #060a12;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #b7cbe0;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

.lede { font-size: 1.13rem; color: var(--dim); max-width: 66ch; }
.muted { color: var(--dim); }
.faint { color: var(--faint); font-size: 0.88rem; }

/* --------------------------------------------------------------- ossature */
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 2.5rem; }

.grid { display: grid; gap: 1.15rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --------------------------------------------------------------- panneaux */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  backdrop-filter: blur(9px);
}
.panel-tight { padding: 1rem 1.1rem; }
.panel h3 { margin-bottom: 0.45rem; }
.panel-link { display: block; color: inherit; transition: border-color 0.15s ease; }
.panel-link:hover { border-color: var(--line-strong); text-decoration: none; }

/* Etiquette de section : porte une information de structure, pas de decor */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0.15rem 0.5rem;
}

/* --------------------------------------------------------------- boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.68rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cyan); color: #04121a; font-weight: 600; }
.btn-primary:hover { background: #67e8f9; }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: rgba(34, 211, 238, 0.08); }
.btn-quiet { border-color: var(--line); color: var(--dim); background: transparent; }
.btn-quiet:hover { color: var(--text); border-color: var(--line-strong); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------------------------------------------------------- entete */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 6, 12, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--text); }
.brand:hover { text-decoration: none; }
/* Embleme du logo. Il remplace l'ancien carre « SA » ; le nom de la marque,
   a cote, reste du texte HTML. Largeur et hauteur sont fixees dans la balise
   pour eviter tout decalage de la page pendant le chargement. */
.brand-logo {
  display: block; flex: none; width: 34px; height: 38px;
  object-fit: contain;
}
/* L'administration se distingue par un liseré ambre, et non plus par la
   couleur du carre, que l'embleme a remplace. */
.brand-logo-admin { filter: drop-shadow(0 0 0 var(--amber)) drop-shadow(0 0 3px rgba(245,166,35,.55)); }

.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 600;
  color: var(--cyan);
}
.brand-name { font-weight: 600; letter-spacing: 0.02em; }
.brand-sub { display: block; font-family: var(--mono); font-size: 0.63rem; color: var(--faint); letter-spacing: 0.12em; }

.nav { display: flex; align-items: center; gap: 1.35rem; margin-left: auto; }
.nav a { color: var(--dim); font-size: 0.92rem; }
.nav a:hover, .nav a.is-active { color: var(--text); text-decoration: none; }
.nav a.is-active { border-bottom: 1px solid var(--cyan); padding-bottom: 2px; }
/* Les boutons places dans la navigation gardent leurs propres couleurs. Sans
   ces regles, « .nav a », plus specifique que « .btn-primary », leur imposait
   le gris des liens : le texte du bouton devenait illisible sur son fond cyan. */
.nav a.btn-primary, .nav a.btn-primary:hover { color: #04121a; }
.nav a.btn-ghost, .nav a.btn-ghost:hover { color: var(--text); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-family: var(--mono);
}

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: 5.5rem 0 4.5rem; overflow: hidden; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(circle at 62% 28%, #000 0%, transparent 72%);
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero h1 { max-width: 17ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

/* Un seul mouvement sur la page : le balayage du bandeau HUD au chargement */
.sweep { position: relative; overflow: hidden; }
.sweep::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 34%;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.10), transparent);
  animation: sweep 2.4s ease-out 1;
}
@keyframes sweep { from { left: -35%; } to { left: 105%; } }

/* -------------------------------------------------------- bandeau Command */
.hud {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(13, 24, 42, 0.9), rgba(7, 11, 20, 0.9));
  padding: 0;
  overflow: hidden;
}
.hud-bar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
}
.hud-body { display: grid; grid-template-columns: repeat(4, 1fr); }
.hud-cell { padding: 1.25rem 1.2rem; border-right: 1px solid var(--line); }
.hud-cell:last-child { border-right: 0; }
.hud-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.11em; color: var(--faint); }
.hud-value { font-family: var(--mono); font-size: 1.9rem; font-weight: 600; color: #fff; line-height: 1.15; }
.hud-value small { font-size: 0.95rem; color: var(--dim); font-weight: 400; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }

/* Niveaux de menace */
.threat-low      { color: var(--green); }
.threat-guarded  { color: var(--cyan); }
.threat-elevated { color: var(--amber); }
.threat-high     { color: var(--red); }

/* ------------------------------------------------------------ progression */
.bar { height: 6px; background: rgba(148, 168, 192, 0.15); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.bar-sm { height: 4px; }

.meter { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; }
.meter b { font-family: var(--mono); color: #fff; }

/* --------------------------------------------------------------- tableaux */
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--faint); font-weight: 500; }
table.data tr:last-child td { border-bottom: 0; }

/* ----------------------------------------------------------------- badges */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.18rem 0.6rem;
  color: var(--dim);
}
.pill-critical { border-color: rgba(244, 63, 94, 0.5); color: #fda4af; }
.pill-high     { border-color: rgba(245, 165, 36, 0.5); color: #fcd34d; }
.pill-medium   { border-color: rgba(59, 109, 255, 0.5); color: #93c5fd; }
.pill-low      { border-color: rgba(52, 211, 153, 0.45); color: #6ee7b7; }
.pill-ok       { border-color: rgba(52, 211, 153, 0.45); color: #6ee7b7; }

.badge-tile { display: flex; gap: 0.85rem; align-items: flex-start; }
.badge-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius);
  font-family: var(--mono); font-weight: 600;
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.07);
}
.tier-gold .badge-mark     { border-color: rgba(245, 165, 36, 0.55); color: var(--amber); background: rgba(245, 165, 36, 0.07); }
.tier-platinum .badge-mark { border-color: rgba(139, 124, 246, 0.55); color: var(--violet); background: rgba(139, 124, 246, 0.08); }
.tier-silver .badge-mark   { border-color: rgba(148, 168, 192, 0.5); color: #cbd5e1; background: rgba(148, 168, 192, 0.07); }

/* --------------------------------------------------------- etats du parcours */
.state { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; }
.state-locked   { color: var(--faint); }
.state-progress { color: var(--cyan); }
.state-done     { color: var(--green); }

/* ------------------------------------------------------------ formulaires */
.form-row { margin-bottom: 1.05rem; }
.form-row label { display: block; font-size: 0.85rem; color: var(--dim); margin-bottom: 0.35rem; }
.input, select.input, textarea.input {
  width: 100%;
  background: #060a12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.62rem 0.75rem;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13);
}
textarea.input { min-height: 140px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--faint); margin-top: 0.3rem; }
.form-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; color: var(--dim); }
.form-check input { margin-top: 0.28rem; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* --------------------------------------------------------------- messages */
.alert {
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  border-radius: var(--radius);
  background: rgba(13, 20, 35, 0.8);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.alert-error   { border-left-color: var(--red); }
.alert-success { border-left-color: var(--green); }
.alert-warning { border-left-color: var(--amber); }

/* ------------------------------------------------------- coquille etudiant */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 17, 0.82);
  padding: 1.1rem 0.9rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-group { margin-top: 1.5rem; }
.side-group > span {
  display: block; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.12em; color: var(--faint); padding: 0 0.6rem 0.45rem;
}
.side a {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--dim); font-size: 0.9rem;
  padding: 0.5rem 0.6rem; border-radius: var(--radius);
}
.side a:hover { background: rgba(34, 211, 238, 0.06); color: var(--text); text-decoration: none; }
.side a.is-active { background: rgba(34, 211, 238, 0.1); color: var(--cyan); }
.side-key { font-family: var(--mono); font-size: 0.7rem; width: 1.2rem; color: var(--faint); }

.main { padding: 1.6rem 1.9rem 4rem; min-width: 0; }
.main-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.main-head h1 { font-size: 1.55rem; margin: 0; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
}

/* ------------------------------------------------------------------ pied */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--faint); font-size: 0.88rem; }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.footer a { color: var(--dim); }
.footer h4 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.11em; color: var(--faint); font-weight: 500; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 0.35rem; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud-body { grid-template-columns: repeat(2, 1fr); }
  .hud-cell:nth-child(2n) { border-right: 0; }
  .hud-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-group { margin-top: 1rem; }
  .main { padding: 1.2rem 1.1rem 3rem; }
}

@media (max-width: 720px) {
  .nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--deep); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.6rem 0; width: 100%; }
  .nav-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sweep::after { animation: none; display: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------- impression */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .side, .footer, .btn { display: none; }
}

/* =====================================================================
   PHASE 3-4 : lecteur de lecons et moteur de quiz
   ===================================================================== */

/* Fil d'ariane -------------------------------------------------------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-bottom: 1rem; font-size: .86rem; color: var(--faint);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }

/* Corps de lecon ------------------------------------------------------ */
.prose { line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { margin: 1.9rem 0 .7rem; font-size: 1.12rem; }
.prose h4 { margin: 1.5rem 0 .55rem; font-size: 1rem; color: var(--cyan); }
.prose p { margin: 0 0 .95rem; }
.prose ul, .prose ol { margin: 0 0 .95rem; padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose code {
  font-family: 'IBM Plex Mono', monospace; font-size: .88em;
  background: rgba(34, 211, 238, .09); border: 1px solid var(--line);
  border-radius: 4px; padding: .08em .38em; color: var(--cyan);
}
.prose pre {
  font-family: 'IBM Plex Mono', monospace; font-size: .82rem;
  background: rgba(2, 4, 10, .72); border: 1px solid var(--line);
  border-left: 2px solid var(--cyan); border-radius: 6px;
  padding: .85rem 1rem; overflow-x: auto; margin: 0 0 1.1rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.1rem; font-size: .9rem; }
.prose th, .prose td { padding: .5rem .65rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--muted); font-weight: 600; }

/* Glossaire des lecons : le terme doit se reperer d'un coup d'oeil, et sa
   definition rester visuellement rattachee a lui. */
.prose dl {
  margin: 0 0 1.2rem; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.prose dt {
  font-weight: 600; color: var(--cyan); padding: .7rem 1rem 0;
  font-size: .95rem;
}
.prose dd {
  margin: 0; padding: .2rem 1rem .75rem; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.prose dd:last-child { border-bottom: 0; }
.prose dt + dd { margin-top: 0; }

.prose blockquote {
  margin: 0 0 1.1rem; padding: .1rem 0 .1rem 1rem;
  border-left: 2px solid var(--line); color: var(--muted);
}

/* Encadres ------------------------------------------------------------ */
.callout { border-left: 2px solid var(--line); }
.callout h4 { font-size: .95rem; }
.callout ul { padding-left: 1.15rem; }
.callout li { margin-bottom: .35rem; }
.callout-cyan  { border-left-color: var(--cyan); }
.callout-green { border-left-color: var(--green); }
.callout-amber { border-left-color: var(--amber); }
.callout-blue  { border-left-color: var(--blue); }

/* Navigation bas de page ---------------------------------------------- */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }

/* Barre de quiz ------------------------------------------------------- */
.quiz-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem;
  padding: .7rem 1rem; margin-bottom: 1.15rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.countdown { margin-left: auto; font-size: 1.05rem; color: var(--cyan); }
.countdown.is-urgent { color: var(--red); }

/* Questions ----------------------------------------------------------- */
.question-head { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.question-prompt { margin: 0 0 .9rem; line-height: 1.6; }
.question-ok { border-left: 2px solid var(--green); }
.question-ko { border-left: 2px solid var(--red); }

.logbox {
  font-family: 'IBM Plex Mono', monospace; font-size: .8rem; line-height: 1.6;
  background: rgba(2, 4, 10, .78); border: 1px solid var(--line);
  border-left: 2px solid var(--blue); border-radius: 6px;
  padding: .8rem 1rem; overflow-x: auto; margin: 0 0 1rem; color: var(--muted);
}

.choices { display: flex; flex-direction: column; gap: .5rem; }
.choice {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: rgba(34, 211, 238, .4); }
.choice input { margin-top: .22rem; accent-color: var(--cyan); flex-shrink: 0; }
.choice:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }

.choice-review { cursor: default; }
.choice-review:hover { border-color: var(--line); }
.choice-mark { width: 1rem; flex-shrink: 0; text-align: center; }
.choice-correct { border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .07); }
.choice-correct .choice-mark { color: var(--green); }
.choice-wrong { border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .07); }
.choice-wrong .choice-mark { color: var(--red); }

.explain {
  margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line);
  font-size: .92rem; line-height: 1.6;
}

/* Verdict ------------------------------------------------------------- */
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; }
.verdict-score { font-size: 2.1rem; line-height: 1; }
.verdict-ok { border-left: 2px solid var(--green); }
.verdict-ok .verdict-score { color: var(--green); }
.verdict-ko { border-left: 2px solid var(--amber); }
.verdict-ko .verdict-score { color: var(--amber); }

.state-wrong { color: var(--red); }
.tag-cyan { color: var(--cyan); border-color: rgba(34, 211, 238, .35); }

@media (max-width: 720px) {
  .pager { flex-direction: column; }
  .pager .btn { width: 100%; text-align: center; }
  .verdict-score { font-size: 1.7rem; }
  .countdown { margin-left: 0; }
}

/* =====================================================================
   PHASE 5 : SOC Simulator
   ===================================================================== */

.incident-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }

/* Pastilles de severite : memes teintes que l'echelle incidents.severity,
   pour que l'apprenant associe une couleur a un niveau reel. */
.sev {
  display: inline-block; padding: .22rem .7rem; border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: .8rem; font-weight: 600;
  border: 1px solid currentColor;
}
.sev-info     { color: var(--faint); }
.sev-low      { color: var(--green); }
.sev-medium   { color: var(--cyan); }
.sev-high     { color: var(--amber); }
.sev-critical { color: var(--red); }

.logline { margin-bottom: 1rem; }
.logline:last-child { margin-bottom: 0; }
.logline .logbox { margin-top: .35rem; margin-bottom: 0; }

.choices-row { flex-direction: row; flex-wrap: wrap; }
.choices-row .choice { flex: 1 1 auto; }

textarea.input { font-family: inherit; line-height: 1.6; resize: vertical; }
select.input { appearance: none; }

.scoring { list-style: none; margin: 0; padding: 0; }
.scoring li {
  padding: .55rem 0 .55rem .9rem; border-left: 2px solid var(--line);
  margin-bottom: .45rem; line-height: 1.55;
}
.scoring li:last-child { margin-bottom: 0; }
.scoring-ok { border-left-color: var(--green); }
.scoring-ko { border-left-color: var(--red); }

@media (max-width: 720px) {
  .incident-head > div:last-child { margin-left: 0 !important; text-align: left !important; }
  .choices-row { flex-direction: column; }
}

.scoring-critical {
  border-left-color: var(--red);
  background: rgba(244, 63, 94, .08);
  color: var(--red); font-weight: 600;
}

/* =====================================================================
   PHASE 6 : KQL Lab, Log Analysis Lab, MITRE Explorer
   ===================================================================== */

/* Tableaux larges : on fait defiler le tableau, pas la page entiere. */
.table-scroll { overflow-x: auto; }
.table-scroll .data { min-width: 100%; white-space: nowrap; }
.table-scroll .data td, .table-scroll .data th { font-size: .82rem; padding: .4rem .6rem; }

.kql-editor {
  font-family: 'IBM Plex Mono', monospace; font-size: .88rem; line-height: 1.65;
  background: rgba(2, 4, 10, .72); tab-size: 2;
}

.attempt-row { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.attempt-row:last-child { border-bottom: 0; padding-bottom: 0; }
.attempt-row .logbox { font-size: .78rem; padding: .55rem .75rem; }

/* Matrice ATT&CK : colonnes qui defilent horizontalement, comme la vraie. */
.matrix { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .6rem; }
.matrix-col { flex: 0 0 15rem; display: flex; flex-direction: column; gap: .4rem; }
.matrix-head {
  padding: .6rem .7rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; border-top: 2px solid var(--cyan);
}
.matrix-head span { display: block; font-size: .72rem; margin-bottom: .15rem; }
.matrix-head strong { font-size: .88rem; line-height: 1.3; }
.matrix-cell {
  display: block; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 5px;
  text-decoration: none; color: var(--text); font-size: .82rem; line-height: 1.4;
  transition: border-color .15s ease, background .15s ease;
}
.matrix-cell:hover { border-color: var(--cyan); background: rgba(34, 211, 238, .07); }
.matrix-cell .mono { display: block; font-size: .72rem; color: var(--cyan); margin-bottom: .1rem; }
.matrix-cell.is-sub { margin-left: .8rem; border-left: 2px solid var(--line); }
.matrix-empty { padding: .5rem .7rem; }

a.choice { text-decoration: none; color: var(--text); }

@media (max-width: 720px) {
  .matrix-col { flex: 0 0 13rem; }
}

/* =====================================================================
   PHASE 7 : badges
   ===================================================================== */

.badge-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
}
.badge-card { display: flex; flex-direction: column; border-left: 2px solid var(--line); }
.badge-card.is-locked { opacity: .72; }
.badge-card.is-earned.tier-bronze   { border-left-color: #c08457; }
.badge-card.is-earned.tier-silver   { border-left-color: #b8c4d0; }
.badge-card.is-earned.tier-gold     { border-left-color: var(--amber); }
.badge-card.is-earned.tier-platinum { border-left-color: var(--violet); }

.badge-top { display: flex; align-items: center; gap: .8rem; }
.badge-icon { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.badge-icon-lg { font-size: 3rem; }
.badge-criteria {
  margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line);
  font-size: .88rem; color: var(--muted); line-height: 1.55;
}
.badge-earned, .badge-progress { margin-top: .9rem; }
.badge-card .bar { margin-top: .35rem; }

.verify-badge { display: flex; align-items: center; gap: 1.1rem; margin-top: .9rem; }
.shell-narrow { max-width: 46rem; }

@media (max-width: 720px) {
  .badge-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   PHASE 9 : panneau d'administration
   ===================================================================== */

/* L'administration reprend la coque de l'espace apprenant : meme rail, memes
   panneaux. Seule la pastille de marque change, pour qu'on sache d'un coup
   d'oeil qu'on agit sur les donnees de tout le monde. */
.brand-mark-admin { background: var(--amber); color: var(--void); }

.text-amber { color: var(--amber); }
.text-red   { color: var(--red); }
