:root {
  --navy: #0b1f3a;
  --navy-2: #13305a;
  --accent: #ff7a1a;
  --accent-2: #ffa25c;
  --teal: #0fa3a3;
  --green: #1f9d55;
  --red: #d64545;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #16213a;
  --muted: #5d6b85;
  --line: #e2e7f0;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(11, 31, 58, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--navy-2); }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px; flex: 1; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand small { display: block; font-size: 11px; opacity: .75; line-height: 1.1; }
.brand strong { display: block; font-size: 16px; line-height: 1.1; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: radial-gradient(circle at 50% 50%, var(--accent) 0 44%, transparent 46%), #13305a; flex: none; }
.top nav { display: flex; gap: 10px; align-items: center; }
.top nav a { color: #fff; text-decoration: none; font-size: 14px; }
.foot { padding: 12px 16px 24px; text-align: center; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 600; font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 14px 20px;
  font-size: 17px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .05s, filter .15s;
  min-height: 52px;
}
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.05); }
.btn.small { padding: 8px 14px; font-size: 14px; min-height: 36px; }
.btn.ghost { background: #fff; color: var(--navy); border: 2px solid var(--line); }
.btn.navy { background: var(--navy); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 10px; color: var(--navy); }
h2 { font-size: 22px; line-height: 1.2; margin: 0 0 8px; color: var(--navy); }
h3 { font-size: 17px; margin: 0 0 6px; color: var(--navy); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

/* Accueil */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #1b4a7a 100%); color: #fff; border-radius: 20px; padding: 28px 22px; margin-bottom: 16px; }
.hero h1 { color: #fff; font-size: 30px; }
.hero p { font-size: 17px; opacity: .92; }
.hero .pill { display: inline-block; background: rgba(255,255,255,.14); border-radius: 999px; padding: 5px 12px; font-size: 13px; margin-bottom: 12px; }
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.trust div { background: #fff; border-radius: 12px; padding: 12px; font-size: 14px; border: 1px solid var(--line); }
.trust b { display: block; color: var(--navy); font-size: 15px; }

/* Questionnaire */
.progress { height: 8px; background: #e6ebf3; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 999px; transition: width .3s; }
.step-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.question { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0 0 6px; line-height: 1.25; }
.hint { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px;
  font-size: 17px; cursor: pointer; min-height: 56px; color: var(--text); font-family: inherit;
}
.opt:hover { border-color: var(--accent-2); }
.opt.sel { border-color: var(--accent); background: #fff6ee; }
.opt .box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c6cfdd; flex: none; display: grid; place-items: center; }
.opt.multi .box { border-radius: 6px; }
.opt.sel .box { border-color: var(--accent); background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; }
.opt.sel .box::after { content: "✓"; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 17px; font-family: inherit; background: #fff; color: var(--text);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; }
.actions .btn.ghost { flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; font-family: inherit; color: var(--text); }
.chip.sel { border-color: var(--navy); background: var(--navy); color: #fff; }
.mic { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 15px; cursor: pointer; font-family: inherit; }
.mic.on { border-color: var(--red); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(214,69,69,.35);} 50% { box-shadow: 0 0 0 10px rgba(214,69,69,0);} }

/* Analyse en cours */
.analyse { text-align: center; padding: 30px 10px; }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid #e6ebf3; border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { text-align: left; max-width: 420px; margin: 16px auto; display: flex; flex-direction: column; gap: 8px; }
.steps div { padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.steps div.on { border-color: var(--accent); color: var(--navy); font-weight: 600; }
.steps div.ok { color: var(--green); }
.live { text-align: left; background: #fff; border-radius: 12px; padding: 14px; border: 1px solid var(--line); min-height: 60px; font-size: 15px; color: var(--text); white-space: pre-wrap; }
.live:empty::before { content: "L'assistant rédige votre diagnostic…"; color: var(--muted); }

/* Rapport */
.score-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gauge { width: 130px; height: 130px; flex: none; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .bg { fill: none; stroke: #e6ebf3; stroke-width: 12; }
.gauge .fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.gauge .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--navy); }
.gauge .val small { font-size: 12px; color: var(--muted); font-weight: 600; }
.niveau { display: inline-block; background: #fff6ee; color: #b4500a; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.opp { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; background: #fff; }
.opp .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.opp .num { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.opp h3 { margin: 0; flex: 1; }
.opp .prod { font-size: 13px; color: var(--muted); }
.opp .label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-top: 8px; }
.gains { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gain { background: #eef9f3; color: #176b3b; padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.gain.t { background: #eef4ff; color: #1f3f8c; }
.gain.d { background: #f4f6fa; color: var(--muted); font-weight: 600; }
.hyp { font-size: 12px; color: var(--muted); margin-top: 6px; }
.plan { counter-reset: p; list-style: none; padding: 0; margin: 0; }
.plan li { counter-increment: p; position: relative; padding-left: 38px; margin-bottom: 10px; }
.plan li::before { content: counter(p); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.quote { border-left: 4px solid var(--accent); padding: 10px 14px; background: #fff6ee; border-radius: 0 12px 12px 0; font-size: 18px; font-weight: 600; color: var(--navy); }
.forts { padding-left: 20px; margin: 0; }
.cta { background: linear-gradient(135deg, #0fa3a3, #0b7f8f); color: #fff; }
.cta h2 { color: #fff; }
.cta .field input { border-color: transparent; }
.cta label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; }
.cta label.check input { width: auto; margin-top: 3px; }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr img { width: 140px; height: 140px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.ok-box { background: #eef9f3; border: 1px solid #bfe6cf; color: #176b3b; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.err { background: #fdecec; border: 1px solid #f5bcbc; color: #8f1d1d; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }

/* Catalogue */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.prod-card { background: #fff; border-radius: 16px; border: 1px solid var(--line); padding: 18px; margin-bottom: 12px; }
.prod-card .t { display: flex; align-items: center; gap: 10px; }
.prod-card .t .e { font-size: 28px; }
.prod-card .t h3 { margin: 0; font-size: 18px; }
.prod-card .st { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #eef4ff; color: #1f3f8c; font-weight: 700; margin-left: auto; white-space: nowrap; }
.prod-card .st.adaptable, .prod-card .st.sur_mesure { background: #fff6ee; color: #b4500a; }
.prod-card .st.en_developpement { background: #f4f6fa; color: var(--muted); }
.prod-card ul { padding-left: 20px; margin: 8px 0; font-size: 15px; }
.prod-card details summary { cursor: pointer; color: var(--navy-2); font-weight: 600; }
.prod-card .meta { font-size: 14px; color: var(--muted); margin-top: 8px; }
.prod-card .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.loading { text-align: center; padding: 40px; color: var(--muted); }

@media print {
  .top, .foot, .cta, .no-print, .actions { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .wrap { max-width: none; padding: 0; }
}
