/* ═══════════════════════════════════════════════════════════
   RÉALISATEUR WEB — formulaire.css : formulaire de contact en 3 temps,
   commun à l'accueil et à la page /contact/ (après site.css et typo.css).
   HTML : window.formulaireContactHtml (content.js) ; ergonomie : formulaire.js.
   ═══════════════════════════════════════════════════════════ */

/* ════════════════════════ 4 · FORMULAIRE DE CONTACT ════════════════════════ */

.contact-form { padding: clamp(24px, 3vw, 44px); border-radius: 6px; gap: 30px; }
.f-intro { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-size: 15px; color: var(--ink); margin: 0; }
.f-legend-req { color: var(--ash); font-size: 13px; }
.f-legend-req span, .f-req { color: var(--ash); }

/* étapes */
.f-step { border: 0; margin: 0; padding: 0; display: grid; gap: 16px; min-width: 0; }
.f-legend { display: flex; align-items: baseline; gap: 12px; padding: 0; margin-bottom: 2px; font-size: clamp(19px, 1.5vw, 22px); letter-spacing: -0.01em; font-weight: 500; }
.f-opt { font-size: 13px; color: var(--ash); font-weight: 400; }

/* pastilles du besoin */
.f-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.f-chip { position: relative; cursor: pointer; }
.f-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.f-chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid rgba(var(--ink-rgb), .22); border-radius: 40px; font-size: 15px; color: var(--ink);
  transition: border-color .25s, background-color .25s, color .25s;
}
.f-chip:hover span { border-color: rgba(var(--ink-rgb), .55); }
.f-chip input:checked + span { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.f-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

/* champs : des cases franches, lisibles sur fond sombre */
.contact-form .f-row { gap: 16px; }
.contact-form .f-field { display: grid; gap: 8px; align-content: start; }
.f-lab { font-size: 15px; color: var(--ink); }
.contact-form .f-field input, .contact-form .f-field textarea {
  width: 100%; box-sizing: border-box; min-height: 52px; padding: 14px 16px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: rgba(var(--ink-rgb), .045); border: 1px solid rgba(var(--ink-rgb), .2); border-radius: 4px;
  transition: border-color .25s, background-color .25s, box-shadow .25s;
}
.contact-form .f-field textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.contact-form .f-field input::placeholder, .contact-form .f-field textarea::placeholder { color: rgba(var(--ink-rgb), .5); }
.contact-form .f-field input:hover, .contact-form .f-field textarea:hover { border-color: rgba(var(--ink-rgb), .38); }
.contact-form .f-field input:focus, .contact-form .f-field textarea:focus {
  outline: none; border-color: var(--ink); background: rgba(var(--ink-rgb), .07);
  box-shadow: 0 0 0 3px rgba(var(--ink-rgb), .12);
}
.f-help { font-size: 13px; color: var(--ash); }
.f-err { font-size: 14px; color: var(--ink); min-height: 0; }
.f-err:not(:empty) { display: flex; gap: 8px; align-items: baseline; }
.f-err:not(:empty)::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e40427; transform: translateY(-1px); }
.f-field.is-bad input, .f-field.is-bad textarea { border-color: #e40427; box-shadow: 0 0 0 3px rgba(228, 4, 39, .18); }
.f-field.is-ok input, .f-field.is-ok textarea { border-color: rgba(var(--ink-rgb), .45); }
.f-field.is-ok .f-lab::after { content: ' ✓'; color: var(--ash); }

/* consentement : une vraie case, facile à toucher */
.contact-form .f-consent { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: rgba(var(--ink-rgb), .78); cursor: pointer; position: relative; }
.contact-form .f-consent input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; }
.f-box { flex: none; width: 24px; height: 24px; border: 1px solid rgba(var(--ink-rgb), .4); border-radius: 4px; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.f-box::after { content: ''; width: 10px; height: 5px; border: 2px solid var(--bone); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.f-consent input:checked + .f-box { background: var(--ink); border-color: var(--ink); }
.f-consent input:checked + .f-box::after { opacity: 1; }
.f-consent input:focus-visible + .f-box { outline: 2px solid var(--ink); outline-offset: 3px; }
.f-consent.is-bad .f-box { border-color: #e40427; box-shadow: 0 0 0 3px rgba(228, 4, 39, .18); }
.f-err--consent { margin-top: -18px; padding-left: 38px; }

/* envoi : un bouton franc, et ce qui se passe ensuite */
.f-submit { display: grid; gap: 14px; padding-top: 8px; border-top: 1px solid rgba(var(--ink-rgb), .1); }
.f-send { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 58px; font-size: 13px; margin-top: 14px; }
.f-send span { display: inline-block; transition: transform .4s var(--ease-out); }
.f-send:hover span { transform: translateX(5px); }
.f-send:disabled { opacity: .7; cursor: progress; }
.f-after { font-size: 14px; color: var(--ash); line-height: 1.5; display: grid; gap: 4px; margin: 0; }
.f-after a { color: var(--ink); border-bottom: 1px solid rgba(var(--ink-rgb), .35); }
.f-submit .f-status:empty { display: none; }

/* appel direct (mobile) */
.contact-call { display: none; margin-top: 22px; }

@media (max-width: 900px) {
  /* mobile : titre, appel, FORMULAIRE, puis coordonnées (on ne fait plus défiler l'adresse avant le formulaire) */
  .contact { display: flex; flex-direction: column; gap: 34px; }
  .contact-copy { display: contents; }
  .contact-copy > * { order: 1; }
  .contact-form { order: 2; padding: 22px 18px; }
  .contact .contact-infos { order: 3; margin-top: 0 !important; }   /* accueil seulement */
  .contact-call { display: block; order: 1; margin-top: -10px; }
  .contact-call .btn { width: 100%; justify-content: center; }
  .f-chip span { font-size: 14px; padding: 9px 14px; }
}

/* besoin : choix multiple ; repère d'erreur sur le groupe */
.f-step--besoin .f-help { margin: -8px 0 0; }
.f-chip input:checked + span::after { content: '✓'; font-size: 12px; margin-left: 2px; }
.f-step--besoin.is-bad .f-chip span { border-color: rgba(228, 4, 39, .7); }

/* retouches : moins d'espace entre la case de consentement et le bouton */
.f-intro { justify-content: flex-end; }
.f-err--consent:empty { display: none; }
.f-submit { padding-top: 0; border-top: 0; margin-top: -10px; }
.f-send { margin-top: 0; }
.f-legend { display: block; }
.f-legend .f-req { margin-left: 2px; }
