/* Les codes des formulaires publics du site.
   Règle : docs/REGLES-SITE.md, règle 12. Rien n'est inventé ici : chaque valeur
   reprend le formulaire de candidature Édition 02 (FormulaireCandidature.tsx).

   Les classes .nl-input, .lieu-field, .pd-field, .ap-champ, .mx-ai-field,
   .lieu-chip et .pd-chip viennent des maquettes (qu'on ne retouche pas à la
   main). Un nouveau formulaire utilise les classes .fg-*.

   Le préfixe `html body` fait passer ces règles devant le CSS que chaque
   maquette injecte dans la page. */

:root { --fg-marron: #44291f; --fg-fond: var(--couleur-edition, #f1eee5); }

/* ---------- Champ souligné ---------- */
html body .nl-input,
html body input.lieu-field,
html body input.pd-field,
html body input.ap-champ,
html body #nl-form input.form_input,
html body .fg-champ {
  width: 100%; box-sizing: border-box; min-height: 2.75rem; margin: 0;
  padding: .5rem 0 4px; background: transparent; color: var(--fg-marron);
  border: 0; border-bottom: 1px solid var(--fg-marron); border-radius: 0;
  font-family: var(--font-archivo, Archivo), Arial, sans-serif; font-size: 1rem; line-height: 1.6;
  outline: none;
}
html body .nl-input:focus,
html body input.lieu-field:focus,
html body input.pd-field:focus,
html body input.pd-field.is-err,
html body input.ap-champ:focus,
html body input.ap-champ[aria-invalid="true"],
html body .fg-champ:focus {
  outline: none; border-bottom-width: 2px; padding-bottom: 3px;
}
/* La newsletter de l'accueil pose ses styles dans la balise : il faut forcer. */
html body #nl-form input.form_input:focus { border-bottom-width: 2px !important; padding-bottom: 3px !important; }

html body .nl-input::placeholder,
html body input.lieu-field::placeholder,
html body input.pd-field::placeholder,
html body input.ap-champ::placeholder,
html body #nl-form input.form_input::placeholder,
html body .fg-champ::placeholder {
  color: var(--fg-marron); opacity: .7; text-transform: uppercase; font-size: .8rem; letter-spacing: .04em;
}

/* ---------- Zone de texte : encadrée, jamais un simple trait ---------- */
html body textarea.lieu-field,
html body textarea.pd-field.is-area,
html body textarea.mx-ai-field,
html body textarea.fg-zone {
  width: 100%; box-sizing: border-box; min-height: 7rem; resize: none; margin: 0;
  padding: .625rem; background: transparent; color: var(--fg-marron);
  border: 1px solid var(--fg-marron); border-radius: 0;
  font-family: var(--font-archivo, Archivo), Arial, sans-serif; font-size: 1rem; line-height: 1.5;
  outline: none;
}
html body textarea.lieu-field:focus,
html body textarea.pd-field.is-area:focus,
html body textarea.mx-ai-field:focus,
html body textarea.fg-zone:focus {
  outline: none; border-width: 1px; padding: .625rem; box-shadow: inset 0 0 0 1px var(--fg-marron);
}

/* ---------- Choix : contour, rempli et chevron quand il est coché ---------- */
html body .lieu-chip,
html body .pd-chip,
html body .fg-choix {
  display: inline-flex; align-items: center; gap: .625rem; box-sizing: border-box;
  min-height: 2.75rem; padding: .625rem .75rem .625rem 1rem; margin: 0;
  background: transparent; color: var(--fg-marron);
  border: 1px solid var(--fg-marron); border-radius: 0;
  font-family: var(--font-archivo, Archivo), Arial, sans-serif; font-size: .95rem; font-weight: 600; line-height: 1.3;
  letter-spacing: 0; text-transform: none; text-align: left; cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
html body .lieu-chip::after,
html body .pd-chip::after,
html body .fg-choix::after {
  content: ""; flex: none; width: .4rem; height: .75rem; margin-left: auto;
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px); visibility: hidden;
}
html body .lieu-chip.is-on::after,
html body .pd-chip.is-on::after,
html body .fg-choix.is-on::after { visibility: visible; }
html body .lieu-chip:hover,
html body .pd-chip:hover,
html body .fg-choix:hover { background: transparent; color: var(--fg-marron); }
html body .lieu-chip.is-on,
html body .pd-chip.is-on,
html body .fg-choix.is-on { background: var(--fg-marron); color: var(--fg-fond); }
@media (hover: hover) {
  html body .lieu-chip:not(.is-on):hover,
  html body .pd-chip:not(.is-on):hover,
  html body .fg-choix:not(.is-on):hover { box-shadow: inset 0 0 0 1px var(--fg-marron); }
}
html body .lieu-chip:focus-visible,
html body .pd-chip:focus-visible,
html body .fg-choix:focus-visible { outline: 2px solid var(--fg-marron); outline-offset: 2px; }

/* Petit-déjeuner : sur grand écran, la carte reste collée à l'écran. À taille
   pleine, le bouton de paiement passait sous le bord : les choix y restent
   compacts. Sur téléphone, les tailles de la règle. */
@media (min-width: 768px) {
  html body .pd-card .pd-chip { min-height: 0; padding: .25rem .6rem; gap: .35rem; font-size: 10px; line-height: 1.4; }
  html body .pd-card .pd-chip::after { width: .25rem; height: .5rem; }
}
@media (max-width: 767px) {
  html body .pd-card .pd-chip { padding: .625rem .75rem .625rem 1rem; font-size: .95rem; line-height: 1.3; }
  html body .pd-form textarea.pd-field.is-area { min-height: 7rem !important; }
}

/* ---------- Bouton d'envoi ---------- */
html body .fg-bouton {
  display: flex; align-items: center; justify-content: center; gap: .5rem; box-sizing: border-box;
  min-height: 40px; padding: .6875rem 1rem .6875rem 2rem;
  background: var(--fg-marron); color: var(--fg-fond);
  border: 1px solid var(--fg-marron); border-radius: 0; cursor: pointer;
  font-family: var(--font-archivo-narrow, "Archivo Narrow"), "Archivo Narrow", Arial, sans-serif;
  font-size: 1rem; font-weight: 500; line-height: 1rem; text-transform: uppercase; letter-spacing: .24px;
}
html body .fg-bouton::after {
  content: ""; flex: none; width: 1rem; height: 1rem; background: currentColor;
  -webkit-mask: url(/site/images/fragment-small.svg) center / contain no-repeat;
  mask: url(/site/images/fragment-small.svg) center / contain no-repeat;
}
html body .fg-bouton:focus-visible { outline: 2px solid var(--fg-marron); outline-offset: 2px; }
html body .fg-bouton:disabled,
html body form .primary-button:disabled { opacity: .35; cursor: default; }

/* ---------- Message « Il manque … » : en marron, au-dessus du bouton ---------- */
html body .pd-error,
html body .fg-message {
  margin: 0; border: 0; padding: 0; color: var(--fg-marron);
  font-family: var(--font-archivo, Archivo), Arial, sans-serif; font-size: 1rem; line-height: 1.5;
}
/* Erreur de l'accès presse : même typo, elle garde son fragment. */
html body p.ap-erreur { font-size: 1rem; line-height: 1.5; text-transform: none; letter-spacing: 0; }
html body .pd-form .pd-error { order: 1; }
html body .pd-form .pd-cta { order: 2; }
html body .pd-form .pd-note { order: 3; margin-top: -1rem; }

/* ---------- Téléphone : le bouton prend toute la largeur ---------- */
@media (max-width: 767px) {
  html body .mx-ai-actions .primary-button,
  html body #acq-form .primary-button,
  html body #lieu-form .primary-button,
  html body #editer-form .primary-button,
  html body .pd-form .pd-cta,
  html body .fg-bouton { width: 100%; justify-content: center; }
}

/* Téléphone : 24 colonnes et 23 gouttières de 16 px dépassaient l'écran. */
@media (max-width: 767px) {
  html body .mx-ai-in,
  html body .ap-wrap { column-gap: 0 !important; }
}
