:root {
  --fond: #fafaf9;
  --carte: #ffffff;
  --texte: #1c1917;
  --doux: #57534e;
  --ligne: #e7e5e4;
  --accent: #1d4ed8;
  --vu: #15803d;
  --alerte: #b91c1c;
  --rayon: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121110;
    --carte: #1c1b19;
    --texte: #f5f5f4;
    --doux: #a8a29e;
    --ligne: #33302d;
    --accent: #60a5fa;
    --vu: #4ade80;
    --alerte: #f87171;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.25; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .6em; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin: 1.2em 0 .4em; }

.haut {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--ligne); background: var(--carte);
}
.marque { font-weight: 700; color: var(--texte); text-decoration: none; }
.deconnexion { margin: 0; }

.page { max-width: 820px; margin: 0 auto; padding: 24px 16px 64px; }
.page.etroite { max-width: 460px; padding-top: 48px; }
.page.large { max-width: 1200px; }

.carte {
  display: block; background: var(--carte); border: 1px solid var(--ligne);
  border-radius: var(--rayon); padding: 20px;
}
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cours-carte { color: var(--texte); text-decoration: none; }
.cours-carte:hover { border-color: var(--accent); }
.cours-carte h2 { margin-top: 0; }
.meta, .note, .fil { color: var(--doux); font-size: .9rem; }
.intro { color: var(--doux); }
.progression:not(:empty)::before { content: " · "; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--ligne); background: var(--fond); color: var(--texte);
}
.bouton {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 18px; margin-top: 14px; border-radius: 8px; border: 1px solid var(--texte);
  background: var(--texte); color: var(--fond); text-decoration: none;
}
.bouton.secondaire { background: transparent; color: var(--texte); }
.bouton.secondaire.fait { border-color: var(--vu); color: var(--vu); }
.lien { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.alerte { color: var(--alerte); font-weight: 600; }
.succes { color: var(--vu); font-weight: 600; }

.lecons { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--carte); }
.lecons li + li { border-top: 1px solid var(--ligne); }
.lecons a { display: flex; align-items: baseline; gap: 10px; padding: 11px 14px; color: var(--texte); text-decoration: none; }
.lecons a:hover { background: var(--fond); }
.titre-lecon { flex: 1; min-width: 0; }
.duree { color: var(--doux); font-size: .85rem; white-space: nowrap; }
.coche {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--ligne); position: relative; top: 2px;
}
li.vu .coche { background: var(--vu); border-color: var(--vu); }
.lecons.compact a { padding: 7px 10px; font-size: .9rem; }
.lecons li.actuelle a { background: var(--fond); font-weight: 600; }

.lecon-grille { display: grid; gap: 28px; }
@media (min-width: 960px) {
  .lecon-grille { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .menu-cours { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
}
.menu-cours summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--rayon); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ressources { padding-left: 20px; }
.ressources li { margin: 4px 0; }
.suite { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ligne); }
.suite a { max-width: 48%; text-decoration: none; }
.suite .suivante { text-align: right; margin-left: auto; }

.admin-outils { display: grid; gap: 12px; margin: 16px 0; }
.ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ligne input { flex: 1 1 200px; width: auto; }
.ligne .bouton { margin-top: 0; }
.membres { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
.membres th, .membres td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.membres form { margin: 0; }
.membres tr.inactif td { color: var(--doux); text-decoration: line-through; }
.membres tr.inactif td:last-child { text-decoration: none; }
.progression.seule::before { content: none; }
