/* ============================================================
   Je vends mon terrain.be — design system global (mobile-first)
   Composants disponibles :
   .container | .btn (--primary --accent --ghost --sm --lg --block)
   .site-header .site-nav | .site-footer | .cookie-banner
   .hero .hero__title .hero__subtitle
   .section .section--alt .section__title .section__intro
   .card .cards-grid | .step-list .step-item
   .badge | .notice | .faq .faq__item .faq__q .faq__a
   Formulaires : .form-group label input select textarea .form-error
   .checkbox-line | .option-grid .option-card | .chip-grid .chip
   Wizard : .wizard .wizard__progress .wizard__bar .wizard__step
            .wizard__title .wizard__nav .wizard__hint
   ============================================================ */

:root {
  --green: #1e6b46;
  --green-dark: #145033;
  --green-soft: #e3efe7;
  --accent: #e8a33d;
  --accent-dark: #c9860f;
  --bg: #f7f6f2;
  --white: #ffffff;
  --ink: #20302a;
  --ink-soft: #5a6a62;
  --line: #dde3de;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(32, 48, 42, 0.08);
  --shadow-lg: 0 8px 30px rgba(32, 48, 42, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }

h1, h2, h3 { line-height: 1.25; color: var(--ink); margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
@media (min-width: 768px) {
  h1 { font-size: 2.6rem; }
  h2 { font-size: 1.8rem; }
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 18px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 14px 26px;
  border: none;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--accent { background: var(--accent); color: #3a2a08; box-shadow: var(--shadow); }
.btn--accent:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--green); border: 2px solid var(--line); }
.btn--ghost:hover { border-color: var(--green); }
.btn--sm { padding: 9px 18px; font-size: 0.92rem; }
.btn--lg { padding: 17px 34px; font-size: 1.12rem; }
.btn--block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo__mark { flex: 0 0 auto; }
.logo__text { font-weight: 800; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }
.logo__tld { color: var(--accent-dark); }
.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav__link { text-decoration: none; font-weight: 600; color: var(--ink-soft); font-size: 0.95rem; }
.site-nav__link:hover { color: var(--green); }
@media (max-width: 520px) {
  .site-nav__link { display: none; }
  .logo__text { font-size: 0.98rem; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--green) 0%, var(--green-dark) 90%);
  color: #fff;
  padding: 44px 0 120px;
  text-align: center;
}
.hero__title { color: #fff; margin-bottom: 10px; }
.hero__subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  max-width: 620px;
  margin: 0 auto 22px;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}
.hero__trust span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: 52px 0; }
.section--alt { background: var(--white); }
.section__title { text-align: center; }
.section__intro { text-align: center; color: var(--ink-soft); max-width: 640px; margin: 0 auto 34px; }

/* ---------- Cartes ---------- */
.cards-grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 30px; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards-grid--4 { grid-template-columns: repeat(4, 1fr); } .cards-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card__icon { font-size: 1.9rem; line-height: 1; margin-bottom: 10px; }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Étapes (comment ça marche) ---------- */
.step-list { display: grid; gap: 18px; grid-template-columns: 1fr; margin: 30px 0 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 768px) { .step-list { grid-template-columns: repeat(3, 1fr); } }
.step-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  position: relative;
  box-shadow: var(--shadow);
}
.step-item::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.step-item h3 { margin-bottom: 6px; }
.step-item p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Badges & notices ---------- */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--green-soft);
  color: var(--green-dark);
}
.notice {
  background: var(--green-soft);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.95rem;
  margin: 18px 0;
}
.notice--warn { background: #fdf3e3; border-left-color: var(--accent); }

/* ---------- FAQ ---------- */
.faq { max-width: 720px; margin: 30px auto 0; }
.faq__item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq__item summary, .faq__q {
  padding: 15px 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 42px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--green);
  font-weight: 800;
}
.faq__item[open] summary::after { content: "–"; }
.faq__a { padding: 0 18px 15px; color: var(--ink-soft); }

/* ---------- Formulaires ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 0.98rem; }
.form-group .label-hint { font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], select, textarea {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 0.88rem; margin-top: 5px; display: none; }
.form-error.is-visible { display: block; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 62px; }
.input-suffix::after {
  content: attr(data-suffix);
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-weight: 600;
  pointer-events: none;
}
.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 400;
}
.checkbox-line input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--green); }

/* ---------- Autocomplete localité ---------- */
.autocomplete { position: relative; }
.autocomplete__list {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 30;
  margin: 0; padding: 0;
  list-style: none;
}
.autocomplete__item { padding: 11px 14px; cursor: pointer; font-size: 0.98rem; }
.autocomplete__item:hover, .autocomplete__item.is-active { background: var(--green-soft); }
.autocomplete__item .muted { color: var(--ink-soft); font-size: 0.86rem; }

/* ---------- Choix pictos / cases ---------- */
.option-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .option-grid { grid-template-columns: repeat(3, 1fr); } }
.option-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.12s ease, background 0.12s ease;
  display: block;
}
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card .option-card__icon { display: block; font-size: 1.7rem; margin-bottom: 6px; }
.option-card:hover { border-color: var(--green); }
.option-card.is-selected { border-color: var(--green); background: var(--green-soft); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip.is-selected { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.chip.is-selected::before { content: "✓"; font-weight: 800; color: var(--green); }

/* ---------- Wizard ---------- */
.wizard-wrap {
  max-width: 640px;
  margin: -80px auto 0;
  padding: 0 18px 40px;
  position: relative;
  z-index: 5;
}
.wizard {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 26px 20px 24px;
}
@media (min-width: 640px) { .wizard { padding: 34px 38px 30px; } }
.wizard__progress { margin-bottom: 22px; }
.wizard__progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}
.wizard__bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.wizard__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #2e8f5f);
  border-radius: 999px;
  width: 0;
  transition: width 0.3s ease;
}
.wizard__step { display: none; }
.wizard__step.is-active { display: block; animation: wizfade 0.25s ease; }
@keyframes wizfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wizard__title { font-size: 1.25rem; margin-bottom: 4px; }
.wizard__hint { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 18px; }
.wizard__nav { display: flex; gap: 10px; margin-top: 24px; }
.wizard__nav .btn { flex: 1; }
.wizard__nav .btn--back { flex: 0 0 auto; }
.wizard__secure {
  text-align: center;
  font-size: 0.83rem;
  color: var(--ink-soft);
  margin: 14px 0 0;
}
.wizard__secure::before { content: "🔒 "; }

/* ---------- Résultat / merci ---------- */
.result-card {
  max-width: 640px;
  margin: 40px auto;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 34px 26px;
  text-align: center;
}
.result-card__estimate {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--green-dark);
  margin: 12px 0;
}
.result-card__range-label { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Bandeau cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--white);
  border-top: 3px solid var(--green);
  box-shadow: 0 -6px 24px rgba(32, 48, 42, 0.18);
  padding: 16px 18px;
}
.cookie-banner__inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner__text { margin: 0; font-size: 0.9rem; flex: 1 1 320px; }
.cookie-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 40px 0 26px;
  margin-top: 60px;
}
.site-footer__cta {
  text-align: center;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
}
.site-footer__hook { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0 0 14px; }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: center;
  margin-bottom: 18px;
}
.site-footer__links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.9rem;
}
.site-footer__links a:hover { color: #fff; text-decoration: underline; }
.site-footer__legal { text-align: center; font-size: 0.82rem; color: rgba(255, 255, 255, 0.55); margin: 0; }

/* ---------- Pages de contenu ---------- */
.page-content { max-width: 760px; margin: 0 auto; padding: 44px 18px 30px; }
.page-content h1 { margin-bottom: 20px; }
.page-content h2 { margin-top: 34px; }
.page-content ul { padding-left: 22px; }

/* ---------- Utilitaires ---------- */
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); border: 0;
}
