/* ==========================================================================
   AL MUNQIDH — modules interactifs
   Chargé après site.css. Tout dégrade proprement sans JavaScript.
   ========================================================================== */

/* ---------- Révélation au défilement ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
.no-js [data-reveal], .no-motion [data-reveal] { opacity: 1; transform: none; }

/* ---------- Vidéo de fond ---------- */
.hero__bg video, .phero__bg video {
  width: 100%; height: 100%; object-fit: cover; opacity: .42;
  position: absolute; inset: 0;
}
.phero__bg video { opacity: .34; }
.hero__bg video { z-index: 0; }

/* ---------- Bouton WhatsApp flottant ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  background: #25D366; color: #06281A;
  font-family: var(--f-display); font-weight: 700; font-size: .93rem;
  padding: 13px 18px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .18s ease, background-color .18s ease;
}
.wa-float:hover { background: #2BEE74; transform: translateY(-2px); }
.wa-float svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 620px) {
  .wa-float { right: 14px; bottom: 14px; padding: 14px; }
  .wa-float span { display: none; }
}
.btn--wa { background: #25D366; color: #06281A; }
.btn--wa:hover { background: #2BEE74; }
.btn--wa svg { width: 18px; height: 18px; }

/* ---------- Compteurs ---------- */
.figure__n[data-count] { font-variant-numeric: tabular-nums; }

/* ---------- Chaîne de survie interactive ---------- */
.chain__list { position: relative; }
.chain__link { cursor: default; }
.chain--live .chain__link { cursor: pointer; }
.chain--live .chain__link { transition: opacity .25s ease; }
.chain--live .chain__link[aria-selected="false"] { opacity: .55; }
.chain--live .chain__link[aria-selected="true"] { opacity: 1; }
.chain__dot {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(144,161,180,.35); margin-bottom: 14px;
  position: relative; transition: background-color .3s ease, box-shadow .3s ease;
}
.chain__link[aria-selected="true"] .chain__dot {
  background: var(--gold); box-shadow: 0 0 0 6px rgba(200,162,74,.18);
}
.chain__link--aed[aria-selected="true"] .chain__dot {
  background: var(--aed); box-shadow: 0 0 0 6px rgba(14,155,92,.20);
}
.chain__detail {
  margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line-dark);
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr);
  gap: clamp(24px,4vw,52px); align-items: start;
}
@media (max-width: 820px) { .chain__detail { grid-template-columns: 1fr; } }
.chain__detail h3 { color: #fff; margin-bottom: .5em; }
.chain__detail p { color: var(--silver); font-size: 1rem; margin: 0; }
.chain__detail ul { margin: 0; padding-left: 20px; color: var(--silver); font-size: 1rem; }
.chain__detail li { margin-bottom: 8px; }
.chain__detail b { color: #fff; font-weight: 600; }

/* ---------- Simulateur de défibrillateur ---------- */
.aedsim {
  background: linear-gradient(165deg, #0B1730 0%, #050B1A 70%);
  border: 1px solid var(--line-dark); border-radius: 8px;
  overflow: hidden;
}
.aedsim__grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; }
@media (max-width: 900px) { .aedsim__grid { grid-template-columns: 1fr; } }

.aedsim__screen {
  position: relative; padding: clamp(20px,3vw,30px);
  border-right: 1px solid var(--line-dark);
  display: flex; flex-direction: column;
}
@media (max-width: 900px) { .aedsim__screen { border-right: 0; border-bottom: 1px solid var(--line-dark); } }
.aedsim__ecg {
  display: block; width: 100%; flex: 1 1 auto; min-height: 200px;
  background: #030711; border-radius: 5px;
  border: 1px solid rgba(14,155,92,.22);
}
.aedsim__status {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; min-height: 30px; flex: none;
}
.aedsim__led {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: var(--silver); transition: background-color .3s ease, box-shadow .3s ease;
}
.aedsim__led[data-state="analyse"] { background: var(--gold); box-shadow: 0 0 0 5px rgba(200,162,74,.2); }
.aedsim__led[data-state="choc"]    { background: var(--alert); box-shadow: 0 0 0 5px rgba(214,68,48,.24); }
.aedsim__led[data-state="ok"]      { background: var(--aed); box-shadow: 0 0 0 5px rgba(14,155,92,.22); }
.aedsim__say {
  font-family: var(--f-display); font-weight: 600; font-size: 1.06rem;
  color: #fff; margin: 0; letter-spacing: -0.015em;
}
.aedsim__sub { font-size: .93rem; color: var(--silver); margin: 6px 0 0; min-height: 1.5em; }

.aedsim__panel { padding: clamp(20px,3vw,30px); display: flex; flex-direction: column; }
.aedsim__steps { list-style: none; margin: 0 0 22px; padding: 0; }
.aedsim__steps li {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  padding: 9px 0; font-size: .95rem; color: var(--silver);
  transition: color .25s ease;
}
.aedsim__steps li .n {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--f-display);
  font-weight: 700; font-size: .74rem;
  background: rgba(144,161,180,.16); color: var(--silver);
  transition: background-color .25s ease, color .25s ease;
}
.aedsim__steps li[data-done="true"] { color: var(--silver-lit); }
.aedsim__steps li[data-done="true"] .n { background: rgba(14,155,92,.25); color: #6FE0AC; }
.aedsim__steps li[data-active="true"] { color: #fff; }
.aedsim__steps li[data-active="true"] .n { background: var(--gold); color: #14100A; }
.aedsim__go { margin-top: auto; }

.aedsim__flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
}
.aedsim__flash.is-on { animation: aedflash .42s ease; }
@keyframes aedflash { 0% { opacity: 0 } 18% { opacity: .82 } 100% { opacity: 0 } }
.no-motion .aedsim__flash.is-on { animation: none; }

/* ---------- Sélecteur de formation ---------- */
.picker { background: var(--panel); border-radius: 8px; border: 1px solid var(--line-dark); overflow: hidden; }
.paper .picker { background: #fff; border-color: var(--line-light); }
.picker__q { padding: clamp(22px,3vw,32px); border-bottom: 1px solid var(--line-light); }
.picker__q:last-of-type { border-bottom: 0; }
.picker__q h3 { font-size: 1.1rem; margin-bottom: 16px; }
.picker__opts { display: flex; flex-wrap: wrap; gap: 10px; }
.picker__opt {
  font-family: var(--f-display); font-weight: 500; font-size: .93rem;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-light); background: transparent; color: var(--ink);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.picker__opt:hover { border-color: var(--ink); }
.picker__opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.picker__out {
  padding: clamp(22px,3vw,32px); background: var(--ink); color: var(--paper);
}
.picker__out h3 { color: #fff; font-size: 1.35rem; margin-bottom: .4em; }
.picker__out p { color: var(--silver-lit); font-size: 1rem; }
.picker__out .btn-row { margin-top: 22px; }
.picker__out[hidden] { display: none; }

/* ---------- Mini-défi jouable ---------- */
.quiz { border: 1px solid var(--line-dark); border-radius: 8px; background: var(--panel); overflow: hidden; }
.quiz__bar { height: 4px; background: rgba(144,161,180,.18); }
.quiz__bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .45s ease; }
.quiz__body { padding: clamp(24px,3.5vw,40px); }
.quiz__meta {
  font-family: var(--f-display); font-size: .82rem; color: var(--silver);
  display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px;
}
.quiz__q { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.15rem,2.1vw,1.5rem);
           line-height: 1.25; letter-spacing: -0.02em; color: #fff; margin: 0 0 22px; }
.quiz__opts { display: grid; gap: 10px; margin: 0 0 20px; }
.quiz__opt {
  text-align: left; width: 100%; cursor: pointer;
  font-family: var(--f-read); font-size: 1rem; line-height: 1.45; color: var(--paper);
  background: rgba(255,255,255,.04); border: 1px solid var(--line-dark);
  border-radius: 5px; padding: 15px 18px;
  transition: background-color .18s ease, border-color .18s ease;
}
.quiz__opt:hover:not(:disabled) { background: rgba(255,255,255,.09); border-color: var(--silver); }
.quiz__opt:disabled { cursor: default; }
.quiz__opt[data-mark="good"] { border-color: var(--aed); background: rgba(14,155,92,.16); }
.quiz__opt[data-mark="bad"]  { border-color: var(--alert); background: rgba(214,68,48,.13); }
.quiz__fb { border-left: 3px solid var(--gold); padding: 4px 0 4px 18px; color: var(--silver-lit); font-size: .98rem; }
.quiz__fb[hidden] { display: none; }
.quiz__fb b { color: #fff; }
.quiz__end { text-align: left; }
.quiz__score {
  font-family: var(--f-display); font-weight: 800; letter-spacing: -0.04em;
  font-size: clamp(2.4rem,5vw,3.4rem); color: var(--gold); line-height: 1; margin: 0 0 12px;
}

/* ---------- Galerie photo ---------- */
.shot { cursor: zoom-in; position: relative; }
.shot::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--step-r);
  box-shadow: inset 0 0 0 0 var(--gold); transition: box-shadow .2s ease;
}
.shot:hover::after { box-shadow: inset 0 0 0 2px var(--gold); }
.lb {
  position: fixed; inset: 0; z-index: 200; background: rgba(3,7,17,.94);
  display: grid; place-items: center; padding: 24px;
}
.lb[hidden] { display: none; }
.lb img { max-width: min(1100px, 94vw); max-height: 82vh; border-radius: 4px; }
.lb figcaption {
  font-family: var(--f-display); color: var(--silver-lit); font-size: .95rem;
  text-align: center; margin-top: 16px;
}
.lb__x {
  position: absolute; top: 18px; right: 18px; width: 46px; height: 46px;
  border-radius: 50%; border: 1px solid var(--silver); background: transparent;
  color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.lb__x:hover { background: rgba(255,255,255,.1); }

/* ---------- Bandeau de chiffres sombre ---------- */
.metric-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
@media (max-width: 820px) { .metric-row { grid-template-columns: 1fr 1fr; } }
.metric { background: var(--night-2); padding: 26px 22px; }
.metric b {
  display: block; font-family: var(--f-display); font-weight: 800;
  font-size: clamp(1.7rem,3vw,2.4rem); letter-spacing: -0.035em; color: #fff;
  line-height: 1; margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
.metric span { font-size: .93rem; color: var(--silver); }
