@font-face { font-family: "Lora"; src: url(fonts/lora-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lora"; src: url(fonts/lora-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f4f5f7; --surface: #ffffff; --ink: #1b2430; --muted: #5d6673; --line: #dde1e6;
  --accent: #1559b7; --accent-soft: #e8f0fb; --ok: #1e7a4c; --ok-soft: #e6f4ec;
  --warn: #9a6200; --warn-soft: #fbf1df; --bad: #b3261e; --bad-soft: #fbe9e7;
  --radius: 10px; --serif: "Lora", Georgia, serif; --sans: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* En-tête co-marqué */
.brand { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-in { max-width: 920px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.brand img { height: 64px; width: auto; display: block; }
.brand .sep { width: 1px; height: 36px; background: var(--line); }
.brand .title { margin-left: auto; text-align: right; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.brand .title strong { display: block; color: var(--ink); font-family: var(--serif); font-size: .95rem; }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 96px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.card.flat { padding: 16px 20px; }
.part-tag { font: 600 .75rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* Progression */
.progress { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0 8px; }
.progress-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .3s; }
.steps { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.steps .on { color: var(--accent); font-weight: 600; }
.steps .done { color: var(--ink); }

/* Questions */
.q { padding: 18px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: 4px; }
.q-label { font-weight: 600; margin-bottom: 10px; }
.q-hint { font-size: .875rem; color: var(--muted); margin: -6px 0 10px; }
.q.invalid .q-label::after { content: " — réponse attendue"; color: var(--bad); font-weight: 400; font-size: .875rem; }
.opts { display: grid; gap: 8px; }
.opts.cols2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.opt { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.opt:hover { border-color: #b9c2cc; }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt .k { font: 600 .8rem/1.6 var(--sans); color: var(--muted); text-transform: uppercase; }
.scenario-text { background: var(--bg); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 8px 8px 0; margin-bottom: 12px; }
.cert { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.cert > span { font-size: .875rem; color: var(--muted); margin-right: 4px; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px; cursor: pointer; font-size: .9rem; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill:has(input:focus-visible), .opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Grilles (échelles) : tableau sur grand écran, cartes empilées sur mobile */
.grid { width: 100%; border-collapse: collapse; }
.grid th { font: 600 .78rem/1.3 var(--sans); color: var(--muted); padding: 8px 6px; text-align: center; vertical-align: bottom; }
.grid td { border-top: 1px solid var(--line); padding: 6px; text-align: center; }
.grid td:first-child { text-align: left; padding: 12px 12px 12px 0; }
.grid label { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }
.grid label:hover { background: var(--accent-soft); }
.grid input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid tr.invalid td:first-child { color: var(--bad); }
.grid .lbl-m { display: none; }
@media (max-width: 680px) {
  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid tr { border-top: 1px solid var(--line); padding: 10px 0; }
  .grid td { border: 0; text-align: left; padding: 2px 0; }
  .grid td:first-child { font-weight: 600; padding-bottom: 6px; }
  .grid label { width: auto; height: auto; min-height: 44px; border-radius: 8px; padding: 0 10px; gap: 10px; justify-content: flex-start; }
  .grid .lbl-m { display: inline; font-size: .9rem; }
  .brand img { height: 40px; }
  .brand .title { display: none; }
  .card { padding: 18px 16px; }
}

input[type=text], input[type=number], input[type=email], input[type=password], textarea, select {
  width: 100%; font: 16px/1.4 var(--sans); padding: 10px 12px; min-height: 44px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 1rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.alert { padding: 12px 16px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); margin: 12px 0; }
.notice { padding: 12px 16px; border-radius: 8px; background: var(--accent-soft); font-size: .9rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.foot { text-align: center; font-size: .78rem; color: var(--muted); padding: 24px 16px; }
.hidden { display: none !important; }
