/* Tokens du site iadesiles.com (docs/design-system.md) : fond presque noir, turquoise, coins arrondis. Mobile d'abord. */
:root {
  --fond: #07090c; --carte: #0f1216; --texte: #f5f5f5; --gris: #9ca3af;
  --accent: #2dd4bf; --sur-accent: #07090c; --trait: rgb(255 255 255 / .08); --trait-fort: rgb(255 255 255 / .38);
  --teinte: rgb(45 212 191 / .12); --erreur: #ff8a84; --reflet: inset 0 1px 0 rgb(255 255 255 / .06);
  color-scheme: dark;
}
/* Thème clair : turquoise assombri pour tenir le contraste AA sur fond clair, texte blanc dessus. */
:root[data-theme="light"] {
  --fond: #f8fafc; --carte: #ffffff; --texte: #0b1015; --gris: #4b5563;
  --accent: #0f766e; --sur-accent: #ffffff; --trait: rgb(0 0 0 / .1); --trait-fort: rgb(0 0 0 / .4);
  --teinte: rgb(15 118 110 / .1); --erreur: #c4231d; --reflet: inset 0 1px 0 rgb(255 255 255 / .8);
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte);
  background: radial-gradient(600px 360px at 50% -120px, var(--teinte), transparent 70%), var(--fond);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
main { max-width: 560px; margin: 0 auto; padding: 0 16px 56px; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
em { font-style: normal; color: var(--accent); }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 20px; box-shadow: var(--reflet); }

.entete { max-width: 560px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.theme { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: transparent; border: 1px solid var(--trait-fort); display: grid; place-items: center; cursor: pointer; }
.theme svg { width: 20px; height: 20px; stroke-width: 8; }
:root[data-theme="light"] .lune, :root:not([data-theme="light"]) .soleil { display: none; }
svg { stroke: var(--accent); fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Porte */
.coucou { display: flex; gap: 12px; align-items: center; margin-top: 16px; color: var(--gris); }
.coucou b { color: var(--texte); font-weight: 600; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
h1 { font-size: 36px; line-height: 1.1; margin: 16px 0 10px; }
.sous { color: var(--gris); font-size: 18px; line-height: 1.5; margin-bottom: 24px; }
form { padding: 20px; display: grid; gap: 6px; }
label { font-weight: 500; font-size: 15px; }
input:not([type="checkbox"]) {
  font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--trait-fort); border-radius: 12px;
  min-height: 48px; padding: 0 14px; margin-bottom: 10px; width: 100%;
}
input:focus { border-color: var(--accent); outline: none; }
.piege { position: absolute; left: -9999px; }
.case { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; color: var(--gris); font-size: 14px; line-height: 1.45; padding: 6px 0 10px; cursor: pointer; }
.case input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: none; }
button { font: inherit; cursor: pointer; }
.principal, .copier {
  font-weight: 600; font-size: 17px; min-height: 52px; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--sur-accent); padding: 0 18px;
}
.principal:disabled { opacity: .6; }
.erreur { color: var(--erreur); font-weight: 600; }
.mentions { color: var(--gris); font-size: 13px; text-align: center; margin-top: 6px; }
.titre-programme { font-size: 15px; color: var(--gris); font-weight: 500; letter-spacing: 0; margin: 32px 0 8px; }
.programme { list-style: none; display: grid; }
.programme li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.programme b { width: 28px; height: 28px; border-radius: 50%; background: var(--teinte); color: var(--accent); display: grid; place-items: center; font-size: 14px; font-weight: 600; flex: none; }

/* Carnet : en-tête, progression, sommaire des 7 jours */
.haut { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; }
.salut { font-weight: 600; font-size: 18px; }
.progression { color: var(--gris); font-size: 14px; }
.barre { height: 4px; border-radius: 4px; background: var(--trait); margin: 10px 0 14px; overflow: hidden; }
.barre span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .4s; }
.sommaire { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 28px; }
.sommaire a {
  display: grid; place-items: center; min-height: 44px; border-radius: 12px; text-decoration: none;
  color: var(--gris); font-size: 14px; font-weight: 600; border: 1px solid var(--trait); position: relative;
}
.sommaire a.fait { color: var(--accent); border-color: var(--accent); }
.sommaire a.fait::after { content: "✓"; position: absolute; top: -7px; right: -4px; font-size: 11px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--sur-accent); display: grid; place-items: center; }
.sommaire a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }

/* Une leçon */
.numero { color: var(--accent); font-size: 14px; font-weight: 600; }
.fiche h2 { font-size: 30px; line-height: 1.15; margin: 4px 0 12px; outline: none; }
.pourquoi { font-size: 17px; color: var(--gris); margin-bottom: 20px; }
h3 { font-size: 16px; }

.video { margin-bottom: 28px; }
.video video { display: block; width: 100%; max-height: 70vh; border-radius: 20px; background: #000; }
.video-vide {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px;
  border: 1px dashed var(--trait-fort); color: var(--gris); font-size: 14px; line-height: 1.4;
}
.video-vide img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.video-vide b { display: block; color: var(--texte); font-size: 15px; font-weight: 600; }

.recap { padding: 18px 20px; margin-bottom: 28px; }
.recap ol { margin: 8px 0 0 22px; display: grid; gap: 4px; }
.recap li::marker { color: var(--accent); font-weight: 600; }
.avant { display: flex; gap: 12px; align-items: center; color: var(--gris); margin-bottom: 16px; }
.avant svg { width: 28px; height: 28px; }
.consigne { margin-bottom: 10px; }
.bulle { background: var(--carte); border: 1px solid var(--trait); box-shadow: var(--reflet); border-radius: 20px; padding: 18px; margin-bottom: 12px; }
.bulle p { font-size: 18px; font-weight: 500; line-height: 1.5; margin-bottom: 14px; }
.bulle p:only-child { margin-bottom: 0; }
.trou { color: var(--accent); background: var(--teinte); border-radius: 6px; padding: 0 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.copier { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; }
.copier svg { width: 20px; height: 20px; stroke: var(--sur-accent); stroke-width: 9; }
.ensuite { margin: 4px 0 28px; }
.ensuite > p { color: var(--gris); font-size: 14px; margin-bottom: 8px; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces .copier { width: auto; background: transparent; color: var(--texte); border: 1px solid var(--trait-fort); font-size: 15px; font-weight: 500; min-height: 44px; padding: 8px 14px; justify-content: flex-start; text-align: left; line-height: 1.35; }
.puces .copier svg { stroke: var(--accent); width: 16px; height: 16px; }
.exercice { padding: 18px 20px; margin: 16px 0 20px; border-color: var(--accent); }
.exercice h3 { color: var(--accent); margin-bottom: 4px; }
.teaser { color: var(--gris); border-left: 2px solid var(--accent); padding-left: 14px; margin-bottom: 20px; }

/* Explications repliées */
.plus { border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); margin-bottom: 20px; }
.plus summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.plus summary::-webkit-details-marker { display: none; }
.plus summary::after { content: "+"; color: var(--accent); font-size: 22px; font-weight: 400; }
.plus[open] summary::after { content: "–"; }
.plus > :not(summary) { margin-bottom: 16px; }
.points h3 { margin-top: 12px; }
.points h3:first-child { margin-top: 0; }
.points p, .apres, .regle p { color: var(--gris); }
.points b { color: var(--texte); font-weight: 600; }
.lien a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.regle h3 { margin-bottom: 2px; }

.coche-jour {
  display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 0 18px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--trait-fort); font-weight: 600; font-size: 16px;
}
.coche-jour input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.coche-jour:has(input:checked) { border-color: var(--accent); background: var(--teinte); color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pager a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 14px; text-decoration: none; font-weight: 600; }
.prec { color: var(--gris); }
.suiv { margin-left: auto; background: var(--accent); color: var(--sur-accent); }

.suite { padding: 20px; margin-top: 32px; display: grid; gap: 8px; justify-items: start; }
.suite h2 { font-size: 24px; }
.suite p { color: var(--gris); }
.suite p:first-of-type { color: var(--texte); }
.badge { background: var(--teinte); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.fin { color: var(--texte) !important; margin-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); transition: transform .25s;
  background: var(--accent); color: var(--sur-accent); font-weight: 600; border-radius: 999px; padding: 12px 20px;
  max-width: calc(100% - 32px); text-align: center; z-index: 2; visibility: hidden;
}
.toast.vu { transform: translate(-50%, 0); visibility: visible; }
@media (prefers-reduced-motion: reduce) { .toast, .barre span { transition: none; } }

/* Page confidentialité */
.texte-legal h1 { margin-top: 8px; }
.texte-legal h2 { font-size: 20px; margin: 22px 0 6px; }
.texte-legal p { color: var(--gris); }
