/* CD Menuiserie — page Contact : formulaire de demande.
   Le formulaire est une feuille de cartouche : projet à cocher en pictogrammes, choix rapides, coordonnées. */

.c-grille {
  margin-top: 72px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px;
  align-items: start;
}

/* ---------- Feuille du formulaire ---------- */
.demande {
  background: var(--blanc);
  border: 1px solid var(--filet-fort);
}
.demande fieldset { margin: 0; padding: 36px 40px 40px; border: 0; min-width: 0; }
.demande fieldset + fieldset { border-top: 1px solid var(--filet-cartouche); }
.demande legend {
  float: left; width: 100%; padding: 0; margin: 0 0 24px;
  font-stretch: 115%; font-weight: 700; letter-spacing: -.01em;
  font-size: 24px; line-height: 1.15;
}
.demande legend + * { clear: both; }
.question { margin: 28px 0 12px; font-weight: 600; font-size: 16px; line-height: 1.35; }
legend + .question { margin-top: 0; }
.question .facultatif, .champ .facultatif { font-weight: 400; opacity: .7; }

/* ---------- Cases à pictogramme (plusieurs choix) ---------- */
.tuiles {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
.tuile { position: relative; }
.tuile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tuile label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 112px; padding: 14px 8px 12px;
  border: 1px solid #C4C9CC; border-radius: 2px;
  background: var(--fond);
  text-align: center; font-weight: 500; font-size: 15px; line-height: 1.25;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}
.tuile svg {
  width: 34px; height: 34px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round;
}
.tuile label::after {
  /* coche, en haut à droite */
  content: ""; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bleu) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.5L13 6.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
  transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.4, .5, 1);
}
.tuile:hover label { border-color: var(--anthracite); }
.tuile input:checked + label {
  border-color: var(--bleu); box-shadow: inset 0 0 0 1px var(--bleu);
  background: #EAF0F6; color: var(--bleu);
}
.tuile input:checked + label::after { transform: scale(1); }
.tuile input:focus-visible + label { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* ---------- Choix rapides (un seul choix) ---------- */
.puces { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.puce { position: relative; }
.puce input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.puce label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid #9AA1A5; border-radius: 22px;
  background: var(--blanc);
  font-weight: 500; font-size: 15px; white-space: nowrap; cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}
.puce:hover label { border-color: var(--anthracite); }
.puce input:checked + label { background: var(--anthracite); border-color: var(--anthracite); color: var(--blanc); }
.puce input:focus-visible + label { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* ---------- Champs ---------- */
.champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.demande .champ { margin-bottom: 20px; }
.demande .champ:last-child { margin-bottom: 0; }
.demande .champ input, .demande .champ textarea { background: var(--fond); border-color: #9AA1A5; transition: border-color .15s, background-color .15s; }
.demande .champ input:focus, .demande .champ textarea:focus { background: var(--blanc); outline: 2px solid var(--bleu); outline-offset: 0; border-color: var(--bleu); }
.demande .champ textarea { min-height: 120px; }
.demande .champ input[aria-invalid="true"] { border-color: #B3261E; box-shadow: inset 0 0 0 1px #B3261E; background: var(--blanc); }
.erreur {
  display: flex; gap: 6px; align-items: flex-start;
  margin: 8px 0 0; font-size: 15px; line-height: 1.4; color: #B3261E;
}
.erreur[hidden] { display: none; }
.erreur::before {
  content: "!"; flex: none; display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: #B3261E; color: var(--blanc); font-weight: 700; font-size: 12px;
}
.aide { margin: 8px 0 0; font-size: 15px; line-height: 1.4; opacity: .7; }

/* ---------- Envoi ---------- */
.envoi { padding: 28px 40px 32px; border-top: 1px solid var(--filet); background: var(--fond); }
.envoi .btn-envoi { height: 56px; margin: 0; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.envoi .btn-envoi svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.envoi .btn-envoi:hover svg { transform: translateX(3px); }
.recap { margin: 0 0 16px; font-size: 15px; line-height: 1.45; }
.recap strong { font-weight: 600; }
.envoi .note { margin-top: 12px; }

/* Confirmation, après ouverture de la messagerie */
.confirme { padding: 40px; scroll-margin-top: calc(var(--entete) + 24px); }
.confirme[hidden] { display: none; }
.confirme h2 {
  margin: 0 0 12px;
  font-stretch: 115%; font-weight: 700; letter-spacing: -.01em; font-size: 28px; line-height: 1.1;
}
.confirme p { margin: 0 0 12px; font-size: 17px; line-height: 1.55; max-width: 52ch; }
.confirme .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn-second {
  display: inline-flex; align-items: center; height: 48px; padding: 0 20px;
  border: 1px solid var(--anthracite); border-radius: 2px; background: var(--blanc); color: var(--anthracite);
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
}
.btn-second:hover { background: var(--fond); }
.confirme .copie-ok { font-size: 15px; color: var(--bleu); align-self: center; }

/* ---------- Colonne : téléphone, horaires, adresse ---------- */
.c-cote { position: sticky; top: calc(var(--entete) + 32px); }
.c-cote .surtitre { margin: 0 0 6px; }
.c-cote .tel-geant { font-size: clamp(30px, 2.6vw, 38px); }
.c-cote dl { margin: 28px 0 0; border-top: 1px solid var(--filet-fort); }
.c-cote dt { margin: 16px 0 2px; }
.c-cote dd { margin: 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.c-cote dd a { text-underline-offset: 3px; }

.acces { margin-top: 120px; }
.acces .carte { aspect-ratio: 16 / 7; }

/* ---------- Tablette ---------- */
@media (max-width: 1000px) {
  .c-grille { grid-template-columns: 1fr; gap: 48px; }
  .c-cote { position: static; }
  .tuiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- Portrait ---------- */
@media (max-width: 760px) {
  .c-grille { margin-top: 40px; }
  .demande { margin: 0 calc(-1 * var(--gouttiere)); border-left: 0; border-right: 0; }
  .demande fieldset { padding: 28px var(--gouttiere) 32px; }
  .envoi, .confirme { padding-left: var(--gouttiere); padding-right: var(--gouttiere); }
  .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tuile label { min-height: 96px; font-size: 14px; padding: 12px 4px 10px; }
  /* « Autre chose » sur toute la largeur plutôt que seul en bout de rangée */
  .tuile:last-child { grid-column: 1 / -1; }
  .tuile:last-child label { flex-direction: row; min-height: 56px; }
  .champs-2 { grid-template-columns: 1fr; }
  .acces { margin-top: 88px; }
  .acces .carte { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  .tuile label::after, .envoi .btn-envoi svg { transition: none; }
}
