/* SystèmeDrone — feuille de style du calculateur
   Une feuille de papier posée sur une page claire : pas de carte flottante,
   une seule famille de caractères, une seule couleur forte. */

:root {
  --page: #e8ebe4;        /* lichen pâle */
  --paper: #ffffff;
  --ink: #2b333b;         /* ardoise */
  --ink-soft: #5d666d;
  --line: #c3c9c0;
  --line-strong: #8f978c;
  --moss: #4f6b3c;        /* choix retenu, bouton principal */
  --moss-dark: #3e5530;
  --tile: #7a4a2e;        /* le prix, et lui seul */
  --alert: #8c3b2e;
  --radius: 4px;
  --col: 600px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--page); }

body {
  font-family: "Bitter", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Colonne centrée, texte aligné à gauche ────────────────────────────── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: min(var(--col), 100% - 32px);
  margin: 0 auto;
  padding: 40px 0 32px;
}
@media (max-width: 520px) { .app { padding-top: 28px; } }

/* En-tête : la marque et ce qu'elle fait, rien d'autre */
header { margin-bottom: 40px; }
header h1 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.tagline { color: var(--ink-soft); font-size: 15px; margin-top: 2px; }

/* Le formulaire occupe l'espace restant et se centre verticalement */
#devis { flex: 1; }
.stage { width: 100%; }

/* Progression : une ligne fine, et le compte en toutes lettres */
.progress { margin-bottom: 32px; }
.steps-count { font-size: 15px; color: var(--ink-soft); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.progress .track { height: 2px; background: var(--line); }
.progress .bar {
  height: 100%; width: 16.66%; background: var(--moss);
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}
@media (prefers-reduced-motion: reduce) { .progress .bar { transition: none; } }

/* ── Une étape ─────────────────────────────────────────────────────────── */
.step { animation: enter .3s cubic-bezier(.2, .7, .3, 1) both; }
.step[hidden] { display: none; }
@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .step { animation: none; } }

.step h2 {
  font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -.015em;
  margin-bottom: 28px; max-width: 18em;
}
@media (max-width: 520px) { .step h2 { font-size: 25px; margin-bottom: 22px; } }

/* Choix : des lignes empilées, pleine largeur, comme les cases d'un formulaire */
.seg { display: flex; flex-direction: column; gap: 10px; }
.seg button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 16px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 18px; font-weight: 600; line-height: 1.3;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.seg button small { display: block; font-weight: 400; font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
.seg button:hover { border-color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: #fff; }
.seg button[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.seg button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .seg button { transition: none; } }

/* Champ « Autre » : précision du matériau */
.precision { margin-top: 22px; }
.precision[hidden] { display: none; }

/* ── Champs ────────────────────────────────────────────────────────────── */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.hint { color: var(--ink-soft); font-weight: 400; font-size: 15px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.row + .field, .field + .row { margin-top: 22px; }

input {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; color: var(--ink); background: var(--paper);
}
input::placeholder { color: #a0a7a3; }
input:focus { outline: 2px solid var(--moss); outline-offset: -1px; border-color: var(--moss); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

.suffix { position: relative; }
.suffix input { padding-right: 48px; }
.suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }

/* ── Résultat : le prix est le seul moment fort de la page ─────────────── */
.result .price {
  font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.02em;
  color: var(--tile); font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
@media (max-width: 520px) { .result .price { font-size: 52px; } }
.result .price-sub { color: var(--ink-soft); font-size: 16px; margin-bottom: 28px; }

.breakdown { border-top: 1px solid var(--ink); }
.breakdown .line {
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px;
}
.breakdown .line b { font-weight: 400; font-variant-numeric: tabular-nums; }
.breakdown .muted { color: var(--ink-soft); }
.breakdown .total { border-bottom: 1px solid var(--ink); font-weight: 600; }
.breakdown .total b { font-weight: 600; }

.note { font-size: 14px; color: var(--ink-soft); margin-top: 18px; max-width: 34em; }

/* Erreur de validation : une phrase, pas une boîte */
.error { margin-top: 18px; font-size: 16px; color: var(--alert); }
.error[hidden] { display: none; }

/* ── Navigation ────────────────────────────────────────────────────────── */
.nav { display: flex; gap: 12px; margin-top: 32px; }
.nav:empty { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; cursor: pointer;
  border: 1px solid var(--moss); border-radius: var(--radius);
  background: var(--moss); color: #fff;
  font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2;
  transition: background-color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--moss-dark); border-color: var(--moss-dark); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: transparent; border-color: var(--ink); }
.btn[hidden] { display: none; }
@media (max-width: 520px) {
  .nav { flex-direction: column; gap: 6px; }   /* sur mobile : le bouton principal au-dessus, pleine largeur */
  .btn.ghost { order: 1; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
  .btn.ghost:hover { border-color: transparent; text-decoration-color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ── Pied de page ──────────────────────────────────────────────────────── */
footer {
  margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 24px;
  font-size: 14px; color: var(--ink-soft);
}
footer a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
footer a:hover { text-decoration-color: var(--ink); }
