/* Formation : carte de progression (niveaux reliés par un chemin néon), leçon, quiz animé. */

/* ————— avancement global ————— */
.avancement { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 16px; padding: 18px; }
.avancement > .bouton { grid-column: 1 / -1; width: 100%; }
.avancement-chiffre span { font: 800 3rem/0.9 var(--police-titre); background: linear-gradient(120deg, #fff, var(--cyan) 55%, var(--violet-clair)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.avancement-label { margin: 0 0 8px; color: var(--texte-doux); font-size: 0.9rem; }
.avancement-barre { height: 6px; border-radius: 6px; background: rgba(127, 176, 255, 0.15); overflow: hidden; }
.avancement-barre span { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--electrique), var(--violet)); box-shadow: 0 0 14px rgba(62, 230, 255, 0.7); animation: remplit 1.3s var(--ressort) 0.2s both; transform-origin: left; }
@keyframes remplit { from { transform: scaleX(0); } }

/* ————— le chemin ————— */
.chemin { position: relative; margin-top: 18px; padding-left: 4px; }
.chemin::before { /* la ligne qui relie les niveaux */
  content: ""; position: absolute; left: 31px; top: 28px; bottom: 28px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--electrique) 30%, var(--violet) 70%, rgba(240, 192, 98, 0.6));
  box-shadow: 0 0 12px rgba(77, 141, 255, 0.6); opacity: 0.55;
}
.niveau { position: relative; margin-bottom: 26px; }
.niveau-tete { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.niveau-noeud { position: relative; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #1d2a63, #090d22 70%); box-shadow: 0 0 0 4px var(--nuit), 0 0 24px -4px rgba(77, 141, 255, 0.7); }
.niveau-noeud .anneau { position: absolute; inset: 1px; transform: rotate(-90deg); }
.anneau-fond { fill: none; stroke: rgba(127, 176, 255, 0.18); stroke-width: 4; }
.anneau-plein { fill: none; stroke: url(#neon-trait); stroke-width: 4; stroke-linecap: round; stroke-dasharray: var(--c); stroke-dashoffset: var(--c); transition: stroke-dashoffset 1.4s var(--ressort) 0.25s; }
.niveau.vu .anneau-plein, .reduit .anneau-plein { stroke-dashoffset: var(--p); }
.niveau-n { font: 800 1.35rem/1 var(--police-titre); color: #fff; }
.niveau.complet .niveau-noeud { box-shadow: 0 0 0 4px var(--nuit), 0 0 28px -2px rgba(59, 227, 160, 0.8); }
.niveau-titres h2 { margin: 6px 0 4px; font-size: 1.45rem; }
.niveau-titres .intro { margin: 0 0 4px; font-size: 0.92rem; }
.niveau-compte { margin: 0; font: 500 0.66rem/1.4 var(--police-mono); color: var(--texte-pale); }

.lecons { display: grid; gap: 8px; margin: 12px 0 0 70px; }
.lecon {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 58px;
  border-radius: 16px; padding: 12px 16px; color: var(--texte);
  transition: transform 0.35s var(--ressort), border-color 0.3s;
}
.lecon:hover { text-decoration: none; border-color: var(--filet-fort); transform: translateX(3px); }
.lecon:active { transform: scale(0.98); }
.lecon .jalon { position: absolute; left: -48px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--nuit); border: 2px solid rgba(127, 176, 255, 0.5); }
.lecon .jalon::after { content: ""; position: absolute; right: 100%; }
.lecon.faite .jalon { background: var(--jade); border-color: var(--jade); box-shadow: 0 0 10px var(--jade); }
.lecon.en-cours { border-color: rgba(62, 230, 255, 0.5); box-shadow: 0 0 0 1px rgba(62, 230, 255, 0.25), 0 14px 40px -18px rgba(62, 230, 255, 0.8), var(--ombre); }
.lecon.en-cours .jalon { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 0 rgba(62, 230, 255, 0.7); animation: balise 1.8s ease-out infinite; }
@keyframes balise { 0% { box-shadow: 0 0 0 0 rgba(62, 230, 255, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(62, 230, 255, 0); } }
.lecon.verrou { opacity: 0.62; }
.lecon.verrou .jalon { border-style: dashed; }
.lecon-titre { font-weight: 600; }
.lecon-sous { color: var(--texte-doux); font-size: 0.85rem; margin-top: 2px; }
.lecon.faite .lecon-sous { color: var(--jade); }
.lecon-suivante { position: absolute; top: -8px; right: 12px; padding: 3px 8px; border-radius: 999px; font: 600 0.6rem/1.2 var(--police-mono); color: #04121a; background: var(--cyan); box-shadow: 0 0 14px rgba(62, 230, 255, 0.7); }

/* ————— leçon ————— */
.lecture { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.lecture span { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--cyan), var(--violet), var(--or)); box-shadow: 0 0 10px rgba(62, 230, 255, 0.8); }
.lecon-contenu { line-height: 1.7; font-size: 1.04rem; }
.lecon-contenu .entete h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
.lecon-contenu h2 { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--filet); }
.lecon-contenu .objectifs { background: linear-gradient(160deg, rgba(47, 91, 234, 0.3), rgba(14, 18, 38, 0.6)); border: 1px solid rgba(127, 176, 255, 0.3); border-radius: 18px; padding: 14px 18px; margin: 16px 0; }
.lecon-contenu .objectifs ul { margin: 8px 0 0; }
.lecon-contenu ul, .lecon-contenu ol { padding-left: 1.3em; }
.lecon-contenu li { margin: 6px 0; }
.lecon-contenu li::marker { color: var(--cyan); }
.media { margin: 16px 0; }
.media img { max-width: 100%; border-radius: 14px; border: 1px solid var(--filet); }
.lecon-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 24px; flex-wrap: wrap; }
.lecon-nav .bouton { flex: 1 1 140px; }

/* ————— quiz ————— */
.quiz { margin-top: 30px; border-radius: var(--rayon); padding: 18px; border-color: rgba(155, 107, 255, 0.35); }
.quiz h2 { margin-top: 0; }
.quiz .question { border: 0; border-top: 1px solid var(--filet); padding: 16px 0 0; margin: 16px 0 0; min-width: 0; }
.quiz .question legend { font-weight: 650; padding: 0; margin-bottom: 8px; line-height: 1.4; }
.choix {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; margin: 8px 0;
  border: 1px solid var(--filet-fort); border-radius: 14px; cursor: pointer; background: rgba(8, 12, 30, 0.5);
  transition: border-color 0.25s, background 0.3s, transform 0.35s var(--ressort);
}
.choix:active { transform: scale(0.985); }
.choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix-lettre { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; font: 600 0.72rem/1 var(--police-mono); color: var(--texte-doux); border: 1px solid var(--filet-fort); transition: all 0.3s var(--ressort); }
.choix:has(input:checked) { border-color: var(--electrique); background: rgba(47, 91, 234, 0.22); }
.choix:has(input:checked) .choix-lettre { background: var(--degrade); color: #fff; border-color: transparent; transform: scale(1.08); }
.choix:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.corrige .choix { animation: revele-choix 0.5s var(--ressort) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes revele-choix { 0% { transform: scale(0.98); } 60% { transform: scale(1.01); } 100% { transform: none; } }
.corrige .choix.juste { border-color: rgba(59, 227, 160, 0.7); background: rgba(59, 227, 160, 0.14); }
.corrige .choix.juste .choix-lettre { background: var(--jade); color: #04150e; border-color: transparent; }
.corrige .choix.juste::after { content: "✓"; margin-left: auto; color: var(--jade); font-weight: 700; }
.corrige .choix.faux { border-color: rgba(255, 107, 129, 0.7); background: rgba(255, 107, 129, 0.12); }
.corrige .choix.faux .choix-lettre { background: var(--corail); color: #1d0509; border-color: transparent; }
.corrige .choix.faux::after { content: "✕"; margin-left: auto; color: var(--corail); font-weight: 700; }
.corrige:not(.reussie) .choix.faux { animation: secoue 0.45s ease both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes secoue { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.quiz .bouton[type="submit"] { width: 100%; margin-top: 16px; }
.quiz-bilan { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 18px; }
.quiz-bilan.montre { animation: bilan 0.7s var(--ressort-rebond) both; }
@keyframes bilan { from { opacity: 0; transform: scale(0.6); } }
.quiz-score { font: 800 4rem/0.9 var(--police-titre); color: #fff; font-variant-numeric: tabular-nums; }
.quiz-sur { font: 700 1.6rem/1 var(--police-titre); color: var(--texte-pale); }
.quiz-bilan.parfait .quiz-score { background: linear-gradient(120deg, var(--jade), var(--cyan) 50%, var(--or)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quiz-resultat { font-weight: 650; margin-top: 8px; text-align: center; }
.explication { color: var(--texte-doux); font-size: 0.9rem; padding: 10px 12px; border-radius: 12px; background: rgba(77, 141, 255, 0.08); border-left: 2px solid var(--electrique); animation: monte 0.5s var(--ressort) both; }
