/* Campus FSAS : charte Sport Avenir et Santé (orange #e46e0c) */
:root {
  --fond: #f1f2ee;
  --surface: #ffffff;
  --encre: #17202a;
  --gris: #59636d;
  --ligne: #d6dad2;
  --ligne-douce: #e7e9e3;
  --orange: #e46e0c;
  --orange-texte: #a94d04;
  --orange-pale: #fcecdf;
  --vert: #2e7d5a;
  --vert-pale: #e2f1e9;
  --alerte: #a94d04;
  --titre: "Archivo", "Arial Narrow", Arial, sans-serif;
  --texte: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, sans-serif;
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 400 1rem/1.6 var(--texte);
}
img, iframe { max-width: 100%; }
a { color: var(--encre); text-decoration-color: var(--orange); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--orange-texte); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--titre); line-height: 1.1; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-stretch: 112%; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; font-stretch: 108%; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--gris); }
.petit { font-size: .875rem; }

/* ---------- Structure ---------- */
.barre {
  background: var(--encre); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.barre-in { max-width: 1160px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.marque { color: #fff; text-decoration: none; font: 800 1.2rem/1 var(--titre); font-stretch: 115%; display: flex; align-items: center; gap: .6rem; }
.marque i { width: 12px; height: 26px; background: var(--orange); border-radius: 2px; transform: skewX(-14deg); display: inline-block; }
.nav { display: flex; gap: 1.1rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: #d7dce1; text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav a.actif { color: #fff; }
.nav a.actif { box-shadow: inset 0 -2px var(--orange); }
.nav .compteur { background: var(--orange); color: var(--encre); border-radius: 99px; font-size: .75rem; font-weight: 700; padding: 0 .45em; margin-left: .25em; }
.nav form { margin: 0; }
.nav button { background: none; border: 0; color: #d7dce1; font: inherit; font-size: .95rem; cursor: pointer; padding: 0; }
.nav button:hover { color: #fff; }

main { max-width: 1160px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.etroit { max-width: 720px; margin-inline: auto; }
.pied { border-top: 1px solid var(--ligne); color: var(--gris); font-size: .8rem; padding: 1.5rem 1.25rem 2.5rem; text-align: center; line-height: 1.5; }
.pied strong { color: var(--encre); }

/* ---------- Composants ---------- */
.bloc { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); padding: 1.5rem; margin-bottom: 1.25rem; }
.bloc > h2:first-child, .bloc > h3:first-child { margin-top: 0; }
.grille { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.deux { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .deux { grid-template-columns: 1.6fr 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--orange); color: var(--encre); border: 2px solid var(--orange);
  font: 700 1rem/1.2 var(--texte); padding: .75em 1.3em; border-radius: var(--r);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #cc6109; border-color: #cc6109; color: var(--encre); }
.btn.second { background: transparent; border-color: var(--encre); }
.btn.second:hover { background: var(--encre); color: #fff; }
.btn.petit { padding: .45em .9em; font-size: .875rem; }
.btn.lien { background: none; border: 0; padding: 0; color: var(--gris); text-decoration: underline; font-weight: 400; }
.btn.danger { background: transparent; border-color: var(--alerte); color: var(--alerte); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.etiquette { display: inline-block; font-size: .8rem; font-weight: 700; padding: .15em .6em; border-radius: 3px; background: var(--ligne-douce); color: var(--encre); }
.etiquette.ok { background: var(--vert-pale); color: var(--vert); }
.etiquette.att { background: var(--orange-pale); color: var(--orange-texte); }
.etiquette.off { background: #eceff1; color: var(--gris); }

.flash { border-left: 5px solid var(--vert); background: var(--vert-pale); padding: .9rem 1.1rem; border-radius: var(--r); margin-bottom: 1.5rem; }
.flash.erreur { border-color: var(--alerte); background: var(--orange-pale); }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 700; margin: 0 0 .3rem; font-size: .95rem; }
.champ { margin-bottom: 1.1rem; }
.champ small { display: block; color: var(--gris); font-weight: 400; margin-top: .25rem; font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: .65em .8em; border: 1.5px solid var(--ligne); border-radius: var(--r); background: #fff; color: var(--encre);
}
input:focus, select:focus, textarea:focus { border-color: var(--encre); outline: none; box-shadow: 0 0 0 3px var(--orange-pale); }
textarea { min-height: 7rem; resize: vertical; }
.coche { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.coche input { margin-top: .35rem; accent-color: var(--orange); width: 1.1rem; height: 1.1rem; }
.cols { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- Piste de progression (élément signature) ---------- */
.piste { margin: .5rem 0 .25rem; }
.piste-couloir {
  position: relative; height: 22px; border-radius: 11px; overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--pas) - 2px), rgba(23,32,42,.18) calc(var(--pas) - 2px) var(--pas)), var(--ligne-douce);
}
.piste-couloir::after { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1px dashed rgba(23,32,42,.25); }
.piste-avance { position: absolute; inset: 0 auto 0 0; background: var(--orange); border-radius: 11px 0 0 11px; transition: width .6s ease; }
.piste-avance[style*="100%"] { border-radius: 11px; background: var(--vert); }
.piste-legende { display: flex; justify-content: space-between; font-size: .85rem; color: var(--gris); margin-top: .35rem; }
.piste-legende b { color: var(--encre); font-family: var(--titre); font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .piste-avance { transition: none; } }

/* ---------- Catalogue ---------- */
.entete-cat { padding: 1rem 0 2rem; max-width: 760px; }
.entete-cat p { font-size: 1.15rem; color: var(--gris); }
.carte-f { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; }
.carte-f .bande { height: 8px; background: var(--orange); }
.carte-f .corps { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.carte-f h2 { font-size: 1.35rem; }
.carte-f h2 a { text-decoration: none; }
.carte-f .infos { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; color: var(--gris); margin: auto 0 1rem; padding-top: 1rem; }
.carte-f .prix { font: 800 1.4rem/1 var(--titre); }

.fiche-hero { border-bottom: 3px solid var(--encre); padding-bottom: 1.5rem; margin-bottom: 2rem; }
.fiche-hero p { font-size: 1.2rem; color: var(--gris); max-width: 60ch; }
.chiffres { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1.25rem; }
.chiffres div { font-size: .85rem; color: var(--gris); }
.chiffres b { display: block; font: 800 1.6rem/1.1 var(--titre); color: var(--encre); }
.liste-obj { padding-left: 1.2rem; }
.liste-obj li { margin-bottom: .4rem; }
.liste-obj li::marker { color: var(--orange); }
.info-q dt { font-weight: 700; margin-top: 1rem; }
.info-q dd { margin: .2rem 0 0; color: var(--gris); }
.onglets-insc { display: flex; gap: .5rem; margin-bottom: 1rem; }
.onglets-insc button { flex: 1; font: 700 .95rem var(--texte); padding: .7em; border: 2px solid var(--ligne); background: #fff; border-radius: var(--r); cursor: pointer; }
.onglets-insc button[aria-selected=true] { border-color: var(--encre); background: var(--encre); color: #fff; }

/* ---------- Programme ---------- */
.programme { list-style: none; padding: 0; margin: 0; }
.programme > li { border-top: 1px solid var(--ligne-douce); padding: .9rem 0; }
.programme > li:first-child { border-top: 0; }
.programme .mod { font-family: var(--titre); font-weight: 800; font-size: 1.05rem; display: flex; gap: .6rem; align-items: baseline; }
.programme .mod span { color: var(--orange-texte); font-size: .85rem; min-width: 2.2rem; }
.programme ol { list-style: none; padding: 0 0 0 2.8rem; margin: .4rem 0 0; }
.programme ol li { display: flex; gap: .6rem; align-items: center; padding: .3rem 0; font-size: .95rem; }
.puce { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--ligne); display: grid; place-items: center; font-size: .7rem; }
.puce.faite { background: var(--vert); border-color: var(--vert); color: #fff; }
.puce.faite::before { content: "✓"; }
.puce.courante { border-color: var(--orange); background: var(--orange-pale); }
.type { font-size: .78rem; color: var(--gris); margin-left: auto; white-space: nowrap; }

/* ---------- Leçon ---------- */
.lecon-grille { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 980px) { .lecon-grille { grid-template-columns: 290px 1fr; } }
.plan-lat { font-size: .92rem; }
.plan-lat details { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); padding: .8rem 1rem; }
.plan-lat summary { font-weight: 700; cursor: pointer; }
@media (min-width: 980px) {
  .plan-lat { position: sticky; top: 4.5rem; align-self: start; max-height: calc(100vh - 6rem); overflow: auto; }
  .plan-lat summary { pointer-events: none; list-style: none; }
  .plan-lat summary::-webkit-details-marker { display: none; }
}
.plan-lat h4 { font: 800 .9rem var(--titre); margin: 1rem 0 .3rem; }
.plan-lat ol { list-style: none; padding: 0; margin: 0; }
.plan-lat li a { display: flex; gap: .5rem; align-items: center; padding: .35rem .4rem; text-decoration: none; border-radius: 4px; line-height: 1.3; }
.plan-lat li a:hover { background: var(--fond); }
.plan-lat li a[aria-current] { background: var(--orange-pale); font-weight: 700; }
.fil { font-size: .88rem; color: var(--gris); margin-bottom: .5rem; }
.contenu-lecon { font-size: 1.07rem; line-height: 1.7; max-width: 70ch; }
.contenu-lecon h3 { margin-top: 1.6em; }
.contenu-lecon ul { padding-left: 1.3rem; }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--encre); border-radius: var(--r); overflow: hidden; margin-bottom: 1.5rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf-cadre { width: 100%; height: 75vh; border: 1px solid var(--ligne); border-radius: var(--r); background: #fff; }
.nav-lecon { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--ligne); margin-top: 2rem; padding-top: 1.5rem; }
.apercu { background: var(--encre); color: #fff; padding: .6rem 1rem; border-radius: var(--r); margin-bottom: 1rem; font-size: .9rem; }

/* Quiz */
.question { border-top: 1px solid var(--ligne-douce); padding: 1.2rem 0; }
.question:first-of-type { border-top: 0; }
.question legend { font-weight: 700; margin-bottom: .6rem; font-size: 1.05rem; float: left; width: 100%; padding: 0; }
.question legend + * { clear: both; }
.question .num { font-family: var(--titre); color: var(--orange-texte); margin-right: .4rem; }
.choix { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .8rem; border: 1.5px solid var(--ligne); border-radius: var(--r); margin-bottom: .5rem; font-weight: 400; cursor: pointer; background: #fff; }
.choix:hover { border-color: var(--encre); }
.choix input { margin-top: .3rem; accent-color: var(--orange); }
.choix.bon { border-color: var(--vert); background: var(--vert-pale); }
.choix.faux { border-color: var(--alerte); background: var(--orange-pale); }
.resultat { border: 3px solid var(--encre); border-radius: var(--r); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.resultat .score { font: 800 3rem/1 var(--titre); font-stretch: 115%; }
.resultat.ok { border-color: var(--vert); }
.resultat.ok .score { color: var(--vert); }
.explication { font-size: .9rem; color: var(--gris); border-left: 3px solid var(--ligne); padding-left: .8rem; margin-top: .4rem; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-weight: 700; color: var(--gris); font-size: .82rem; border-bottom: 2px solid var(--encre); padding: .5rem .6rem; white-space: nowrap; }
td { border-bottom: 1px solid var(--ligne-douce); padding: .6rem; vertical-align: top; }
tr:hover td { background: #fafbf9; }
.nb { text-align: right; font-variant-numeric: tabular-nums; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); padding: 1rem 1.2rem; text-decoration: none; display: block; }
.kpi b { display: block; font: 800 2.2rem/1 var(--titre); }
.kpi span { color: var(--gris); font-size: .9rem; }
.kpi.chaud { border-color: var(--orange); border-width: 2px; }
.kpi.chaud b { color: var(--orange-texte); }

.filtres { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtres a { text-decoration: none; padding: .35em .9em; border: 1.5px solid var(--ligne); border-radius: 99px; font-size: .9rem; background: #fff; }
.filtres a.actif { background: var(--encre); color: #fff; border-color: var(--encre); }

/* Éditeur de programme */
.module-ed { border: 1px solid var(--ligne); border-radius: var(--r); margin-bottom: 1rem; background: #fff; }
.module-ed > header { display: flex; gap: .5rem; align-items: center; padding: .7rem 1rem; background: var(--fond); border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.module-ed > header form.renommer { flex: 1; display: flex; gap: .5rem; min-width: 220px; }
.module-ed > header input { font-weight: 700; }
.lecon-ed { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; border-bottom: 1px solid var(--ligne-douce); }
.lecon-ed a.titre { flex: 1; text-decoration: none; }
.mini { display: inline-flex; gap: .2rem; }
.mini button { background: none; border: 1px solid var(--ligne); border-radius: 4px; cursor: pointer; width: 28px; height: 28px; font-size: .8rem; color: var(--gris); }
.mini button:hover { border-color: var(--encre); color: var(--encre); }
.ajout-lecon { display: flex; gap: .5rem; padding: .7rem 1rem; flex-wrap: wrap; }
.ajout-lecon input { flex: 2; min-width: 180px; }
.ajout-lecon select { flex: 1; min-width: 120px; }

/* Messagerie */
.fil-msg { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.5rem; }
.msg { max-width: 80%; padding: .8rem 1rem; border-radius: var(--r); background: #fff; border: 1px solid var(--ligne); }
.msg.moi { align-self: flex-end; background: var(--encre); color: #fff; border-color: var(--encre); }
.msg .meta { font-size: .78rem; opacity: .7; margin-bottom: .2rem; }
.msg p:last-child { margin: 0; }

.vide { text-align: center; padding: 2.5rem 1rem; color: var(--gris); }
.vide .btn { margin-top: .5rem; }

@media (max-width: 700px) {
  .barre-in { flex-wrap: wrap; gap: .5rem 1rem; }
  .nav { margin-left: 0; width: 100%; gap: .9rem; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .nav a, .nav button { white-space: nowrap; }
  main { padding-top: 1.25rem; }
  .bloc { padding: 1.1rem; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.programme .duree-mod { margin-left: auto; font: 400 .82rem var(--texte); color: var(--gris); white-space: nowrap; }

/* Vidéo de présentation de module : reprend le bloc incliné de la marque comme bouton lecture */
.presentation { margin: .6rem 0 .2rem 2.8rem; }
.presentation-lancer {
  display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 3.2rem; text-align: left;
  background: var(--orange-pale); border: 1.5px solid transparent; border-radius: var(--r);
  padding: .55rem .9rem .55rem .7rem; cursor: pointer; font: inherit; color: var(--encre);
}
.presentation-lancer:hover { border-color: var(--orange); }
.presentation-lancer .lecture {
  flex: none; position: relative; width: 2.1rem; height: 2.1rem;
  background: var(--orange); border-radius: 3px; transform: skewX(-14deg);
}
.presentation-lancer .lecture::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%) skewX(14deg);
  border-style: solid; border-width: .45rem 0 .45rem .75rem; border-color: transparent transparent transparent var(--encre);
}
.presentation-texte { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.presentation-texte strong { font-size: .95rem; }
.presentation-texte span { font-size: .85rem; color: var(--gris); }
.presentation.ouverte .video { margin-bottom: .6rem; }
@media (max-width: 560px) { .presentation { margin-left: 0; } }

/* Éditeur : réglage de la vidéo de présentation d'un module */
.presentation-ed { border-bottom: 1px solid var(--ligne-douce); padding: .55rem 1rem; }
.presentation-ed summary { cursor: pointer; font-size: .9rem; display: flex; gap: .5rem; align-items: center; }
.presentation-ed[open] summary { margin-bottom: .8rem; }
.presentation-ed .cols { grid-template-columns: 1fr 7rem; }
.assistance dt { font-weight: 700; margin-top: .8rem; font-size: .95rem; }
.assistance dt:first-child { margin-top: 0; }
.assistance dd { margin: .15rem 0 0; color: var(--gris); font-size: .95rem; }
.echelle { display: flex; gap: .4rem; flex-wrap: wrap; }
.echelle label { margin: 0; }
.echelle input { position: absolute; opacity: 0; }
.echelle span { display: grid; place-items: center; min-width: 3rem; height: 3rem; padding: 0 .8rem; border: 1.5px solid var(--ligne); border-radius: var(--r); background: #fff; font-weight: 700; cursor: pointer; }
.echelle input:checked + span { background: var(--encre); border-color: var(--encre); color: #fff; }
.echelle input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.echelle-legende { display: flex; justify-content: space-between; font-size: .8rem; color: var(--gris); max-width: 17rem; margin-top: .3rem; }
.invitation { border: 2px solid var(--orange); background: var(--orange-pale); border-radius: var(--r); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.invitation p { margin: 0 0 .6rem; }
.barres td { vertical-align: middle; }
