/* Fontes auto-hébergées (fontes variables, subset latin — accents FR inclus).
   Pas d'appel à Google Fonts : plus rapide sur la 4G de la foire, et RGPD-clean. */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/montserrat-var.woff2') format('woff2');
}

:root {
  --forest: #1E3A2F;
  --forest-light: #2e5745;
  --wheat: #E8C547;
  --wheat-dark: #c9a52e;
  --offwhite: #FDFAF4;
  --ink: #1E3A2F;
  --ink-soft: #5b6b62;
  --line: #e4ddc9;
  --danger: #b8442f;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(30, 58, 47, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--offwhite);
  color: var(--ink);
  font-family: 'Montserrat', -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 32px;
}

.topbar {
  width: 100%;
  max-width: 560px;
  padding: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .brand {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--forest);
}

.topbar .brand span { color: var(--wheat-dark); }

.progress-track {
  width: 100%;
  max-width: 560px;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--wheat);
  border-radius: 999px;
  transition: width 0.35s ease;
  width: 0%;
}

.step-count {
  width: 100%;
  max-width: 560px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
}

.step { display: none; animation: fadein 0.28s ease; }
.step.active { display: block; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1.hero-title {
  font-family: 'Lora', serif;
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--forest);
}

.hero-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  line-height: 1.5;
}

.q-text {
  font-family: 'Lora', serif;
  font-size: 19px;
  line-height: 1.4;
  margin: 0 0 6px;
  color: var(--forest);
}

.q-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.option {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--offwhite);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.option:active { transform: scale(0.99); }

.option:focus-visible {
  outline: 3px solid var(--wheat-dark);
  outline-offset: 2px;
}

.option.selected {
  border-color: var(--forest);
  background: #eef4f0;
  font-weight: 600;
}

.option .mark {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option.multi .mark { border-radius: 5px; }

.option.selected .mark {
  border-color: var(--forest);
  background: var(--forest);
}

.option.selected .mark::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

.option.multi.selected .mark::after { border-radius: 1px; }

.branch-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.branch-btn {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--offwhite);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.branch-btn:active { transform: scale(0.99); }
.branch-btn .emoji { font-size: 24px; margin-bottom: 6px; display: block; }
.branch-btn .label { font-family: 'Lora', serif; font-size: 17px; color: var(--forest); font-weight: 600; }
.branch-btn:hover { border-color: var(--forest); }

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 6px;
}

.field .field-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 16px; /* >= 16px : évite l'auto-zoom iOS au focus, sans bloquer le zoom global */
  font-family: 'Montserrat', sans-serif;
  background: var(--offwhite);
}

.field input:focus {
  outline: none;
  border-color: var(--forest);
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 16px;
}

.consent input { margin-top: 3px; flex: none; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  min-height: 48px;
}

.btn-primary {
  background: var(--forest);
  color: #fff;
  flex: 1;
}

.btn-primary:disabled {
  background: #b9c4bd;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 14px 10px;
}

.error-msg {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 8px;
  display: none;
}

.error-msg.show { display: block; }

.thanks {
  text-align: center;
  padding: 20px 0 4px;
}

.thanks .big-emoji { font-size: 44px; margin-bottom: 12px; }
.thanks h2 { font-family: 'Lora', serif; color: var(--forest); margin: 0 0 10px; }
.thanks p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

.offline-banner {
  background: #fff3e0;
  border: 1px solid #f0c987;
  color: #8a5a12;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 14px;
  display: none;
}
.offline-banner.show { display: block; }

@media (max-width: 400px) {
  .card { padding: 22px 18px 18px; }
  h1.hero-title { font-size: 21px; }
  .q-text { font-size: 17px; }
}
