:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b1f1d;
  --ink-2: #48514c;
  --muted: #6b736f;
  --line: #e2ded4;
  --line-strong: #cfc9bc;
  --accent: #0b7a5c;
  --accent-hover: #09684e;
  --accent-ink: #ffffff;
  --accent-soft: #e4f2ec;
  --yuan: #c8372d;
  --error: #b42318;
  --error-soft: #fdecea;
  --focus: #0b7a5c;
  --shadow: 0 1px 2px rgba(27, 31, 29, .05), 0 8px 24px rgba(27, 31, 29, .06);
  --radius: 16px;
  --radius-sm: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #161d1a;
    --surface-2: #1b2420;
    --ink: #e9eeeb;
    --ink-2: #bcc6c1;
    --muted: #8d9893;
    --line: #26312c;
    --line-strong: #34413b;
    --accent: #3cc48f;
    --accent-hover: #55d29f;
    --accent-ink: #05140d;
    --accent-soft: #13291f;
    --yuan: #f07a6f;
    --error: #f5867b;
    --error-soft: #2e1714;
    --focus: #3cc48f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--yuan); color: #fff; font-weight: 700; font-size: 17px; }

.lang { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { appearance: none; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; padding: 5px 13px; border-radius: 999px; cursor: pointer; min-width: 44px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

main.wrap { flex: 1; padding-top: 20px; padding-bottom: 32px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; }

/* Intro */
.intro h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 6px 0 12px; text-wrap: balance; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; margin: 0; }
.lead { color: var(--ink-2); margin: 0 0 20px; font-size: 17px; }
.badges { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.badges li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink); }
.badges svg { flex: none; width: 22px; height: 22px; color: var(--accent); }
.by { margin: 18px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.privacy { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Buttons */
.btn { appearance: none; border: 1px solid transparent; border-radius: 12px; font: inherit; font-weight: 650; font-size: 16px; padding: 13px 20px; cursor: pointer; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background-color .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; }

/* Progress */
.progress { margin: 0 0 14px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.progress-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

/* Steps & questions */
.step h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 6px; }
.step h2:focus { outline: none; }
.step-intro { background: var(--accent-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0 4px; font-size: 15px; }

.q { border: 0; margin: 0; padding: 22px 0 0; min-width: 0; }
.q + .q { border-top: 1px solid var(--line); margin-top: 22px; }
.q legend, .q .q-label { display: block; padding: 0; font-weight: 650; font-size: 17px; line-height: 1.35; margin-bottom: 4px; }
.q legend { float: left; width: 100%; } /* légende traitée comme un bloc normal (pas posée sur la bordure) */
.q legend + * { clear: both; }
.q-help { display: block; font-size: 14px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.q-body { margin-top: 12px; }

.options { display: grid; gap: 8px; }
.option { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .12s, background-color .12s; line-height: 1.35; }
.option:hover { border-color: var(--line-strong); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option .ind { flex: none; width: 22px; height: 22px; margin-top: 0; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; transition: all .12s; }
.option .ind.radio { border-radius: 50%; }
.option .ind.check { border-radius: 6px; }
.option .ind svg { width: 14px; height: 14px; color: var(--accent-ink); opacity: 0; }
.option.is-checked { border-color: var(--accent); background: var(--accent-soft); }
.option.is-checked .ind { border-color: var(--accent); background: var(--accent); }
.option.is-checked .ind.radio { background: var(--surface); box-shadow: inset 0 0 0 4px var(--accent); }
.option.is-checked .ind svg { opacity: 1; }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.option.is-disabled { opacity: .5; cursor: not-allowed; }

.other-input { margin-top: 8px; }

.input, .textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale .option { justify-content: center; padding: 14px 0; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.scale .option .ind { display: none; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.scale-labels span:last-child { text-align: right; }

.consent { font-size: 15px; }

.q.has-error .option:not(.is-checked) { border-color: color-mix(in srgb, var(--error) 45%, var(--line)); }
.q.has-error .input, .q.has-error .textarea { border-color: var(--error); }
.error { display: flex; align-items: center; gap: 6px; color: var(--error); font-size: 14px; font-weight: 550; margin: 8px 0 0; }
.error svg { width: 16px; height: 16px; flex: none; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* Navigation */
.nav { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 10px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 16px; background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.nav .btn-primary { flex: 1; }
.nav .btn-ghost { flex: none; padding-left: 16px; padding-right: 16px; }

.banner { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; margin: 0 0 14px; background: var(--error-soft); color: var(--error); font-weight: 550; }

/* Done */
.done { text-align: center; }
.done-icon { width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.done-icon svg { width: 34px; height: 34px; }
.done h1 { font-size: 26px; margin: 0 0 10px; letter-spacing: -.02em; }
.done p { color: var(--ink-2); margin: 0 0 22px; }
.share { display: grid; gap: 10px; }
.btn-whatsapp { background: #1fa855; color: #fff; }
.btn-whatsapp:hover { background: #1a9049; }
.btn-facebook { background: #1877f2; color: #fff; }
.btn-facebook:hover { background: #1466d2; }
.linkish { appearance: none; background: none; border: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: 18px; font-size: 14px; padding: 8px; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.footer { padding: 8px 16px 28px; text-align: center; font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }

@media (min-width: 560px) {
  .card { padding: 32px 32px; }
  .intro h1 { font-size: 30px; }
  .share { grid-template-columns: 1fr 1fr; }
  .share .btn-ghost { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
