/* =====================================================================
   Orientation FP adaptée — thème CLAIR forcé, sobre, contraste élevé.
   - color-scheme: light : pas d'inversion en mode sombre (iOS/Android).
   - Rouge iMédias avec parcimonie (boutons principaux seulement).
   - Aucune animation, aucune transition, aucun clignotement.
   - Même gabarit sur tous les écrans : barre du haut, contenu, actions en bas.
   Contrastes vérifiés (WCAG AA) : texte #1b1614 / fond #faf7f6 = 16,8:1 ;
   blanc / rouge #d42a1c = 5,1:1 ; turquoise foncé #2f5f6c / blanc = 7,1:1.
   L'or #bf831a (3,2:1) ne sert qu'aux bordures, jamais au texte.
   ===================================================================== */
:root {
  color-scheme: light;
  --bg: #faf7f6;
  --card: #ffffff;
  --ink: #1b1614;
  --ink-2: #4f4541;          /* texte secondaire : 8,7:1 */
  --line: #d9cfca;
  --red: #d42a1c;
  --red-press: #b3241a;
  --gold: #bf831a;
  --teal: #3f7a8a;
  --teal-ink: #2f5f6c;
  --teal-bg: #eef4f6;
  --gold-bg: #fff8ec;
  --radius: 14px;
  --fs: 18px;
}
html.big { --fs: 21px; }

* { box-sizing: border-box; }
*, *::before, *::after { animation: none !important; transition: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 560px; margin: 0 auto; min-height: 100vh;
  padding: env(safe-area-inset-top) 0 calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
button, a.btn { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 8px; }
h1:focus, main:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Bannière « Version de démonstration » (DEMO_BANNER dans data.js) ----
   Fine, discrète, or + ardoise, jamais rouge, jamais animée. Texte 8,7:1. */
.demo-banner {
  padding: 4px 8px; text-align: center;
  font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--ink-2);  /* taille fixe : une ligne sur iPhone */
  background: var(--gold-bg); border-bottom: 2px solid var(--gold);
}

/* ---- Barre du haut : identique partout ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; min-height: 64px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.topright { display: flex; gap: 8px; }
.topbtn {
  min-height: 48px; min-width: 48px; padding: 0 14px;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  font-size: 0.9em; font-weight: 600; color: var(--ink);
}
.topbtn.placeholder { visibility: hidden; border: 0; background: none; }
.topbtn[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-bg); }
.aplus { font-size: 1.3em; margin-left: 1px; }

/* ---- Contenu ---- */
.screen { flex: 1; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 16px; }
.title { font-size: 1.45em; line-height: 1.3; margin: 0; font-weight: 700; }
.qtitle { font-size: 1.4em; }
.subtitle { margin: 4px 0 0; color: var(--ink-2); font-size: 1em; }
.lead { margin: 0; font-size: 1em; }
.kicker { margin: 0; font-size: 0.9em; font-weight: 700; color: var(--teal-ink); }
.example { margin: -6px 0 0; color: var(--ink-2); }
.note { margin: 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.small { margin: 0; font-size: 0.85em; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.picto {
  width: 84px; height: 84px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; line-height: 1;
  background: var(--card); border: 2px solid var(--line);
}

/* ---- Accueil ---- */
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hero-icon { border-radius: 18px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.facts li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.fact-ico { font-size: 1.3em; line-height: 1.2; }
.footlinks { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 4px 0 0; color: var(--ink-2); }
.linkbtn {
  background: none; border: 0; padding: 10px 6px; min-height: 44px;
  color: var(--teal-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.confirm { margin: 0; padding: 14px; border: 2px solid var(--gold); background: var(--gold-bg); border-radius: var(--radius); font-weight: 600; }

/* ---- Bouton Écouter ---- */
.listen {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  background: var(--card); border: 2px solid var(--teal); border-radius: 999px;
  color: var(--teal-ink); font-weight: 700;
}
.listen.on { background: var(--teal-bg); }

/* ---- Progression ---- */
.progress { display: flex; flex-direction: column; gap: 8px; }
.bar { height: 12px; background: #e9e1dc; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }

/* ---- Choix de réponse ---- */
.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 64px; padding: 12px 16px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  font-size: 1em; font-weight: 600; color: var(--ink);
}
.opt.sel { border: 3px solid var(--teal); background: var(--teal-bg); padding: 11px 15px; }
.opt.nsp { border-style: dashed; }
.opt.nsp.sel { border-style: solid; }
.opt-ico { font-size: 1.5em; width: 1.6em; text-align: center; line-height: 1; flex: none; }
.opt-lbl { flex: 1; }
.qmark { display: inline-flex; width: 1.25em; height: 1.25em; align-items: center; justify-content: center; border: 2px solid var(--ink-2); border-radius: 50%; font-size: 0.75em; font-weight: 800; color: var(--ink); }
.sugg { border: 2px dashed var(--gold); }
.check { width: 1.4em; font-size: 1.2em; font-weight: 800; color: var(--teal-ink); text-align: center; flex: none; }
.bars { display: inline-flex; align-items: flex-end; gap: 4px; width: 1.6em; height: 26px; flex: none; justify-content: center; }
.bars i { display: block; width: 7px; border-radius: 2px; background: #e3dad5; border: 1px solid #b9aca5; }
.bars i:nth-child(1) { height: 9px; } .bars i:nth-child(2) { height: 17px; } .bars i:nth-child(3) { height: 25px; }
.bars.b1 i:nth-child(1), .bars.b2 i:nth-child(-n+2), .bars.b3 i { background: var(--teal); border-color: var(--teal); }

/* ---- Zone d'actions (bas d'écran) ---- */
.actions { padding: 12px 20px 8px; display: flex; flex-direction: column; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 12px 18px;
  border-radius: var(--radius); font-size: 1em; font-weight: 700; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--red); color: #fff; border: 2px solid var(--red); }
.btn.primary:active { background: var(--red-press); border-color: var(--red-press); }
.btn.secondary { background: var(--card); color: var(--ink); border: 2px solid var(--ink-2); }
.screen .btn { margin-top: 2px; }

/* ---- Résultats ---- */
.cards { display: flex; flex-direction: column; gap: 12px; }
.tcard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%;
  padding: 16px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-left: 6px solid var(--gold); border-radius: var(--radius);
}
.rank { font-size: 0.85em; font-weight: 700; color: var(--teal-ink); }
.tc-head { display: flex; gap: 12px; align-items: center; }
.tc-emoji { font-size: 2em; line-height: 1; }
.tc-name { font-size: 1.1em; font-weight: 700; display: flex; flex-direction: column; }
.tc-code { font-size: 0.8em; font-weight: 600; color: var(--ink-2); }
.tc-why { color: var(--ink); }
.tc-go { font-weight: 700; color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; }
.fit { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.dots { color: var(--teal-ink); letter-spacing: 2px; }
.tag-val { font-size: 0.8em; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 2px dashed var(--gold); background: var(--gold-bg); color: #6b4a0e; }

.block { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.block h2 { margin: 0; font-size: 1.1em; }
.block p { margin: 0; }
.answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.answers li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 8px 0; border-top: 1px solid var(--line); align-items: center; }
.answers li:first-child { border-top: 0; }
.ans-q { font-weight: 600; grid-column: 1; }
.ans-a { color: var(--ink-2); grid-column: 1; }
.answers .linkbtn { grid-column: 2; grid-row: 1 / span 2; }

/* ---- Fiche métier ---- */
.trade-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.reasons, .attention, .tasks, .env { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.reasons li, .attention li { display: flex; gap: 10px; align-items: flex-start; }
.reasons .mark { color: var(--teal-ink); font-weight: 800; width: 1.2em; flex: none; }
.attention li { padding: 10px 12px; background: var(--gold-bg); border-left: 4px solid var(--gold); border-radius: 8px; }
.attention .mark { flex: none; }
.tasks li { padding-left: 22px; position: relative; }
.tasks li::before { content: "•"; position: absolute; left: 6px; color: var(--teal-ink); font-weight: 800; }
.env li { display: grid; grid-template-columns: 1.8em 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.env-txt { display: flex; flex-direction: column; line-height: 1.35; }
.env li.flag { background: var(--gold-bg); outline: 1px solid var(--gold); }
.env-ico { font-size: 1.2em; text-align: center; }
.env-lbl { font-weight: 600; }
.env-val { color: var(--ink-2); }
.facts2 { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts2 div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.facts2 dt { font-size: 0.85em; color: var(--ink-2); font-weight: 600; }
.facts2 dd { margin: 2px 0 0; font-weight: 700; }

@media (max-width: 360px) {
  .facts2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
