:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #0e1116;
  --muted: #5d6573;
  --faint: #8a919c;
  --line: #e8e6df;
  --accent: #0c7a5c;
  --accent-ink: #075340;
  --accent-soft: #e6f2ed;
  --bubble-in: #ffffff;
  --bubble-out: #d9f5e3;
  --chat-bg: #efeae2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(14, 17, 22, .04), 0 12px 32px -12px rgba(14, 17, 22, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- En-tête ---------- */
header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 250, 247, .85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 28px; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; text-decoration: none;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #22272f; transform: translateY(-1px); }
.btn.small { padding: 9px 16px; font-size: 14px; }
nav .btn { color: #fff; }
.btn-ghost {
  display: inline-flex; align-items: center; padding: 13px 18px; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 15px;
}
.btn-ghost:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero .wrap > *, .calc > *, .cards > *, .problem > *, .steps > * { min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 {
  font-family: "Instrument Serif", Georgia, serif; font-weight: 400;
  font-size: clamp(42px, 6vw, 68px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 22px;
}
h1 em { font-style: italic; color: var(--accent); }
.lead { font-size: 19px; color: var(--muted); max-width: 540px; margin: 0 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reassure { margin-top: 22px; font-size: 14px; color: var(--faint); }

/* ---------- Téléphone ---------- */
.phone {
  width: 100%; max-width: 340px; margin: 0 auto;
  background: var(--ink); border-radius: 44px; padding: 12px;
  box-shadow: 0 40px 80px -30px rgba(14, 17, 22, .45);
}
.screen { background: var(--chat-bg); border-radius: 34px; overflow: hidden; }
.chat-head {
  background: #075e54; color: #fff; padding: 18px 16px 12px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #25d366; color: #063;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.chat-head strong { display: block; font-size: 15px; line-height: 1.2; }
.chat-head small { font-size: 12px; opacity: .8; }
.chat { height: 430px; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.day { align-self: center; background: #e1f2fb; color: #3b4a54; font-size: 11px; padding: 4px 10px; border-radius: 8px; margin-bottom: 4px; }
.msg {
  max-width: 82%; padding: 8px 10px 6px; border-radius: 10px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
  opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease;
}
.msg.show { opacity: 1; transform: none; }
.msg time { display: block; text-align: right; font-size: 10px; color: #667781; margin-top: 2px; }
.msg.in { align-self: flex-start; background: var(--bubble-in); border-top-left-radius: 2px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 2px; }
.msg.photo .pic {
  height: 92px; border-radius: 6px; margin-bottom: 6px;
  background: linear-gradient(135deg, #9fb3c0, #6f8796);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px;
}
.typing { align-self: flex-end; background: var(--bubble-out); border-radius: 10px; padding: 10px 12px; display: none; gap: 4px; }
.typing.show { display: flex; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #5b8a72; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------- Sections ---------- */
section.block { padding: 88px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 12px; }
h2 {
  font-family: "Instrument Serif", Georgia, serif; font-weight: 400;
  font-size: clamp(34px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -.015em; margin: 0 0 16px;
}
.section-lead { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 0 48px; }

.problem { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.problem div { border-top: 2px solid var(--ink); padding-top: 18px; }
.problem h3 { font-size: 18px; margin: 0 0 8px; }
.problem p { color: var(--muted); margin: 0; font-size: 16px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
section.block:not(.alt) .card { background: var(--surface); box-shadow: var(--shadow); }
.icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -.01em; }
.card p { color: var(--muted); margin: 0; font-size: 16px; }

/* ---------- Calculateur ---------- */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.calc-inputs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.field { margin-bottom: 26px; }
.field:last-child { margin-bottom: 0; }
.field label { display: flex; justify-content: space-between; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.field output { color: var(--accent); font-variant-numeric: tabular-nums; }
.field small { display: block; color: var(--faint); font-size: 13px; margin-top: 6px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.calc-result {
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 36px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
}
.calc-result .label { color: #aab2bd; font-size: 15px; margin: 0 0 6px; }
.big {
  font-family: "Instrument Serif", Georgia, serif; font-size: clamp(48px, 6vw, 72px); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.calc-result .detail { color: #cfd5dc; font-size: 15px; margin: 10px 0 0; }
.calc-result .note { color: #8f98a3; font-size: 13px; margin: 0; }

/* ---------- Étapes ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { counter-increment: s; }
.step::before {
  content: "0" counter(s); display: block;
  font-family: "Instrument Serif", Georgia, serif; font-size: 44px; color: var(--accent); line-height: 1; margin-bottom: 14px;
}
.step h3 { font-size: 18px; margin: 0 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: 16px; }

/* ---------- CTA final ---------- */
.final { text-align: center; }
.final .section-lead { margin: 0 auto 32px; }

/* ---------- Pages légales ---------- */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(38px, 5vw, 52px); margin: 64px 0 8px; }
.legal h2 { font-family: inherit; font-weight: 700; font-size: 20px; letter-spacing: -.01em; margin: 36px 0 8px; }
.legal p, .legal li { color: #2b3038; }
.legal .maj { color: var(--faint); font-size: 15px; }

/* ---------- Pied de page ---------- */
footer { border-top: 1px solid var(--line); margin-top: 0; padding: 36px 0 48px; color: var(--faint); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
footer a { color: var(--muted); text-decoration: none; margin-right: 20px; }
footer a:hover { color: var(--ink); }
footer p { margin: 4px 0; }
.legal + footer, main.legal ~ footer { margin-top: 64px; }

/* ---------- Mobile ---------- */
@media (max-width: 880px) {
  .hero { padding: 56px 0 48px; }
  .hero .wrap, .calc { grid-template-columns: 1fr; }
  .problem, .cards, .steps { grid-template-columns: 1fr; }
  nav a:not(.btn) { display: none; }
  section.block { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .msg { transition: none; }
  .typing i { animation: none; }
}
