/* =====================================================================
   MAISON SÉQUANE · DEVIS ET CONTACT, PUIS PAGE DE REMERCIEMENT
   ---------------------------------------------------------------------
   Univers Maison : crème, brun, Fraunces pour les titres. Un formulaire
   classique à gauche ; à droite, la carte brune « Votre demande » résume
   la demande en une phrase pendant la saisie et porte l'envoi (le même
   principe que la carte jaune du calculateur). Sur téléphone, la carte
   suit les champs. Aucune bibliothèque d'animation sur ces pages : la
   coche de la page de remerciement est une animation CSS, coupée quand
   les animations sont réduites. Les valeurs viennent de tokens.css.
   ===================================================================== */

.devis, .merci { padding-top: 96px; }          /* hauteur de l'en-tête fixe */
.devis [hidden], .merci [hidden] { display: none !important; }

/* ── Haut de page ───────────────────────────────────────────────────── */
.devis-haut { padding-block: var(--espace-3); }
.devis-haut h1 { max-width: 18ch; color: var(--titre); text-wrap: balance; }
.devis-haut__chapo { max-width: 60ch; margin-top: var(--espace-2); font-size: 1.125rem; line-height: 1.6; color: var(--texte-doux); }
.devis-sansjs { max-width: 60ch; margin-top: var(--espace-3); font-size: 1.125rem; line-height: 1.6; }
.js .devis-sansjs { display: none; }
html:not(.js) .devis-formulaire { display: none; }

/* ── Formulaire (à gauche) et carte « Votre demande » (à droite) ────── */
.devis-formulaire {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: var(--espace-4) clamp(32px, 5vw, 96px);
  align-items: start;
  padding-bottom: var(--espace-section);
}
.devis-champs { display: grid; gap: 56px; min-width: 0; max-width: 680px; }

/* Un groupe = un fieldset ; sa légende entre dans la grille (même astuce que le calculateur). */
.devis-groupe { display: grid; gap: var(--espace-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.devis-groupe > legend { float: left; width: 100%; padding: 0; }
.devis-groupe > legend + * { clear: both; }
.devis-legende {
  font-family: var(--police-serif);
  font-weight: 600;
  font-size: var(--taille-titre-3);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--titre);
}
.champ__facultatif {
  font-family: var(--police-texte);
  font-weight: 400;
  font-size: var(--taille-petit);
  letter-spacing: 0;
  color: var(--texte-doux);
}

/* Devis ou question : deux boutons radio en segments. */
.segments {
  display: inline-flex;
  max-width: 100%;
  justify-self: start;
  border: 1px solid var(--ms-brun);
  border-radius: var(--angle-controle);
  background: var(--ms-creme-clair);
}
.segment {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding-inline: 24px;
  font-weight: 600;
  font-size: var(--taille-bouton);
  color: var(--ms-brun);
  cursor: pointer;
  transition: background-color var(--duree-micro) var(--courbe-signature), color var(--duree-micro) var(--courbe-signature);
}
.segment:first-child { border-radius: 2px 0 0 2px; }
.segment:last-child { border-radius: 0 2px 2px 0; }
.segment + .segment { border-left: 1px solid var(--ms-brun); }
.segment input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segment:hover { background: var(--ms-creme); }
.segment:has(input:checked) { background: var(--ms-brun); color: var(--ms-creme); }
.segment:has(input:focus-visible) { z-index: 1; outline: 2px solid var(--ms-brun); outline-offset: 3px; }

/* Vous êtes : quatre cases, une seule choisie (boutons radio natifs). */
.profils { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--espace-1); }
.profil {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 132px;
  padding: 16px 14px 14px;
  border: 1px solid var(--ms-encre-douce);
  border-radius: var(--angle-carte);
  background: var(--ms-creme-clair);
  color: var(--ms-encre);
  cursor: pointer;
  transition: background-color var(--duree-micro) var(--courbe-signature), border-color var(--duree-micro) var(--courbe-signature), color var(--duree-micro) var(--courbe-signature);
}
.profil input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.profil__picto {
  width: 32px; height: 32px;
  margin-bottom: 12px;
  fill: none;
  stroke: var(--ms-brun);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--duree-micro) var(--courbe-signature);
}
.profil__nom { font-family: var(--police-serif); font-weight: 600; font-size: 1.1875rem; line-height: 1.15; color: var(--ms-brun); }
.profil__qui { font-size: var(--taille-petit); line-height: 1.4; color: var(--ms-encre-douce); }
.profil:hover { border-color: var(--ms-brun); }
.profil:has(input:checked) { background: var(--ms-brun); border-color: var(--ms-brun); color: var(--ms-creme); }
.profil:has(input:checked) .profil__nom { color: var(--ms-creme); }
.profil:has(input:checked) .profil__picto { stroke: var(--ms-or-clair); }
.profil:has(input:checked) .profil__qui { color: color-mix(in srgb, var(--ms-creme) 80%, var(--ms-brun)); }
.profil:has(input:focus-visible) { outline: 2px solid var(--ms-brun); outline-offset: 3px; }

/* Champs : largeur à la mesure de ce qu'on y écrit. */
.devis .champ__libelle { font-size: 1rem; }
.devis-champs .champ { max-width: 560px; }
.devis-champs .champ--quantite .champ__zone { max-width: 280px; }
.devis-champs .champ--moyen .champ__zone { max-width: 340px; }
.devis-champs .champ--court .champ__zone { max-width: 220px; }
.devis-champs .champ--message { max-width: none; }
.devis .champ__aide a { color: var(--ms-brun); font-weight: 600; text-underline-offset: 3px; }
.devis .champ__zone--unite .champ__saisie { padding-right: 80px; font-variant-numeric: tabular-nums; }
.devis .champ__unite {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--texte-doux);
  pointer-events: none;
}
.devis input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.devis input[type="number"]::-webkit-inner-spin-button,
.devis input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.devis-champs .case { font-size: 0.9375rem; }

/* ── La carte « Votre demande » ─────────────────────────────────────── */
.devis-carte {
  position: sticky;
  top: 112px;
  display: grid;
  gap: var(--espace-2);
  padding: var(--espace-3);
  border-radius: var(--angle-carte);
}
.devis-carte__titre { font-family: var(--police-serif); font-weight: 600; font-size: var(--taille-titre-3); line-height: 1.2; color: var(--titre); }
.devis-recap {
  font-family: var(--police-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--taille-accroche);
  line-height: 1.4;
  color: var(--texte);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.devis-recap strong { font-weight: 600; color: var(--ms-or-clair); }
.devis-recap__qui { margin-top: -8px; font-size: var(--taille-petit); color: var(--texte-doux); overflow-wrap: anywhere; }
.devis-suite {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: var(--espace-2) 0;
  list-style: none;
  counter-reset: etape;
  border-block: 1px solid var(--filet-couleur);
  font-size: var(--taille-petit);
  line-height: 1.5;
}
.devis-suite li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; counter-increment: etape; }
.devis-suite li::before { content: counter(etape); font-family: var(--police-serif); font-weight: 600; color: var(--ms-or-clair); }

/* Case de consentement sur brun : contour crème, coche brune sur or clair. */
.devis-carte .case { font-size: var(--taille-petit); color: var(--texte); }
.devis-carte .case a { color: var(--ms-creme); text-underline-offset: 3px; }
.devis-carte .case input { background: transparent; border-color: color-mix(in srgb, var(--ms-creme) 72%, var(--ms-brun)); }
.devis-carte .case input:checked { background: var(--ms-or-clair); border-color: var(--ms-or-clair); }
.devis-carte .case input::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4 5.6 10.3 11.5 3.8' fill='none' stroke='%2335251C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.devis-carte .case input:focus-visible { outline: 2px solid var(--ms-or-clair); outline-offset: 2px; }
.devis-carte .champ.est-en-erreur .case input { border-color: #FFB4A6; box-shadow: 0 0 0 1px #FFB4A6; }   /* 7:1 sur brun */
.devis-carte .turnstile { max-width: none; }
.devis-carte .formulaire__echec { margin: 0; font-size: var(--taille-petit); font-weight: 600; line-height: 1.5; color: #FFB4A6; }
.devis-envoyer { justify-self: stretch; }
.devis-carte__contact { font-size: var(--taille-petit); color: var(--texte-doux); }
.devis-carte__contact a { color: var(--texte); white-space: nowrap; text-underline-offset: 3px; }

/* ── Page de remerciement ───────────────────────────────────────────── */
.merci__corps { display: grid; justify-items: start; gap: var(--espace-3); padding-block: var(--espace-4) var(--espace-section); }
.merci__pastille { display: block; width: 88px; height: 88px; }
.merci__pastille svg { display: block; width: 100%; height: 100%; overflow: visible; }
.merci__cercle { fill: var(--ms-or-clair); transform-box: fill-box; transform-origin: center; }
.merci__coche { fill: none; stroke: var(--ms-brun-fonce); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 32; stroke-dashoffset: 0; }
html:not([data-mouvement="reduit"]) .merci__cercle { animation: merci-cercle 560ms var(--courbe-signature) both; }
html:not([data-mouvement="reduit"]) .merci__coche { animation: merci-coche 440ms var(--courbe-signature) 360ms both; }
@keyframes merci-cercle { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes merci-coche { from { stroke-dashoffset: 32; } to { stroke-dashoffset: 0; } }
.merci__titre { max-width: 20ch; color: var(--titre); text-wrap: balance; }
.merci__chapo { max-width: 56ch; margin-top: calc(-1 * var(--espace-1)); font-size: 1.125rem; line-height: 1.6; color: var(--texte-doux); }
.merci__etapes { display: grid; gap: var(--espace-2); max-width: 64ch; margin: 0; padding: 0; list-style: none; counter-reset: etape; }
.merci__etapes li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; counter-increment: etape; line-height: 1.6; }
.merci__etapes li::before {
  content: counter(etape);
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--ms-brun);
  border-radius: 50%;
  font-family: var(--police-serif);
  font-weight: 600;
  line-height: 1;
  color: var(--ms-brun);
}
.merci__etapes strong { color: var(--ms-brun); }
.merci__attente { display: grid; gap: var(--espace-1); width: 100%; max-width: 64ch; padding-top: var(--espace-3); border-top: 1px solid var(--filet-couleur); }
.merci__attente h2 { font-family: var(--police-serif); font-weight: 600; font-size: var(--taille-titre-3); line-height: 1.2; color: var(--titre); }

/* Écran d'ordinateur peu haut (portable 768 px, fenêtre réduite) : la carte entière ne tient pas
   sous l'en-tête. Elle colle alors au bas de l'écran, pour que le bouton d'envoi reste visible. */
@media (min-width: 900px) and (max-height: 879px) {
  .devis-carte { top: auto; bottom: var(--espace-2); align-self: end; }
}

/* ── Tablette et téléphone ──────────────────────────────────────────── */
@media (max-width: 1199px) {
  .profils { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profil { min-height: 112px; }
}
@media (max-width: 899px) {
  .devis-formulaire { grid-template-columns: minmax(0, 1fr); }
  .devis-champs { max-width: 680px; }
  .devis-carte { position: relative; top: auto; bottom: auto; max-width: 680px; }   /* relative : le grain de la carte reste dans la carte */
}
@media (max-width: 599px) {
  .devis-champs { gap: 44px; }
  .segments { display: flex; width: 100%; }
  .segment { flex: 1 1 0; padding-inline: 12px; }
  .profil { padding: 14px 12px 12px; }
  .profil__picto { margin-bottom: 8px; }
  .devis-carte { padding: var(--espace-3) var(--espace-2); }
  .merci__pastille { width: 72px; height: 72px; }
}
