/* NormeApa — thème « santé » : blanc clinique, bleu-vert soignant, tracé ECG. */
:root {
  --fond: #f4f8fa;
  --fond-hero: linear-gradient(160deg, #e6f4f6 0%, #f4f8fa 55%, #eef3fb 100%);
  --surface: #ffffff;
  --surface-2: #f7fbfc;
  --texte: #0f2a3a;
  --texte-doux: #4e6676;
  --bordure: #dbe7ec;
  --accent: #0b6e79;
  --accent-fort: #08535c;
  --accent-pale: #e3f3f4;
  --accent-2: #2a6fdb;
  --menthe: #17a37b;
  --menthe-pale: #e2f6ef;
  --alerte-fond: #fff7e6;
  --alerte-bord: #f0c36b;
  --alerte-texte: #7a4b00;
  --erreur-fond: #fdeeee;
  --erreur-bord: #e59a9a;
  --ecg: #0b6e79;
  --page: #ffffff;
  --page-ligne: #d3e1e7;
  --ombre: 0 1px 2px rgba(15, 42, 58, .05), 0 10px 30px rgba(15, 42, 58, .08);
  --ombre-forte: 0 2px 6px rgba(15, 42, 58, .06), 0 24px 60px rgba(11, 110, 121, .16);
  --rayon: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0c1a22;
    --fond-hero: linear-gradient(160deg, #0f2a33 0%, #0c1a22 60%, #101d30 100%);
    --surface: #12232d;
    --surface-2: #162a35;
    --texte: #e4eef2;
    --texte-doux: #9db3bf;
    --bordure: #223b48;
    --accent: #4cc3cc;
    --accent-fort: #7dd8de;
    --accent-pale: #133740;
    --accent-2: #7aa7f0;
    --menthe: #4fd1a5;
    --menthe-pale: #12362d;
    --alerte-fond: #2e2412;
    --alerte-bord: #7d6127;
    --alerte-texte: #f2cf8a;
    --erreur-fond: #351d20;
    --erreur-bord: #8c4a4f;
    --ecg: #4cc3cc;
    --page: #f3f7f9;
    --page-ligne: #cddbe2;
    --ombre: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .3);
    --ombre-forte: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.65 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
code, kbd {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--accent-pale);
  color: var(--accent-fort);
  border-radius: 6px;
  padding: .1em .4em;
}
svg { width: 1.1em; height: 1.1em; flex: none; }
.sprite { display: none; }

.conteneur { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--bordure);
}
.entete__barre { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; color: var(--texte); text-decoration: none; }
.logo strong { color: var(--accent); }
.logo__badge {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.logo__badge svg { width: 22px; height: 22px; }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--texte-doux); text-decoration: none; font-size: .95rem; padding: 6px 12px; border-radius: 999px; }
.nav a:hover { color: var(--accent); background: var(--accent-pale); }

/* ---------- Hero ---------- */
.hero { background: var(--fond-hero); position: relative; padding: 64px 0 90px; overflow: hidden; }
.hero__grille { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.surtitre {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  color: var(--accent); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin-bottom: 18px; }
.surligne { color: var(--accent); background: linear-gradient(transparent 70%, color-mix(in srgb, var(--menthe) 28%, transparent) 70%); }
.hero__sous-titre { color: var(--texte-doux); font-size: 1.1rem; margin: 0 0 22px; max-width: 560px; }
.puces { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.puces li {
  display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 600;
  background: var(--surface); color: var(--texte); border: 1px solid var(--bordure);
  border-radius: 999px; padding: 6px 13px;
}
.puces svg { color: var(--menthe); }

/* Aperçu de page */
.apercu { position: relative; margin: 0; padding: 18px 0; }
.page {
  position: relative; background: var(--page); border-radius: 6px; box-shadow: var(--ombre-forte);
  padding: 30px 38px 36px; transform: rotate(-1.5deg);
  display: flex; flex-direction: column; gap: 8px;
}
.page__entete { position: relative; display: flex; justify-content: space-between; font: 700 .6rem/1 Arial, sans-serif; color: #5d7280; letter-spacing: .04em; margin-bottom: 12px; }
.page__titre1 { position: relative; font: 700 .85rem/1.2 Arial, sans-serif; color: #0f2a3a; text-align: center; margin: 4px 0 2px; }
.page__titre2 { font: 700 .74rem/1.2 Arial, sans-serif; color: #0f2a3a; margin: 8px 0 2px; }
.ligne { position: relative; height: 6px; border-radius: 3px; background: var(--page-ligne); }
.ligne.alinea { margin-left: 12%; }
.ligne.courte { width: 45%; }
.ligne.moyenne { width: 72%; }
.page__citation { position: relative; margin: 6px 0 6px 12%; display: flex; flex-direction: column; gap: 10px; padding-left: 8px; border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.etiquette {
  position: absolute; top: 50%; transform: translateY(-50%) rotate(1.5deg); z-index: 1;
  font: 700 .75rem/1.2 "Segoe UI", system-ui, sans-serif; white-space: nowrap; text-align: left;
  background: var(--accent); color: #fff; padding: 5px 11px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(11, 110, 121, .25);
}
.etiquette::before { content: ""; position: absolute; top: 50%; width: 14px; height: 2px; background: inherit; }
.etiquette.e1 { right: -78px; }
.etiquette.e1::before { left: -12px; }
.etiquette.e2 { left: -86px; background: var(--accent-2); }
.etiquette.e2::before { right: -12px; }
.etiquette.e3 { right: -64px; background: var(--menthe); }
.etiquette.e3::before { left: -12px; }
.etiquette.e4 { left: -128px; }
.etiquette.e4::before { right: -12px; }

/* Tracé ECG */
.ecg { position: absolute; left: 0; right: 0; bottom: 14px; width: 100%; height: 60px; }
.ecg path {
  fill: none; stroke: var(--ecg); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; opacity: .55;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: trace 3.2s ease-out .3s forwards;
}
@keyframes trace { to { stroke-dashoffset: 0; } }

/* ---------- Cartes & outil ---------- */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 26px; }
#outil { margin-top: -40px; position: relative; }
.outil { padding: 0; overflow: hidden; box-shadow: var(--ombre-forte); }
.outil__bandeau {
  display: flex; align-items: center; gap: 14px; padding: 16px 26px;
  background: linear-gradient(120deg, #0b6e79, #2a5bb8); color: #fff;
}
.outil__bandeau > svg { width: 30px; height: 30px; }
.outil__bandeau div { display: flex; flex-direction: column; line-height: 1.3; }
.outil__bandeau span { opacity: .85; font-size: .9rem; }
.outil__secret {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 5px 12px; font-weight: 600; opacity: 1 !important;
}

.etape { display: flex; gap: 18px; padding: 24px 26px; border-bottom: 1px solid var(--bordure); position: relative; }
.etape:last-child { border-bottom: 0; }
.etape__num {
  flex: 0 0 38px; height: 38px; border-radius: 12px;
  background: var(--accent-pale); color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: grid; place-items: center; font-weight: 800;
}
.etape__contenu { flex: 1; min-width: 0; }
.etape h2 { font-size: 1.2rem; margin-top: 6px; }

/* Zone de dépôt */
.depot {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--bordure)); border-radius: var(--rayon);
  background: var(--surface-2); padding: 30px 16px; cursor: pointer;
}
.depot:hover, .depot:focus-visible, .depot.survol { border-color: var(--accent); background: var(--accent-pale); outline: none; }
.depot.choisi { border-style: solid; border-color: var(--menthe); background: var(--menthe-pale); }
.depot__icone {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--surface); color: var(--accent); box-shadow: var(--ombre); margin-bottom: 4px;
}
.depot.choisi .depot__icone { color: var(--menthe); }
.depot__icone svg { width: 28px; height: 28px; }
.depot__texte { font-size: 1.05rem; overflow-wrap: anywhere; }
.depot__aide { color: var(--texte-doux); font-size: .9rem; }

/* Champs */
.champ { display: block; border: 0; padding: 0; margin: 0 0 14px; }
.champ__libelle { display: block; font-weight: 650; margin-bottom: 6px; }
.champ__libelle small, .radio small { font-weight: 400; color: var(--texte-doux); }
input[type="text"] {
  width: 100%; font: inherit; color: var(--texte);
  padding: 12px 14px; border: 1.5px solid var(--bordure); border-radius: 12px; background: var(--surface-2);
}
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.radio, .case { display: flex; align-items: center; gap: 9px; margin: 5px 0; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.options summary, .bilan summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.options__corps { padding-top: 14px; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 700; font-size: 1rem;
  background: var(--accent); color: #fff; border: 0; border-radius: 12px;
  padding: 12px 22px; cursor: pointer; text-decoration: none;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent);
  transition: background .15s, transform .05s, box-shadow .15s;
}
.bouton svg { width: 20px; height: 20px; }
.bouton--grand { font-size: 1.05rem; padding: 14px 28px; }
.bouton:hover:not(:disabled) { background: var(--accent-fort); }
.bouton:active:not(:disabled) { transform: translateY(1px); }
.bouton:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.bouton--succes { background: var(--menthe); box-shadow: 0 8px 20px color-mix(in srgb, var(--menthe) 30%, transparent); }
.bouton--succes:hover { background: color-mix(in srgb, var(--menthe) 85%, #000) !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bouton { color: #06222a; }
}

.statut { color: var(--texte-doux); margin: 12px 0 0; min-height: 1.6em; }
.statut.chargement::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--bordure); border-top-color: var(--accent); border-radius: 50%;
  animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

/* Résultat */
.resultat, .erreur { margin-top: 20px; }
.resultat { border-top: 4px solid var(--menthe); }
.resultat__tete { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.resultat__titre { display: flex; align-items: center; gap: 14px; min-width: 0; }
.resultat__titre h2 { margin: 0; font-size: 1.35rem; }
.resultat__icone { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--menthe-pale); color: var(--menthe); }
.resultat__icone svg { width: 26px; height: 26px; }
.resultat__nom { color: var(--texte-doux); margin: 0; overflow-wrap: anywhere; }
.resultat__etapes { margin-top: 20px; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 12px; padding: 16px 20px; }
.resultat h3 { font-size: 1.02rem; }
.resultat ol { padding-left: 1.3em; margin: 0; }
.alertes { margin-top: 18px; background: var(--alerte-fond); border: 1px solid var(--alerte-bord); border-left-width: 5px; border-radius: 12px; padding: 16px 20px; }
.alertes h3 { color: var(--alerte-texte); }
.alertes h3::before { content: "⚠  "; }
.alertes ul { margin: 0; padding-left: 1.2em; }
.alertes li { margin: 6px 0; white-space: pre-line; overflow-wrap: anywhere; }
.bilan { margin-top: 18px; }
.bilan ul { columns: 2; column-gap: 28px; color: var(--texte-doux); }
.erreur { background: var(--erreur-fond); border-color: var(--erreur-bord); border-left-width: 5px; }

/* ---------- Bloc secret professionnel ---------- */
.secret {
  display: flex; gap: 22px; align-items: flex-start;
  background: linear-gradient(135deg, var(--accent-pale), var(--menthe-pale));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--bordure));
  border-radius: var(--rayon); padding: 28px;
}
.secret__icone { display: grid; place-items: center; flex: 0 0 56px; height: 56px; border-radius: 16px; background: var(--surface); color: var(--accent); box-shadow: var(--ombre); }
.secret__icone svg { width: 30px; height: 30px; }
.secret h2 { font-size: 1.35rem; }
.secret p { margin: 0; color: var(--texte-doux); }

/* ---------- Sections d'information ---------- */
.section { padding-top: 64px; }
.section .surtitre { margin-bottom: 6px; }
.section__titre { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.section__intro { color: var(--texte-doux); max-width: 720px; }
.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.info h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.info h3::before { content: ""; width: 6px; height: 20px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); }
.note { color: var(--texte-doux); font-size: .92rem; margin: 10px 0 0; }

.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th, .tableau td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--bordure); }
.tableau th { color: var(--texte-doux); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.niveau { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-pale); color: var(--accent); font-weight: 800; }

.liste-coches, .liste-tirets { list-style: none; padding: 0; margin: 0; }
.liste-coches li, .liste-tirets li { position: relative; padding-left: 30px; margin: 9px 0; }
.liste-coches li::before {
  content: "✓"; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; font-weight: 800;
  background: var(--menthe-pale); color: var(--menthe);
}
.liste-tirets li::before { content: "→"; position: absolute; left: 3px; color: var(--accent-2); font-weight: 700; }

.faq details { background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; padding: 15px 20px; margin: 10px 0; transition: border-color .15s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--bordure)); }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p, .faq ul { color: var(--texte-doux); margin: 10px 0 0; }

/* ---------- Pied ---------- */
.pied { margin-top: 72px; padding: 32px 0; border-top: 1px solid var(--bordure); background: var(--surface); color: var(--texte-doux); font-size: .9rem; }
.pied__contenu { display: flex; gap: 24px; align-items: center; }
.pied p { margin: 0; }
.logo--pied { flex: none; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hero__grille { grid-template-columns: minmax(0, 1fr); }
  .apercu { max-width: 360px; margin: 10px auto 0; padding: 18px 26px; }
  .page { padding: 24px 26px 28px; }
  .etiquette { display: none; }
}
@media (max-width: 700px) {
  .hero { padding: 40px 0 80px; }
  .grille { grid-template-columns: minmax(0, 1fr); }
  .outil__bandeau { padding: 14px 16px; flex-wrap: wrap; }
  .outil__secret { margin-left: 0; }
  .etape { gap: 12px; padding: 20px 16px; }
  .etape__num { flex-basis: 32px; height: 32px; }
  .bilan ul { columns: 1; }
  .nav { display: none; }
  .bouton { width: 100%; }
  .secret { flex-direction: column; padding: 22px; }
  .pied__contenu { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ecg path { animation: none; stroke-dashoffset: 0; }
}
