/* Formation OMSC — couleurs de Morin Sécurité civile */
:root {
  --navy: #0B1F3A;
  --navy-2: #13294B;
  --navy-3: #1F3A63;
  --orange: #F26B1D;
  --orange-dark: #D9560C;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --text: #0B1F3A;
  --muted: #5A6A80;
  --line: #E1E6EE;
  --ok: #1E8E5A;
  --ko: #C0392B;
  --bleu-pale: #EAF1FB;
  --orange-pale: #FDF0E7;
  --radius: 14px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px 20px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--orange); }
.topbar-symbole { width: 34px; height: 34px; }
.logos { background: #fff; border-radius: 12px; padding: 8px 16px; display: flex; }
.logos img { height: 64px; width: auto; }
.topbar-titre { min-width: 0; }
.topbar-muni { font-size: 22px; font-weight: 700; line-height: 1.2; }
.topbar-nom { font-size: 18px; font-weight: 500; color: #FFD2B5; margin-top: 2px; }
.topbar-boutons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.lien-clair { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.lien-clair:hover { background: rgba(255,255,255,.12); }

.vue { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.pied { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: #fff; }
.pied img { height: 48px; }

/* ---------- Cartes et texte ---------- */
.carte { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 3px rgba(11,31,58,.08); margin-bottom: 16px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 21px; margin: 28px 0 8px; color: var(--navy-3); }
h3 { font-size: 17px; margin: 22px 0 6px; color: var(--navy-3); }
.surtitre { color: var(--orange-dark); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 4px; }
.petit { color: var(--muted); font-size: 14px; }
.erreur { color: var(--ko); background: #FBEBEB; padding: 10px 14px; border-radius: 10px; }
.succes { color: var(--ok); font-weight: 600; }
.ok { color: var(--ok); } .ko { color: var(--ko); }

.btn { display: inline-block; background: var(--orange); color: #fff; border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--orange-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.secondaire { background: #fff; color: var(--navy); border: 2px solid var(--line); }
.btn.secondaire:hover { border-color: var(--navy-3); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; }

/* ---------- Connexion ---------- */
.connexion { max-width: 460px; margin: 24px auto; text-align: center; }
.logo-connexion { width: 220px; max-width: 70%; }
.connexion form { display: grid; gap: 10px; text-align: left; margin: 20px 0 8px; }
.connexion label { font-weight: 600; }
.connexion input { padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.connexion input:focus { outline: none; border-color: var(--orange); }

/* ---------- Accueil ---------- */
.profil { background: var(--bleu-pale); padding: 10px 14px; border-radius: 10px; font-size: 15px; }
.barre-prog { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 16px 0 6px; }
.barre-prog span { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .4s; }
.modules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.module button { width: 100%; display: flex; align-items: center; gap: 14px; background: #fff; border: 2px solid transparent; border-radius: 12px; padding: 12px 16px; text-align: left; cursor: pointer; }
.module.ouvert button { border-color: var(--orange); }
.module.ferme button { opacity: .55; cursor: not-allowed; }
.module .num { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 700; }
.module.fait .num { background: var(--ok); color: #fff; }
.module.ouvert .num { background: var(--orange); color: #fff; }
.module .txt { display: grid; }
.module .titre { font-weight: 600; }
.module .meta { color: var(--muted); font-size: 14px; }

/* ---------- Contenu des modules ---------- */
.contenu ul { padding-left: 22px; }
.contenu li { margin: 4px 0; }
ul.coches { list-style: none; padding-left: 0; }
ul.coches li { padding-left: 28px; position: relative; }
ul.coches li::before { content: "☐"; position: absolute; left: 2px; color: var(--orange-dark); }
ul.nefait { list-style: none; padding-left: 0; }
ul.nefait li { padding-left: 28px; position: relative; color: var(--ko); }
ul.nefait li::before { content: "✗"; position: absolute; left: 4px; }
figure { margin: 20px 0; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 8px; }
figure.petite img { max-width: 320px; }
figcaption { color: var(--muted); font-size: 14px; font-style: italic; margin-top: 6px; }
.encadre { background: var(--orange-pale); border-left: 5px solid var(--orange); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 18px 0; }
.encadre p { margin: 4px 0 0; }
.encadre-titre { color: var(--orange-dark); }
.tableau { overflow-x: auto; margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { background: var(--navy); color: #fff; text-align: left; padding: 8px 10px; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.colore { color: #fff; font-weight: 700; border-bottom: 2px solid #fff; width: 26%; }
td.cle { font-weight: 600; width: 34%; background: var(--bleu-pale); }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 14px 0; }
.role { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.role h3 { margin: 0 0 6px; font-size: 16px; }
.role p { margin: 4px 0; }
.role.moi { border: 2px solid var(--orange); background: var(--orange-pale); }
.etiquette { background: var(--orange); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; vertical-align: middle; }
.nefait-court { color: var(--ko); font-size: 14px; }

/* ---------- Narration ---------- */
.narration { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.narration p { margin: 2px 0 0; }
.narration.a-choisir { border: 2px solid var(--orange); }
.bascule { display: inline-flex; border: 2px solid var(--navy); border-radius: 12px; overflow: hidden; }
.bascule button { border: 0; background: #fff; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.bascule button + button { border-left: 2px solid var(--navy); }
.bascule button.actif { background: var(--navy); color: #fff; }
.icone-narration { border: 2px solid var(--line); background: #fff; border-radius: 999px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; margin-right: 8px; vertical-align: middle; }
.icone-narration.on { border-color: var(--orange); background: var(--orange-pale); }

/* ---------- Présentation page par page ---------- */
.diapo { min-height: 62vh; display: flex; flex-direction: column; }
.diapo-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.compteur { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.points { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 18px; }
.point { width: 22px; height: 6px; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; padding: 0; }
.point.vu { background: #F7B48C; }
.point.actif { background: var(--orange); }
.diapo h1 { font-size: 28px; color: var(--navy); }
.diapo-corps { flex: 1; font-size: 18px; }
.diapo-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.diapo-nav .btn:disabled { opacity: .35; cursor: default; }
figure.large img { max-width: 100%; border-radius: 12px; box-shadow: 0 4px 18px rgba(11,31,58,.18); }
.cta { text-align: center; margin: 24px 0 8px; }
.btn.grand { font-size: 19px; padding: 16px 30px; border-radius: 14px; }

/* ---------- Profil et questions ---------- */
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
legend { font-weight: 700; padding: 0 6px; }
.choix { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.choix:hover { background: var(--bg); }
.choix input { margin-top: 5px; accent-color: var(--orange); width: 18px; height: 18px; flex: none; }
.choix input:disabled + span { opacity: .4; }
.confid { margin: 8px 0 16px; }
.question legend { display: flex; gap: 10px; }
.qn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 14px; }
.corrections { padding-left: 0; list-style: none; }
.corrections li { border-left: 5px solid var(--line); padding: 8px 14px; margin: 10px 0; background: var(--bg); border-radius: 0 10px 10px 0; }
.corrections li.bon { border-color: var(--ok); }
.corrections li.faux { border-color: var(--ko); }
.corrections .mauvaise { color: var(--ko); font-weight: 600; }
.corrections .bonne { color: var(--ok); font-weight: 600; }
.corrections .mauvaise::before { content: "✗ "; }
.corrections .bonne::before { content: "✓ "; }
.corrections .q { font-weight: 600; margin: 0 0 4px; }
.corrections p { margin: 2px 0; }
.fin { text-align: center; }
.fin .actions { justify-content: center; }
.symbole-fin { width: 90px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .carte { padding: 18px 16px; }
  h1 { font-size: 22px; }
  .pied span { display: none; }
  .topbar { grid-template-columns: 1fr auto; gap: 10px; padding: 10px 12px; }
  .topbar .logos { grid-column: 2; grid-row: 1; padding: 5px 8px; }
  .logos img { height: 42px; }
  .topbar-boutons { grid-column: 1 / -1; justify-content: flex-start; }
  .topbar-muni { font-size: 17px; }
  .topbar-nom { font-size: 15px; }
  .diapo h1 { font-size: 22px; }
  .diapo-corps { font-size: 16px; }
}
