/*
 * Habillage du module « forms » du thème parent.
 *
 * Le module fournit le comportement — envoi, validation, anti-spam,
 * enregistrement des demandes — et son propre CSS en BEM « lds-form__* ». On ne le
 * remplace pas, on le réaccorde aux tokens pour qu'il ressemble au formulaire de
 * la maquette.
 *
 * Cette feuille est imprimée APRÈS celle du module : le parent met ses assets en
 * file à la priorité 10 de wp_enqueue_scripts, le thème enfant à la priorité 30.
 * Les règles de même spécificité passent donc devant, sans recourir à !important.
 *
 * Les couleurs, elles, viennent des ponts --color-* de tokens.css : le module lit
 * ces variables, le thème les redéfinit avec la palette de la commune.
 *
 * Deux écarts à la maquette :
 *
 * 1. Bordure des champs : --ink-3, comme dans la maquette (5.09:1). C'est ce qui
 *    rend la limite du champ perceptible, exigence du RGAA pour les composants de
 *    saisie.
 *
 * 2. Halo de focus en --terra, la couleur de focus du thème, au lieu du
 *    rgba(184,85,46,.15) de la maquette qui n'appartenait à aucun token.
 */

/* ==========================================================================
   Conteneur
   ========================================================================== */

.contact-form {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card-sm);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form .form-head h3 {
  font-family: var(--serif);
  font-size: 1.6875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.contact-form .form-head .eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.contact-form .helper { font-size: 0.84375rem; color: var(--ink-3); }
.contact-form .helper .req { color: var(--terra); font-weight: 600; }

/* ==========================================================================
   Champs
   ========================================================================== */

.schwob-form .lds-form__fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.schwob-form .lds-form__field { display: flex; flex-direction: column; gap: 7px; }

/* Largeurs du module : la moitié tient sur une colonne, le reste sur deux. */
.schwob-form .lds-form__field--w100,
.schwob-form .lds-form__field--w75,
.schwob-form .lds-form__field--w66 { grid-column: 1 / -1; }

.schwob-form .lds-form__label {
  font-size: 0.84375rem;
  font-weight: 500;
  color: var(--ink-2);
}

.schwob-form .lds-form__required { color: var(--terra); font-weight: 600; }

.schwob-form input[type="text"],
.schwob-form input[type="email"],
.schwob-form input[type="tel"],
.schwob-form input[type="url"],
.schwob-form input[type="number"],
.schwob-form input[type="date"],
.schwob-form textarea,
.schwob-form select {
  padding: 12px 14px;
  background: var(--bg);
  /* Écart n° 1. */
  border: 1px solid var(--ink-3);
  border-radius: var(--r-field);
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink);
  width: 100%;
  min-height: var(--touch);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.schwob-form input:hover,
.schwob-form textarea:hover,
.schwob-form select:hover { border-color: var(--ink-2); }

/* Écart n° 2. */
.schwob-form input:focus,
.schwob-form textarea:focus,
.schwob-form select:focus {
  border-color: var(--terra);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(210, 32, 42, 0.18);
}

.schwob-form textarea { resize: vertical; min-height: 120px; }

/* ==========================================================================
   Titre de section — piège n° 4
   ========================================================================== */

.schwob-form .lds-form__field--section {
  grid-column: 1 / -1;
  margin-top: 10px;
  gap: 2px;
}

/*
 * Habillé exactement comme la <legend> de la maquette, mais c'est un <h3> : le
 * repère visuel est identique, et le repère de navigation est meilleur — un
 * lecteur d'écran peut sauter de titre en titre.
 */
.schwob-form .schwob-form-section {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--terra);
}

.schwob-form .schwob-form-section-hint {
  font-size: 0.78125rem;
  color: var(--ink-3);
}

/* ==========================================================================
   Cases à cocher et boutons radio
   ========================================================================== */

.schwob-form .lds-form__checkbox-item,
.schwob-form .lds-form__radio-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.5;
  min-height: var(--touch);
  padding: 6px 0;
}

.schwob-form input[type="checkbox"],
.schwob-form input[type="radio"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--terra);
  flex-shrink: 0;
}

.schwob-form .lds-form__checkbox-item a,
.schwob-form .lds-form__radio-item a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Bouton d'envoi
   ========================================================================== */

.schwob-form .lds-form__submit { margin-top: 6px; }

.schwob-form .lds-form__button {
  align-self: flex-start;
  padding: 14px 24px;
  min-height: var(--touch);
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: 0.90625rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.schwob-form .lds-form__button:hover { background: var(--terra); transform: translateY(-1px); }

/* ==========================================================================
   Messages
   ========================================================================== */

.schwob-form .lds-form__messages { margin-top: 6px; }

.schwob-form .lds-form__message {
  padding: 14px 16px;
  border-radius: var(--r-field);
  font-size: 0.875rem;
  font-weight: 500;
}

/*
 * Le message porte aussi une icône et un mot explicite côté module : la couleur
 * n'est jamais le seul véhicule de l'information (RGAA 3.1).
 */
.schwob-form .lds-form__message--success {
  background: rgba(47, 125, 87, 0.12);
  border: 1px solid var(--green);
  color: #1f5a3c;
}

.schwob-form .lds-form__message--error {
  background: rgba(210, 32, 42, 0.08);
  border: 1px solid var(--terra);
  color: #8e1219;
}

.schwob-form .lds-form__field-error {
  font-size: 0.78125rem;
  color: #8e1219;
}

.schwob-form .lds-form__field-error:empty { display: none; }

/* ==========================================================================
   Sous 620 px
   ========================================================================== */

/*
 * Texte indicatif des champs : le gris du module (#6B7280) ne faisait que
 * 4,27:1 sur le fond du formulaire ; --ink-3 donne 5,09:1 (RGAA 3.2, audit du
 * 16 novembre 2026).
 */
.schwob-form .lds-form__input::placeholder,
.schwob-form .lds-form__textarea::placeholder { color: var(--ink-3); }

@media (max-width: 620px) {
  .schwob-form .lds-form__fields { grid-template-columns: 1fr; }
  .contact-form { padding: 22px; }
}
