:root {
  /* Palette Tandem : encre + terracotta + crème */
  --navy: #333333;         /* encre principale (titres, chrome, bordures actives) */
  --navy-dark: #1f1f1f;
  --accent: #e3654a;       /* terracotta (boutons, accents) */
  --accent-dark: #c9502f;
  --ink: #333333;
  --muted: #888888;
  --line: #e8e4dc;
  --bg: #f5f1e9;           /* crème */
  --card: #ffffff;
  --ok: #2e7d4f;
  --err: #b3261e;
  --err-bg: #fdecea;
  --focus: #9ec5fe;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  padding-inline: 16px;
  padding-block: 0 48px;
}

.topbar {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 10px;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 0; }
.brandmark { font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: 15px; color: var(--ink); }
.brand { font-weight: 700; color: var(--navy); letter-spacing: .2px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.lang-toggle {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 14px; color: var(--navy); cursor: pointer;
}
.lang-toggle:hover { border-color: var(--navy); }

.progress { max-width: 760px; margin: 0 auto 14px; }
.progress-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress-label { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }

main { max-width: 760px; margin: 0 auto; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .06);
  padding: 28px 28px 24px;
}
@media (max-width: 480px) { .card { padding: 20px 16px; } body { font-size: 16px; } }

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; color: var(--navy); }
h2 { font-size: 21px; line-height: 1.3; margin: 0 0 6px; color: var(--navy); }
.block-intro { color: var(--muted); margin: 0 0 22px; font-size: 15.5px; }
.notice {
  background: #f5f1e9; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin: 16px 0; font-size: 15px;
}
.notice.warn { background: #fff6ec; }
.meta { color: var(--muted); font-size: 14.5px; }

.question { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.question legend, .question .q-label {
  font-weight: 600; padding: 0; margin: 0 0 10px; display: block; line-height: 1.4;
}
.q-num { color: var(--muted); font-weight: 500; margin-right: 6px; }
.q-help { color: var(--muted); font-size: 14.5px; margin: -4px 0 10px; }
.q-context {
  white-space: pre-wrap; background: #faf7f1; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin: 0 0 12px; font-size: 15.5px;
}
.q-question { font-weight: 600; margin: 0 0 10px; }
.optional { font-weight: 400; color: var(--muted); font-size: 14px; }

.options { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: #cfc7ba; }
.opt:has(input:checked) { border-color: var(--navy); background: #f6efe6; }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.opt input { margin: 4px 0 0; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--navy); }
.opt span { flex: 1; }
.opt.nsp { border-style: dashed; color: var(--muted); }

.precision { margin: 4px 0 4px 44px; }
input[type="text"], input[type="email"], textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input[type="text"]:focus, input[type="email"]:focus, textarea:focus { outline: 3px solid var(--focus); border-color: var(--navy); }
textarea { min-height: 96px; resize: vertical; }
.textarea-long textarea { min-height: 120px; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale label {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600;
}
.scale label:has(input:checked) { border-color: var(--navy); background: #f6efe6; }
.scale label:has(input:focus-visible) { outline: 3px solid var(--focus); }
.scale input { accent-color: var(--navy); width: 18px; height: 18px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }

.tool-grid { display: grid; gap: 10px; }
.tool-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tool-row .tool-name { font-weight: 600; margin-bottom: 8px; }
.tool-row .options { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tool-row .opt { padding: 8px 10px; font-size: 15px; }

.error-msg { color: var(--err); font-size: 14.5px; margin: 8px 0 0; display: none; }
.question.invalid .error-msg { display: block; }
.question.invalid > legend, .question.invalid > .q-label { color: var(--err); }
.question.invalid .opt, .question.invalid .scale label { border-color: #e6a39e; }

.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.btn {
  font: inherit; font-weight: 600; border-radius: 10px; padding: 12px 22px; cursor: pointer; border: 1px solid transparent;
  min-width: 140px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--navy); }
.btn-link { background: none; border: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.btn:focus-visible, .btn-link:focus-visible, .lang-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.global-error {
  background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; display: none;
}
.global-error.show { display: block; }

.thanks { text-align: center; padding: 20px 0; }
.thanks .check {
  width: 64px; height: 64px; border-radius: 50%; background: #e6f4ec; color: var(--ok); display: inline-flex;
  align-items: center; justify-content: center; font-size: 32px; margin-bottom: 16px;
}
.footer { max-width: 760px; margin: 22px auto 0; color: var(--muted); font-size: 13px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
