/* Jaugimo — feuille de style unique (mobile d'abord) */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/poppins-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-600.woff2") format("woff2");
}

:root {
  --accent: #0f5c4a;
  --accent-sombre: #0a4537;
  --accent-clair: #e6f0ec;
  --texte: #14201c;
  --texte-2: #4a5753;
  --fond: #f6f4ee;
  --blanc: #ffffff;
  --touche: #e3b23c;
  --bord: #e5e0d4;
  --bord-champ: #7a857f;
  --erreur: #a4262c;
  --erreur-fond: #fbeaea;
  --rayon: 12px;
  --titre: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --corps: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--corps);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-sombre);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--titre);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--texte-2);
}

.small {
  font-size: 0.8125rem;
}

/* ---------- en-tête et pied de page */

.site-header {
  padding: 14px 16px 6px;
  max-width: 1120px;
  margin: 0 auto;
}

.logo {
  display: inline-block;
  line-height: 0;
}

.logo img {
  height: 34px;
  width: auto;
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px 36px;
  color: var(--texte-2);
  font-size: 0.8125rem;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

/* ---------- accueil */

.home {
  max-width: 1120px;
  margin: 0 auto;
  padding: 6px 16px 8px;
}

.intro h1 {
  font-size: clamp(1.625rem, 6.9vw, 2.75rem);
  line-height: 1.14;
  margin: 2px 0 10px;
}

.intro .sous-titre {
  color: var(--texte-2);
  margin: 0 0 14px;
  max-width: 36rem;
}

.points {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 36rem;
}

.points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 8px;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.points .num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--blanc);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---------- formulaire */

.carte {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20, 32, 28, 0.05), 0 10px 30px rgba(20, 32, 28, 0.05);
}

.form-carte {
  margin-top: 16px;
  padding: 16px 16px 20px;
  scroll-margin-top: 12px;
}

.progression {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8125rem;
  color: var(--texte-2);
  margin: 0 0 8px;
}

.progression h2 {
  font-size: 1.0625rem;
  color: var(--texte);
}

.progression h2:focus {
  outline: none;
}

.barre {
  height: 6px;
  background: #ece7dc;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}

.barre span {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--touche);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.etape h2 {
  font-size: 1.1875rem;
  margin: 0 0 14px;
}

.etape h2:focus {
  outline: none;
}

.etape[hidden] {
  display: none;
}

.champ {
  margin: 0 0 18px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.champ > label,
.champ > legend,
.etiquette {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 6px;
  padding: 0;
}

.aide {
  font-size: 0.8125rem;
  color: var(--texte-2);
  margin: 5px 0 0;
}

.saisie {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--texte);
  background: var(--blanc);
  border: 1.5px solid var(--bord-champ);
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
}

.saisie::placeholder {
  color: #6b7671;
}

.saisie:focus-visible {
  outline: 3px solid rgba(15, 92, 74, 0.28);
  outline-offset: 0;
  border-color: var(--accent);
}

.saisie[aria-invalid="true"] {
  border-color: var(--erreur);
}

.avec-unite {
  position: relative;
}

.avec-unite .saisie {
  padding-right: 52px;
}

.avec-unite .unite {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texte-2);
  pointer-events: none;
}

.deux-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.erreur-champ {
  color: var(--erreur);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 6px 0 0;
}

.erreur-champ:empty {
  display: none;
}

.erreur-globale {
  background: var(--erreur-fond);
  color: var(--erreur);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.erreur-globale:empty {
  display: none;
}

/* choix en cartes (boutons radio) */

.choix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choix.trois {
  grid-template-columns: 1fr 1fr 1fr;
}

.choix.pile {
  grid-template-columns: 1fr;
}

.choix input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choix label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  background: var(--blanc);
  border: 1.5px solid var(--bord-champ);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.choix label::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--bord-champ);
  border-radius: 50%;
  background: var(--blanc);
}

.choix.trois label {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 10px 6px;
}

.choix input:checked + label {
  border-color: var(--accent);
  background: var(--accent-clair);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-sombre);
}

.choix input:checked + label::before {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 4px, var(--blanc) 5px);
}

.choix input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choix input[aria-invalid="true"] + label {
  border-color: var(--erreur);
}

/* case à cocher */

.case {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 4px 0 18px;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.case input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

/* boutons */

.actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 10px;
  border: 0;
  font-family: var(--corps);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  flex: 1;
  padding: 0 12px;
  background: var(--accent);
  color: var(--blanc);
}

.btn-primary:hover {
  background: var(--accent-sombre);
  color: var(--blanc);
}

.btn-primary[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn-secondaire {
  background: var(--blanc);
  color: var(--accent);
  border: 1.5px solid var(--bord-champ);
  padding: 0 14px;
}

.mention {
  font-size: 0.8125rem;
  color: var(--texte-2);
  margin: 14px 0 0;
  line-height: 1.45;
}

/* suggestions d'adresse */

.combo {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--blanc);
  border: 1.5px solid var(--bord-champ);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(20, 32, 28, 0.12);
  max-height: 290px;
  overflow-y: auto;
}

.suggestions[hidden] {
  display: none;
}

.suggestions li {
  padding: 10px 14px;
  cursor: pointer;
  line-height: 1.3;
}

.suggestions li small {
  display: block;
  color: var(--texte-2);
  font-size: 0.8125rem;
  margin-top: 2px;
}

.suggestions li[aria-selected="true"],
.suggestions li:hover {
  background: var(--accent-clair);
}

.suggestions li.info {
  cursor: default;
  color: var(--texte-2);
  font-size: 0.875rem;
}

.suggestions li.info:hover {
  background: none;
}

/* ---------- page résultat */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 8px;
}

.page h1 {
  font-size: clamp(1.625rem, 6vw, 2.25rem);
  margin: 4px 0 8px;
}

.page h2 {
  font-size: 1.25rem;
  margin: 32px 0 10px;
}

.resume {
  margin: 0 0 18px;
  color: var(--texte-2);
}

.resume strong {
  color: var(--texte);
  font-weight: 600;
}

.estimation {
  padding: 20px 18px;
}

.estimation .etiquette-est {
  font-family: var(--corps);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--accent);
  font-size: 0.9375rem;
  margin: 0 0 6px;
}

.estimation p {
  margin: 0 0 4px;
}

.methode p {
  margin: 0 0 6px;
}

.prix {
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(2.25rem, 11vw, 3rem);
  line-height: 1.1;
  margin: 0;
}

.prix span {
  box-shadow: inset 0 -0.28em 0 var(--touche);
  padding: 0 2px;
}

.estimation .fourchette {
  margin: 10px 0 2px;
}

.methode {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--bord);
  font-size: 0.875rem;
  color: var(--texte-2);
}

.methode ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

td {
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bord);
  text-align: right;
  vertical-align: top;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--texte-2);
  vertical-align: bottom;
}

tbody th {
  font-weight: 400;
}

.reperes {
  font-size: 0.875rem;
}

.reperes th,
.reperes td {
  padding: 9px 10px;
}

.reperes td {
  white-space: nowrap;
}

.reperes small {
  display: block;
  font-size: 0.75rem;
}

.estimateurs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.estimateurs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
}

.estimateurs .nom {
  font-weight: 600;
}

.estimateurs .nom small {
  display: block;
  font-weight: 400;
  color: var(--texte-2);
  font-size: 0.8125rem;
}

.estimateurs a {
  flex: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 8px 4px;
}

.note {
  font-size: 0.875rem;
  color: var(--texte-2);
  margin: 10px 0 0;
}

.chargement {
  padding: 28px 18px;
  text-align: center;
  color: var(--texte-2);
}

/* ---------- pages de texte */

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: 8px 16px 8px;
}

.doc h1 {
  font-size: clamp(1.625rem, 6vw, 2.25rem);
  margin: 8px 0 16px;
}

.doc h2 {
  font-size: 1.125rem;
  margin: 28px 0 8px;
}

.doc p,
.doc li {
  max-width: 40rem;
}

/* ---------- statistiques */

.stats {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 40px;
}

.stats h1 {
  font-size: 1.75rem;
  margin: 8px 0 6px;
}

.stats h2 {
  font-size: 1.125rem;
  margin: 28px 0 10px;
}

.stats table {
  min-width: 760px;
  font-size: 0.875rem;
}

.stats tr.total {
  background: #f3f1ea;
}

.stats .btn {
  min-height: 46px;
  margin: 8px 0 0;
}

/* ---------- écrans larges */

@media (min-width: 640px) {
  .estimateurs {
    grid-template-columns: 1fr 1fr;
  }
  .logo img {
    height: 38px;
  }
}

@media (min-width: 960px) {
  .site-header {
    padding: 22px 24px 6px;
  }
  .home {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
    align-items: start;
    padding: 40px 24px 24px;
  }
  .intro {
    padding-top: 28px;
  }
  .intro .sous-titre {
    font-size: 1.0625rem;
    margin-bottom: 22px;
  }
  .points li {
    font-size: 1rem;
  }
  .form-carte {
    margin-top: 0;
    padding: 26px 26px 28px;
  }
  .site-footer {
    padding: 40px 24px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
