
@font-face { font-family: "Geist Serif"; src: url("/assets/GeistSerif-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --indigo: #1D2647;
  --indigo-2: #2B3666;
  --indigo-70: rgba(29, 38, 71, .70);
  --indigo-50: rgba(29, 38, 71, .50);
  --indigo-10: rgba(29, 38, 71, .08);
  --rose: #F8CCDF;
  --rose-clair: #FCE6EF;
  --papier: #FFF8F5;
  --blanc: #FFFFFF;
  --orange: #D64A17;
  --serif: "Geist Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --main: "Playwrite FR Moderne", cursive;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--papier);
  color: var(--indigo);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; font-synthesis: weight; letter-spacing: -0.015em; line-height: 1.1; text-wrap: balance; }
.ph { font-size: 1.15em; line-height: 1; }

.screen { display: none; min-height: 100dvh; }
.screen.on { display: block; }

/* ---------- barre du haut ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
}
.top .logo { height: 34px; width: auto; }
.me { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; }
.me .initiales {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--rose); font-size: 13px; font-weight: 600;
}

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px; letter-spacing: -0.01em;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primaire { background: var(--indigo); color: var(--papier); }
.btn-rose { background: var(--rose); color: var(--indigo); }
.btn-clair { background: var(--papier); color: var(--indigo); }
.btn-fantome { color: var(--indigo-70); padding: 0 12px; }
@media (hover: hover) and (pointer: fine) {
  .btn-primaire:hover { background: var(--indigo-2); }
  .btn-rose:hover { background: #F5BDD4; }
  .btn-fantome:hover { color: var(--indigo); }
}

.barre { height: 6px; border-radius: 99px; background: var(--indigo-10); overflow: hidden; }
.barre > i { display: block; height: 100%; border-radius: inherit; background: var(--indigo); transform-origin: left; }
.label { font-family: var(--main); font-size: 13px; color: var(--orange); line-height: 1.6; }

/* =========================================================
   1. ACCUEIL
   ========================================================= */
.accueil {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  padding: 24px clamp(16px, 4vw, 48px) 64px;
  max-width: 1320px; margin: 0 auto;
}
.reprendre {
  display: block;
  position: sticky; top: 24px; align-self: start;
  background: var(--indigo); color: var(--papier);
  border-radius: var(--r-lg); overflow: hidden;
}
.reprendre .vignette { position: relative; aspect-ratio: 16 / 9; background: #151B36; }
.reprendre .vignette img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.reprendre .vignette .lecture {
  position: absolute; left: 20px; bottom: 20px;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--papier); color: var(--indigo);
  font-size: 22px;
}
.reprendre .corps { padding: 26px 28px 28px; display: grid; gap: 18px; }
.reprendre .module { font-size: 13px; color: var(--rose); font-weight: 500; }
.reprendre h1 { font-size: clamp(26px, 2.6vw, 34px); color: var(--papier); }
.reprendre .etat { display: flex; align-items: center; gap: 14px; font-size: 13px; color: rgba(255, 248, 245, .7); }
.reprendre .etat .barre { flex: 1; background: rgba(255, 248, 245, .14); }
.reprendre .etat .barre > i { background: var(--rose); }
.reprendre .btn { justify-self: start; }

.formatrice {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding: 14px 16px;
  background: var(--blanc); border-radius: var(--r-md);
}
.formatrice img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.formatrice .nom { font-weight: 500; font-size: 15px; line-height: 1.3; }
.formatrice .role { font-size: 13px; color: var(--indigo-50); }
.formatrice .btn { margin-left: auto; height: 40px; padding: 0 16px; font-size: 14px; }

.parcours-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.parcours-tete h2 { font-size: clamp(28px, 2.8vw, 38px); }
.total { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--indigo-70); white-space: nowrap; }
.total .barre { width: 120px; }

.liste { display: grid; gap: 8px; list-style: none; }
.ligne {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center; gap: 18px;
  padding: 18px 20px; border-radius: var(--r-md);
  background: var(--blanc);
  transition: transform 160ms var(--ease-out);
  animation: entree 420ms var(--ease-out) both;
  animation-delay: calc(var(--i) * 45ms);
}
.ligne:active { transform: scale(0.99); }
.ligne .num { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--indigo); }
.ligne .titre { font-weight: 500; font-size: 16px; line-height: 1.35; }
.ligne .meta { font-size: 13px; color: var(--indigo-50); margin-top: 4px; }
.ligne .barre { margin-top: 10px; max-width: 320px; }
.ligne .statut { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.ligne.fini .statut { background: var(--indigo); color: var(--papier); }
.ligne.encours { background: var(--rose-clair); }
.ligne.encours .statut { background: var(--rose); color: var(--indigo); }
.ligne.avenir .num, .ligne.avenir .titre { color: var(--indigo-50); }
.ligne.avenir .statut { color: var(--indigo-50); }
@media (hover: hover) and (pointer: fine) {
  .ligne:hover { background: var(--rose-clair); }
}
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }

/* =========================================================
   2. LEÇON
   ========================================================= */
.lecon-ecran { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 100dvh; }
.plan {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--blanc); padding: 20px 14px 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.plan .retour { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 14px; color: var(--indigo-70); border-radius: var(--r-sm); }
.plan .module-titre { padding: 0 10px; }
.plan .module-titre h2 { font-size: 22px; margin-top: 4px; }
.plan ol { list-style: none; display: grid; gap: 2px; }
.plan .l {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.4;
}
.plan .l .ph { margin-top: 1px; font-size: 18px; }
.plan .l.fait { color: var(--indigo-50); }
.plan .l.fait .ph { color: var(--indigo); }
.plan .l.ici { background: var(--rose-clair); font-weight: 500; }
.plan .etapes { list-style: none; margin: 4px 0 6px 36px; display: grid; gap: 2px; }
.plan .e { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 13px; color: var(--indigo-70); }
.plan .e .ph { font-size: 16px; }
.plan .e.fait .ph { color: var(--indigo); }
.plan .e.ici { background: var(--blanc); color: var(--indigo); font-weight: 500; box-shadow: 0 1px 2px rgba(29, 38, 71, .08); }
@media (hover: hover) and (pointer: fine) {
  .plan .retour:hover, .plan .l:not(.ici):hover { background: var(--papier); }
}

.lecon { padding: 28px clamp(16px, 5vw, 72px) 48px; max-width: 980px; width: 100%; }
.fil { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.fil .pas { display: flex; gap: 6px; }
.fil .pas i { width: 28px; height: 4px; border-radius: 99px; background: var(--indigo-10); }
.fil .pas i.fait { background: var(--indigo); }
.fil .pas i.ici { background: var(--orange); }
.lecon h1 { font-size: clamp(30px, 3.4vw, 46px); max-width: 22ch; }
.lecon .meta { display: flex; gap: 18px; margin: 14px 0 28px; font-size: 14px; color: var(--indigo-70); }
.lecon .meta span { display: inline-flex; align-items: center; gap: 6px; }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #151B36; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video button {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(29, 38, 71, 0) 40%, rgba(29, 38, 71, .55));
}
.video button span {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  background: var(--papier); color: var(--indigo);
  transition: transform 200ms var(--ease-out);
}
.video button:active span { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .video button:hover span { transform: scale(1.06); } }
.video .legende { position: absolute; left: 24px; bottom: 20px; color: var(--papier); font-weight: 500; pointer-events: none; }

.retenir {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start;
  margin-top: 20px; padding: 22px 24px; border-radius: var(--r-md); background: var(--rose-clair);
}
.retenir .ph { font-size: 22px; color: var(--orange); margin-top: 2px; }
.retenir p { font-family: var(--serif); font-size: 20px; line-height: 1.4; }

/* Licka prend la parole : bloc indigo, indicateur de frappe, puis le message */
.licka { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; margin-top: 32px; align-items: start; }
.licka .avatar { position: relative; width: 56px; height: 56px; }
.licka .avatar img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--papier), 0 0 0 5px var(--rose); }
.licka .avatar::after {
  content: ""; position: absolute; right: -1px; bottom: 1px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 3px var(--papier);
}
.licka .qui { font-family: var(--main); font-size: 14px; color: var(--orange); line-height: 1.4; margin: 2px 0 6px 4px; }
.licka .bulle {
  position: relative; display: inline-block; max-width: 62ch;
  background: var(--indigo); color: var(--papier);
  padding: 18px 22px; border-radius: 6px var(--r-lg) var(--r-lg) var(--r-lg);
  font-size: 17px; line-height: 1.5;
  box-shadow: 0 14px 30px -18px rgba(29, 38, 71, .55);
}
.licka .bulle strong { color: var(--rose); font-weight: 600; }
.licka .frappe { display: none; gap: 5px; padding: 4px 2px; }
.licka .frappe i { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: frappe 900ms ease-in-out infinite; }
.licka .frappe i:nth-child(2) { animation-delay: 150ms; }
.licka .frappe i:nth-child(3) { animation-delay: 300ms; }
.licka .texte { transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.licka.attente .avatar { transform: scale(0.92); opacity: 0; }
.licka.attente .qui { opacity: 0; }
.licka.attente .bulle { opacity: 0; transform: translateY(8px) scale(0.98); }
.licka.frappe-on .frappe { display: flex; }
.licka.frappe-on .texte { display: none; }
.licka.frappe-on .bulle { width: auto; }
.licka.revele .texte { animation: texte 260ms var(--ease-out) both; }
.licka .avatar, .licka .qui, .licka .bulle { transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); transform-origin: left top; }
.licka .bulle { transition-delay: 60ms; }
@keyframes frappe { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes texte { from { opacity: 0; transform: translateY(4px); } }

.nav-bas { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; }

/* =========================================================
   3. EXERCICE
   ========================================================= */
.exo-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
}
.exo-top .fermer { justify-self: start; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.exo-top .pas { display: flex; gap: 6px; }
.exo-top .pas i { width: 36px; height: 5px; border-radius: 99px; background: var(--indigo-10); }
.exo-top .pas i.fait { background: var(--indigo); }
.exo-top .pas i.ici { background: var(--orange); }
.exo-top .compte { justify-self: end; font-size: 14px; color: var(--indigo-70); }
@media (hover: hover) and (pointer: fine) { .exo-top .fermer:hover { background: var(--indigo-10); } }

.exo { max-width: 760px; margin: 0 auto; padding: 12px 16px 72px; }
.exo h1 { font-size: clamp(30px, 3.4vw, 42px); margin-top: 2px; }
.situation {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center;
  margin: 26px 0 30px; padding: 14px; background: var(--blanc); border-radius: var(--r-lg);
}
.situation img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); }
.situation p { font-size: 16px; padding-right: 10px; }
.enonce { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 26px); line-height: 1.3; margin-bottom: 18px; }

.choix { list-style: none; display: grid; gap: 10px; }
.choix button {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 16px 18px; border-radius: var(--r-md); background: var(--blanc);
  font-size: 16px; line-height: 1.45;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease, background-color 160ms ease;
}
.choix button:active { transform: scale(0.99); }
.choix .lettre {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--papier); font-weight: 600; font-size: 14px;
  transition: background-color 160ms ease, color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .choix button:not([disabled]):hover { box-shadow: inset 0 0 0 1.5px var(--indigo-10); }
}
.choix button.faux { background: #FDF0EB; }
.choix button.faux .lettre { background: var(--orange); color: var(--blanc); }
.choix button.juste { background: var(--indigo); color: var(--papier); }
.choix button.juste .lettre { background: var(--rose); color: var(--indigo); }
.choix button[disabled] { cursor: default; }
.choix button.eteint { opacity: .45; }

.reponse {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px;
  margin-top: 10px; padding: 18px 20px; border-radius: var(--r-md);
  opacity: 0; transform: translateY(-6px);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.reponse.vu { opacity: 1; transform: none; }
.reponse .ph { font-size: 22px; margin-top: 1px; }
.reponse strong { display: block; font-weight: 600; margin-bottom: 2px; }
.reponse.faux { background: #FDF0EB; }
.reponse.faux .ph { color: var(--orange); }
.reponse.juste { background: var(--rose-clair); }
.reponse.juste .ph { color: var(--indigo); }

.suite { display: flex; justify-content: flex-end; margin-top: 26px; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); }
.suite.vu { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- téléphone ---------- */
@media (max-width: 900px) {
  .accueil { grid-template-columns: 1fr; padding-top: 8px; }
  .reprendre { position: static; }
  .lecon-ecran { grid-template-columns: 1fr; }
  .plan { position: static; height: auto; padding: 12px 16px; }
  .plan .module-titre, .plan ol { display: none; }
  .plan .retour { align-self: flex-start; }
}
@media (max-width: 600px) {
  .top .logo { height: 28px; }
  .me .nom { display: none; }
  .ligne { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 16px; }
  .ligne .num { font-size: 24px; }
  .parcours-tete { flex-direction: column; align-items: flex-start; gap: 8px; }
  .situation { grid-template-columns: 1fr; }
  .situation img { aspect-ratio: 16 / 9; }
  .situation p { padding: 0 6px 6px; }
  .exo-top .pas i { width: 20px; }
  .fil .pas i { width: 18px; }
  .formatrice .role { display: none; }
  .nav-bas .btn-fantome span { display: none; }
  .video .legende { display: none; }
  .video button span { width: 64px; height: 64px; font-size: 26px; }
  .retenir { padding: 18px; gap: 12px; }
  .retenir p { font-size: 17px; }
  .licka { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .licka .avatar, .licka .avatar img { width: 44px; height: 44px; }
  .licka .bulle { font-size: 16px; padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reponse, .suite { transform: none !important; }
  .licka .avatar, .licka .qui, .licka .bulle { transition: opacity 200ms ease !important; transform: none !important; }
}
