/* Formation YottaSec Haïti : direction B (clair, chaleureux) + C (mises en situation en conversation). Feuille autonome. */
:root {
  --bg: #fbf8f1; --card: #ffffff; --soft: #f3eee2; --line: #e4ddcd; --line-strong: #cfc6b2;
  --ink: #1b2234; --muted: #5c6477;
  --blue: #1f4fbf; --blue-dark: #16398f; --blue-tint: #e8eefc;
  --red: #d21034; --red-tint: #fdecee; --green: #1f8a52; --green-tint: #e6f5ec; --amber-tint: #fff3d6; --amber: #8a5a00;
  --radius: 14px; --max: 1040px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip:focus { left: 8px; }
.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 32px, 760px); }
.hide { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.01em; }
h2 { font-size: clamp(23px, 3.2vw, 30px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }

/* Bandeau de brouillon (créole) */
.draft-banner { background: var(--amber-tint); color: var(--amber); text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid #f0d58f; }

/* En-tête */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand img { width: 170px; }
.nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { border-bottom-color: var(--blue); }
.nav a.lang-switch { font-size: 13px; padding: 4px 10px; border: 1.5px solid var(--line-strong); border-radius: 8px; }

/* Boutons */
.btn { display: inline-block; text-decoration: none; font: inherit; font-weight: 700; font-size: 16px; padding: 13px 24px; border-radius: 999px; background: var(--blue); color: #fff; border: 2px solid var(--blue); cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn.ghost:hover { background: var(--blue-tint); color: var(--blue-dark); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

/* Accueil de la formation */
.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(32px, 5vw, 56px); background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; color: var(--blue); font-weight: 700; margin: 0 0 12px; }
.lede { font-size: clamp(18px, 2.1vw, 21px); color: var(--muted); max-width: 62ch; margin: 0 0 22px; }
.pts { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink); font-size: 16px; font-weight: 600; }
.pts li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 8px; }
.soon-note { display: inline-block; margin: 0 0 20px; padding: 6px 14px; border: 1.5px dashed var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 15px; background: #fff; }
section { padding: clamp(32px, 5vw, 60px) 0; }
section.alt { background: var(--soft); border-block: 1px solid var(--line); }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.progress-head h2 { margin: 0 0 8px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 28px; }
.bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .4s; }

.group { margin: 0 0 34px; }
.group-n { text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; color: var(--blue); font-weight: 700; margin: 0 0 4px; }
.group-title { font-size: clamp(21px, 2.6vw, 26px); margin: 0 0 4px; }
.group-text { color: var(--muted); margin: 0 0 14px; }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lesson { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
a.lesson:hover { border-color: var(--blue); transform: translateY(-1px); color: var(--ink); }
.lesson.disabled { opacity: .55; }
.lesson.is-done { border-color: var(--green); background: #fbfefc; }
.lesson-ico { flex: 0 0 52px; width: 52px; height: 52px; color: var(--blue); background: var(--blue-tint); border-radius: 14px; padding: 9px; }
.lesson-ico svg { width: 100%; height: 100%; }
.lesson-body h3 { margin: 0 0 4px; font-size: 19px; }
.lesson-body p { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
.lesson-body .lesson-n { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--blue); font-weight: 700; margin-bottom: 4px; }
.lesson-cta { font-weight: 700; color: var(--blue); }
.lesson-cta::after { content: " →"; }
.lesson.is-done .lesson-cta { color: var(--green); }
.lesson.is-done .lesson-cta::before { content: "✓ "; }
.lesson.is-done .lesson-cta::after { content: ""; }
.badge { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border: 1.5px solid var(--line); border-radius: 99px; color: var(--muted); }
.note { color: var(--muted); font-size: 15px; margin: 18px 0 0; }
.att { margin-top: 22px; }
.team { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.team h2 { margin: 0 0 6px; }
.team p { color: var(--muted); max-width: 640px; margin: 0; }

/* Pied de page */
.site-footer { padding: 26px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }

/* Lecteur de leçon */
.player-wrap { padding: clamp(18px, 4vw, 44px) 0; }
.player { background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: clamp(18px, 3.2vw, 36px); }
.deck-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.deck-bar .dots { display: flex; gap: 5px; flex: 1; }
.deck-bar .dots i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.deck-bar .dots i.done { background: #a9bdf0; }
.deck-bar .dots i.cur { background: var(--blue); }
.deck-bar .count { font-size: 14px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.js .slide { display: none; }
.js .slide.on { display: block; animation: slidein .25s ease; }
@keyframes slidein { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.slide { outline: none; min-height: 300px; }
.slide h1 { font-size: clamp(27px, 4.2vw, 38px); }
.slide h2 { font-size: clamp(23px, 3vw, 30px); margin: 0 0 14px; }
.slide .lede { color: var(--ink); }
.slide .meta { color: var(--blue); font-weight: 700; margin: 0 0 6px; }
.crumbs { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.qlabel { color: var(--blue); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; margin: 0 0 8px; }
.qlive { color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 800; }
.qt { font-size: clamp(19px, 2.4vw, 23px); font-weight: 700; margin: 0 0 16px; display: block; }
.th { font-size: clamp(18px, 2.1vw, 20px); margin: 0 0 14px; }
.th strong { color: var(--blue-dark); }

/* Étapes (théorie) */
.flow { list-style: none; padding: 0; margin: 18px 0; counter-reset: f; display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.flow li { counter-increment: f; background: var(--soft); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; align-content: start; position: relative; }
.flow li::before { content: counter(f); width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -15px; top: 18px; color: var(--blue); font-weight: 800; z-index: 1; }
.flow li:last-child { border-color: var(--red); background: var(--red-tint); }
.flow li:last-child::before { background: var(--red); }
.flow strong { font-size: 16px; line-height: 1.25; }
.flow span { color: var(--muted); font-size: 14.5px; }
.flow.good li:last-child { border-color: var(--line); background: var(--soft); }
.flow.good li:last-child::before { background: var(--blue); }

/* Listes : alertes (!) et bons gestes (✓) */
.signs { padding: 0; list-style: none; display: grid; gap: 10px; margin: 0; }
.signs li { background: var(--amber-tint); border: 1.5px solid #f0d58f; border-radius: 12px; padding: 13px 16px 13px 48px; position: relative; }
.signs li::before { content: "!"; position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; border-radius: 50%; background: #f5b82e; color: #3a2800; font-weight: 800; text-align: center; line-height: 24px; font-size: 14px; }
.signs.do li { background: var(--green-tint); border-color: #b7e0c8; }
.signs.do li::before { content: "✓"; background: var(--green); color: #fff; }

.rule { list-style: none; padding: 0; margin: 0; counter-reset: r; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.rule li { counter-increment: r; background: var(--blue-tint); border: 1.5px solid #c4d3f6; border-radius: 14px; padding: 16px; display: grid; gap: 6px; }
.rule li::before { content: counter(r); width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rule li strong { font-size: 19px; color: var(--blue-dark); }
.rule li span { color: var(--ink); font-size: 16px; }

.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px; }
.remember { background: var(--blue-tint); border-color: #c4d3f6; }
.remember ul { margin: 0; padding-left: 20px; }
.remember li { margin-bottom: 10px; font-size: 19px; }

/* Mises en situation (C) : conversation dans un téléphone, fenêtre d'ordinateur */
.scene-text { font-size: 18px; margin: 0 0 14px; }
.phone { max-width: 360px; margin: 0 auto 12px; background: #eef1f6; border: 3px solid var(--ink); border-radius: 26px; padding: 12px 12px 16px; }
.phone-top { display: flex; align-items: center; gap: 8px; padding: 2px 6px 10px; border-bottom: 1px solid var(--line-strong); margin-bottom: 12px; }
.phone-dot { width: 26px; height: 26px; border-radius: 50%; background: #c9d1e2; flex: 0 0 26px; }
.phone-from { font-size: 14px; font-weight: 700; color: var(--ink); }
.chat { display: flex; }
.bubble { background: #e3f4e8; border-radius: 14px 14px 14px 3px; padding: 11px 13px; font-size: 17px; line-height: 1.45; max-width: 92%; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.scene-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 16px; }
.scene-tags span { background: var(--red-tint); color: #a30d28; border: 1px solid #f3b9c3; border-radius: 99px; padding: 3px 11px; font-size: 14px; font-weight: 700; }
.scene-tags span::before { content: "⚑ "; }
.screen { max-width: 520px; margin: 0 auto 12px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; }
.screen-bar { display: flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; padding: 7px 10px; font-size: 13px; }
.screen-bar i { width: 10px; height: 10px; border-radius: 50%; background: #5c6477; }
.screen-bar i:first-child { background: #d21034; }
.screen-bar span { margin-left: 8px; }
.screen-body { padding: 18px 16px; font-size: 18px; font-weight: 700; color: #a30d28; background: #fff7f8; }
.scene-card { margin: 0 0 16px; padding: 14px 18px; border-left: 5px solid var(--blue); background: var(--blue-tint); border-radius: 0 12px 12px 0; font-size: 18px; }

/* Réponses */
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-tint); }
.opt:disabled { cursor: default; }
.opt .ltr { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--blue-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.opt.right { border-color: var(--green); background: var(--green-tint); }
.opt.right .ltr { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-tint); }
.opt.wrong .ltr { background: var(--red); color: #fff; }
.feedback { display: none; margin-top: 12px; padding: 13px 16px; border-radius: 12px; font-size: 16.5px; }
.feedback.show { display: block; }
.feedback.good { background: var(--green-tint); color: #11603a; border: 1.5px solid #b7e0c8; }
.feedback.bad { background: var(--red-tint); color: #8f0c25; border: 1.5px solid #f3b9c3; }
.gate-hint { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; text-align: right; }

/* Résultat et compteur */
.result { text-align: center; padding: 6px 0; }
.result .cta-row { justify-content: center; }
.ring { --p: 0; width: 140px; height: 140px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; background: radial-gradient(closest-side, #fff 76%, transparent 78% 100%), conic-gradient(var(--blue) calc(var(--p) * 1%), var(--line) 0); }
.ring .pct { font-size: 30px; font-weight: 800; color: var(--ink); }
.result .score { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.result .verdict { font-weight: 600; margin: 0 0 14px; color: var(--muted); }
.result .rv-title { font-size: 17px; margin: 18px 0 8px; color: var(--muted); text-align: left; }
.review { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; text-align: left; }
.review li { position: relative; padding: 10px 12px 10px 40px; border-radius: 10px; background: #fff; border: 1.5px solid var(--line); font-size: 16px; }
.review li::before { position: absolute; left: 13px; top: 10px; font-weight: 800; }
.review li.ok::before { content: "✓"; color: var(--green); }
.review li.ko::before { content: "✗"; color: var(--red); }
.review li.ko { border-color: var(--red); }

/* Commandes */
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1.5px solid var(--line); }
.controls #next { margin-left: auto; }
.audio-ctl { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctl { font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 9px 15px; cursor: pointer; }
.ctl:hover:not(:disabled) { border-color: var(--blue); }
.ctl:disabled { opacity: .4; cursor: default; }
select.ctl { padding-right: 10px; }
#next:disabled { opacity: .45; cursor: not-allowed; transform: none; }
@media (max-width: 760px) {
  .flow { grid-template-columns: 1fr; }
  .flow li:not(:last-child)::after { content: "↓"; right: auto; left: 41px; top: auto; bottom: -17px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .ctl span:not(.ico) { display: none; }
  .controls { gap: 8px; }
  .controls #next { flex: 1 1 100%; margin-left: 0; text-align: center; order: 5; }
}
@media (prefers-reduced-motion: reduce) { .js .slide.on { animation: none; } html { scroll-behavior: auto; } }

/* Attestation */
.lesson-hero { padding: clamp(32px, 5vw, 60px) 0 24px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.field { margin: 0 0 22px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; font: inherit; padding: 12px 14px; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.cert { background: #fff; color: var(--ink); border-radius: 12px; padding: 36px 32px; text-align: center; border: 6px double var(--blue); margin-bottom: 22px; }
.cert-logo { margin: 0 auto 14px; width: 200px; }
.cert h2 { color: var(--blue-dark); margin: 8px 0 14px; }
.cert-text { font-size: 20px; line-height: 1.5; margin: 0 0 18px; }
.cert-note { font-size: 13px; color: var(--muted); margin: 0; }
@media print {
  .site-header, .site-footer, .no-print, .draft-banner, .skip, .lesson-hero { display: none !important; }
  body { background: #fff; }
  #cert-wrap { padding: 0; display: block !important; }
}
