:root {
  --bg: #f6f1e7;
  --card: #fffdf8;
  --ink: #2b2118;
  --muted: #74675a;
  --line: #e4d9c6;
  --accent: #b5651d;
  --accent-ink: #ffffff;
  --accent-soft: #f3e3cf;
  --error: #b3261e;
  --error-soft: #fbe9e7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1915;
    --card: #27221c;
    --ink: #f1e9dd;
    --muted: #b3a593;
    --line: #3d352c;
    --accent: #e0954f;
    --accent-ink: #1d1915;
    --accent-soft: #3a2d20;
    --error: #ff8a80;
    --error-soft: #3b2220;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.top { margin: 8px 0 20px; }
.brand { margin: 0; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { margin: 4px 0 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0 0 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin: 0 0 16px;
}
fieldset.card { min-width: 0; }
legend {
  float: left; width: 100%;
  font-size: 19px; font-weight: 700;
  padding: 0 0 4px; margin: 0 0 8px;
  border-bottom: 2px solid var(--accent-soft);
}
legend + * { clear: both; }
.intro p:first-child { margin-top: 0; }
.intro p:last-child { margin-bottom: 0; font-weight: 600; }
.q { padding: 14px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q.sub, .q.cont { border-top: 0; padding-top: 0; }
.label { display: block; margin: 0 0 6px; font-weight: 600; }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; margin-right: 8px; padding: 0 6px;
  border-radius: 13px; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700; vertical-align: 1px;
}
.help { margin: -2px 0 8px; color: var(--muted); font-size: 14px; }
.opts { display: grid; gap: 6px; }
.opt {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: var(--card);
}
.opt:hover { border-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.opt input[type=radio], .opt input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.opt.other .other-text { flex: 1 1 160px; }
input[type=text], input[type=email], input[type=tel], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.opt .other-text { width: auto; padding: 6px 10px; }
.num-wrap { display: flex; align-items: center; gap: 8px; max-width: 260px; }
.suffix { color: var(--muted); white-space: nowrap; }
.grid { display: grid; gap: 10px; }
.grid-row {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; align-items: center;
  padding-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.grid-row:last-child { border-bottom: 0; }
.grid-task { font-size: 15px; }
@media (max-width: 620px) {
  .grid-row { grid-template-columns: 1fr 1fr; }
  .grid-task { grid-column: 1 / -1; font-weight: 600; }
}
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
@media (max-width: 620px) { .contact { grid-template-columns: 1fr; } }
.consent span { font-size: 14px; }
.rgpd p { margin: 0; font-size: 14px; color: var(--muted); }
.rgpd a { color: var(--accent); }
.alert {
  background: var(--error-soft); color: var(--error);
  border: 1px solid var(--error); border-radius: 10px;
  padding: 12px 14px; margin: 0 0 16px; font-weight: 600;
}
.error { color: var(--error); font-size: 14px; margin: 6px 0 0; font-weight: 600; }
.has-error .opt, .opt.has-error { border-color: var(--error); }
.submit { text-align: center; margin-top: 8px; }
button, .btn {
  display: inline-block; padding: 14px 28px; font: inherit; font-weight: 700;
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.07); }
.thanks h2 { color: var(--accent); }
.sig { font-weight: 600; margin-bottom: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Espace admin */
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--accent-soft); border-radius: 10px; padding: 12px; }
.kpi b { display: block; font-size: 24px; }
.free { margin: 0; padding-left: 18px; font-size: 14px; }
.free li { margin: 4px 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 10px 18px; }
code { background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
