:root {
  --bg: #fbf6ef;
  --card: #ffffff;
  --ink: #2c2a35;
  --muted: #6f6b78;
  --line: #eadfd1;
  --accent: #d9653b;
  --accent-d: #bd5129;
  --accent-soft: #fbe7dd;
  --teal: #2f6f6a;
  --teal-soft: #dcecea;
  --radius: 20px;
  --shadow: 0 10px 40px rgba(120, 80, 40, .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.55;
  display: flex; flex-direction: column; position: relative; overflow-x: hidden;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.blob { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .5; z-index: 0; pointer-events: none; }
.b1 { width: 420px; height: 420px; background: #f7c9b0; top: -140px; right: -120px; }
.b2 { width: 380px; height: 380px; background: #bfe0db; bottom: -140px; left: -120px; }

#app { position: relative; z-index: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 16px 24px; flex: 1; }
.foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: .8rem; padding: 12px 16px 24px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 32px; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-d); background: var(--accent-soft); padding: 5px 12px; border-radius: 99px; margin-bottom: 16px; }
.lead { color: var(--muted); font-size: 1.05rem; }

.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600; color: #fff; background: var(--accent); padding: 14px 28px; border-radius: 99px; font-size: 1rem; transition: transform .15s, background .15s, box-shadow .15s; box-shadow: 0 6px 18px rgba(217, 101, 59, .35); }
.btn:hover { background: var(--accent-d); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; padding: 10px 14px; font-weight: 500; }
.btn.ghost:hover { color: var(--ink); background: transparent; }

.pills { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 28px; }
.pill { font-size: .88rem; color: var(--teal); background: var(--teal-soft); padding: 6px 14px; border-radius: 99px; font-weight: 500; }

/* Formulaire */
.field { margin-bottom: 18px; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email] { width: 100%; font: inherit; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fffdfa; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: var(--muted); margin: 22px 0 8px; }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.consent label { font-weight: 400; margin: 0; }
details.legal { font-size: .82rem; color: var(--muted); margin: 6px 0 22px; }
details.legal summary { cursor: pointer; color: var(--teal); font-weight: 500; }
details.legal div { background: #fbf8f3; border-radius: 12px; padding: 14px 16px; margin-top: 8px; }
details.legal p { margin: 0 0 .6em; }
.err { color: #b3261e; font-size: .85rem; margin-top: 6px; min-height: 1.2em; }

/* Questions */
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: .85rem; color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 26px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #eea06e); border-radius: 99px; transition: width .4s ease; }
.chip { font-weight: 600; color: var(--teal); }
.sec-intro { background: var(--teal-soft); color: #1f504c; padding: 14px 18px; border-radius: 14px; font-size: .93rem; margin-bottom: 22px; }
.sec-intro b { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.1rem; margin-bottom: 2px; }
.qtext { font-family: Fraunces, Georgia, serif; font-size: 1.28rem; font-weight: 500; line-height: 1.4; margin-bottom: 22px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; width: 100%; font: inherit; color: var(--ink); background: #fffdfa; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 18px; cursor: pointer; transition: border-color .15s, background .15s, transform .12s; }
.opt:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(3px); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.qfoot { display: flex; justify-content: space-between; margin-top: 18px; }

/* Chargement */
.loading { text-align: center; padding: 56px 24px; }
.spin { width: 54px; height: 54px; border: 5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Résultats */
.results h1 { font-size: 2rem; }
.meta { background: linear-gradient(135deg, var(--accent-soft), #fff5ee); border-radius: var(--radius); padding: 26px 28px; margin: 22px 0; }
.meta .eyebrow { background: #fff; }
.meta h2 { font-size: 1.6rem; margin-bottom: .4em; }
.meta p:last-child { margin: 0; }
.radar-wrap { display: flex; justify-content: center; margin: 8px 0 4px; }
.radar-wrap svg { width: 100%; max-width: 440px; height: auto; overflow: visible; }
.radar-poly { transform-origin: 50% 50%; animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.scard { border-top: 1px solid var(--line); padding: 24px 0 4px; }
.scard .tag { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); }
.scard h3 { font-size: 1.35rem; margin: 4px 0 8px; }
.scard .intro { font-size: .85rem; color: var(--muted); font-style: italic; }
.mini { display: grid; gap: 8px; margin: 14px 0 6px; }
.mini div { display: grid; grid-template-columns: 170px 1fr 34px; gap: 10px; align-items: center; font-size: .82rem; color: var(--muted); }
.mini .t { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.mini .t i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.closing { background: var(--teal-soft); border-radius: var(--radius); padding: 24px 26px; margin-top: 28px; color: #1f504c; }
.closing p:last-child { margin: 0; }

/* Debug (?debug=1) */
.debug { margin-top: 36px; padding: 20px; background: #fffbe6; border: 2px dashed #e0b400; border-radius: 14px; font-size: .88rem; }

@media (max-width: 560px) {
  .card { padding: 26px 20px; }
  .qtext { font-size: 1.15rem; }
  .mini div { grid-template-columns: 1fr 70px 30px; }
  .results h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
