/* ================================================================
   GRAVITY FORMS — base Bootship (PATTERNS § 36.3)
   Uniquement les classes produites par GF, scopées sous un conteneur .bootship-gf (répétable) ou #custom-form (historique, unique).
   Mise en page en grille ; position seulement quand le design l'impose.
   Le design se règle directement dans la copie de gf.css du projet. Les états serveur restent fournis par Gravity Forms.
   ================================================================ */

:is(#custom-form, .bootship-gf) {
  /* Grille */
  --gf-gap-y: 0.875rem;
  --gf-gap-x: 0.875rem;

  /* Texte */
  --gf-font: inherit;
  --gf-size: 1rem;
  --gf-text: #14261a;
  --gf-muted: #6b6250;

  /* Libellés ; --gf-required : "*" ou "" (rien) */
  --gf-label-size: 0.8125rem;
  --gf-label-weight: 600;
  --gf-label-color: var(--gf-text);
  --gf-label-gap: 0.375rem;
  --gf-small-size: 0.8125rem; /* sous-libellés, descriptions, messages */
  --gf-required: "";
  --gf-required-color: var(--gf-error);

  /* Champs */
  --gf-h: 3.125rem;
  --gf-px: 1rem;
  --gf-radius: 0.75rem;
  --gf-field-radius: var(--gf-radius);
  --gf-bg: #fbf8f1;
  --gf-border-w: 1.5px;
  --gf-border: #cfc3a8;
  --gf-focus: #14261a;
  --gf-ring: color-mix(in srgb, var(--gf-focus) 18%, transparent);
  --gf-ring-error: color-mix(in srgb, var(--gf-error) 18%, transparent);
  --gf-placeholder: #98a2b3;
  --gf-textarea-h: auto;
  --gf-arrow: var(--gf-muted);

  /* Choix (checkbox, radio, consentement) */
  --gf-accent: var(--gf-focus);
  --gf-choice-size: 1.25rem;
  --gf-choice-radius: 0.375rem;

  /* États */
  --gf-error: #b5532b;
  --gf-error-bg: #f6e2d6;
  --gf-success: #067647;
  --gf-success-bg: #ecfdf3;
  --gf-track: #eaecf0;

  /* Boutons : principal (envoyer, suivant) et secondaire (précédent, enregistrer, fichiers) */
  --gf-btn-h: 3.25rem;
  --gf-btn-px: 1.75rem;
  --gf-btn-radius: 999px;
  --gf-btn-size: 0.9375rem;
  --gf-btn-weight: 700;
  --gf-btn-bg: var(--gf-accent);
  --gf-btn-color: #ffffff;
  --gf-btn-border: transparent;
  --gf-btn-bg-hover: color-mix(in srgb, var(--gf-btn-bg) 85%, #000000);
  --gf-btn-color-hover: var(--gf-btn-color);
  --gf-btn2-bg: transparent;
  --gf-btn2-color: var(--gf-text);
  --gf-btn2-border: var(--gf-border);
  --gf-btn2-bg-hover: color-mix(in srgb, var(--gf-btn2-border) 25%, transparent);
  --gf-footer-justify: start;
  --gf-footer-gap: 0.75rem;

  /* Newsletter en ligne : place du message d'erreur sous le formulaire, retrait du bouton dans le champ */
  --gf-inline-error: 2.75rem;
  --gf-inline-gap: 0.75rem;
  --gf-inline-inset: 0.25rem;
  --gf-inline-btn-space: 9rem;
}

/* ---------- Remise à zéro (dont default.css et Bootstrap) ---------- */

:is(#custom-form, .bootship-gf),
:is(#custom-form, .bootship-gf) *,
:is(#custom-form, .bootship-gf) *::before,
:is(#custom-form, .bootship-gf) *::after {
  box-sizing: border-box;
}

:is(#custom-form, .bootship-gf) .gform_wrapper,
:is(#custom-form, .bootship-gf) form {
  margin: 0;
  padding: 0;
  font-family: var(--gf-font);
  font-size: var(--gf-size);
  color: var(--gf-text);
}

:is(#custom-form, .bootship-gf) fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

:is(#custom-form, .bootship-gf) legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

:is(#custom-form, .bootship-gf) .gform_validation_container,
:is(#custom-form, .bootship-gf) .gfield--type-honeypot,
:is(#custom-form, .bootship-gf) .gfield_visibility_hidden,
:is(#custom-form, .bootship-gf) .gfield--type-hidden,
:is(#custom-form, .bootship-gf) .gform_hidden,
:is(#custom-form, .bootship-gf) .gf_clear,
:is(#custom-form, .bootship-gf) .gform-icon,
:is(#custom-form, .bootship-gf) .gform_validation_errors:empty,
:is(#custom-form, .bootship-gf) .validation_message--hidden-on-empty:empty,
:is(#custom-form, .bootship-gf) .ginput_container_date kbd {
  display: none !important;
}

:is(#custom-form, .bootship-gf) .screen-reader-text,
:is(#custom-form, .bootship-gf) .gform_required_legend,
:is(#custom-form, .bootship-gf) .hidden_label > .gfield_label,
:is(#custom-form, .bootship-gf) .hidden_sub_label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Grille des champs ---------- */

:is(#custom-form, .bootship-gf) .gform_fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gf-gap-y) var(--gf-gap-x);
  margin: 0;
  padding: 0;
  list-style: none;
}

:is(#custom-form, .bootship-gf) .gfield {
  display: grid;
  grid-column: 1 / -1;
  align-content: start;
  min-width: 0;
  margin: 0;
  padding: 0;
}

:is(#custom-form, .bootship-gf) .gfield--width-eleven-twelfths { grid-column: span 11; }
:is(#custom-form, .bootship-gf) .gfield--width-five-sixths { grid-column: span 10; }
:is(#custom-form, .bootship-gf) .gfield--width-three-quarter { grid-column: span 9; }
:is(#custom-form, .bootship-gf) .gfield--width-two-thirds { grid-column: span 8; }
:is(#custom-form, .bootship-gf) .gfield--width-seven-twelfths { grid-column: span 7; }
:is(#custom-form, .bootship-gf) .gfield--width-half { grid-column: span 6; }
:is(#custom-form, .bootship-gf) .gfield--width-five-twelfths { grid-column: span 5; }
:is(#custom-form, .bootship-gf) .gfield--width-third { grid-column: span 4; }
:is(#custom-form, .bootship-gf) .gfield--width-quarter { grid-column: span 3; }
:is(#custom-form, .bootship-gf) .gfield--width-one-sixth { grid-column: span 2; }
:is(#custom-form, .bootship-gf) .gfield--width-one-twelfth { grid-column: span 1; }

/* Ordre fixe quel que soit le réglage GF : libellé, champ, description, erreur */
:is(#custom-form, .bootship-gf) .gfield > .gfield_description:not(.validation_message) { order: 1; }
:is(#custom-form, .bootship-gf) .gfield > .validation_message { order: 2; }

/* ---------- Libellés, aide, obligatoire ---------- */

:is(#custom-form, .bootship-gf) .gfield_label {
  display: block;
  margin: 0 0 var(--gf-label-gap);
  padding: 0;
  font-size: var(--gf-label-size);
  font-weight: var(--gf-label-weight);
  line-height: 1.4;
  color: var(--gf-label-color);
}

/* Le texte de GF (« (Nécessaire) », « * » ou celui d'un thème) est remplacé par --gf-required */
:is(#custom-form, .bootship-gf) .gfield_label > .gfield_required,
:is(#custom-form, .bootship-gf) .gfield_consent_label > .gfield_required {
  margin-left: 0.25rem;
  font-size: 0;
  color: var(--gf-required-color);
}

:is(#custom-form, .bootship-gf) .gfield_required .gfield_required {
  display: none;
}

:is(#custom-form, .bootship-gf) .gfield_label > .gfield_required::after,
:is(#custom-form, .bootship-gf) .gfield_consent_label > .gfield_required::after {
  content: var(--gf-required);
  font-size: var(--gf-label-size);
}

:is(#custom-form, .bootship-gf) .gform-field-label--type-sub {
  display: block;
  margin: 0 0 0.375rem;
  font-size: var(--gf-small-size);
  font-weight: 400;
  color: var(--gf-muted);
}

:is(#custom-form, .bootship-gf) .field_sublabel_below .gform-field-label--type-sub {
  margin: 0.375rem 0 0;
}

:is(#custom-form, .bootship-gf) .gform-field-label--type-inline {
  margin: 0;
  font-size: var(--gf-size);
  font-weight: 400;
  line-height: 1.5;
  color: var(--gf-text);
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) .gfield_description,
:is(#custom-form, .bootship-gf) .gsection_description {
  margin: 0.375rem 0 0;
  padding: 0;
  font-size: var(--gf-small-size);
  line-height: 1.5;
  color: var(--gf-muted);
}

/* ---------- Champs de saisie ---------- */

:is(#custom-form, .bootship-gf) form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"]),
:is(#custom-form, .bootship-gf) form select,
:is(#custom-form, .bootship-gf) form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  height: var(--gf-h);
  margin: 0;
  padding: 0 var(--gf-px-end, var(--gf-px)) 0 var(--gf-px);
  font-family: inherit;
  font-size: var(--gf-size);
  line-height: 1.4;
  color: var(--gf-text);
  background-color: var(--gf-bg);
  border: var(--gf-border-w) solid var(--gf-border);
  border-radius: var(--gf-field-radius);
  box-shadow: none;
  outline: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

:is(#custom-form, .bootship-gf) form textarea {
  height: var(--gf-textarea-h);
  min-height: 0;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  resize: vertical;
}

:is(#custom-form, .bootship-gf) form select {
  padding-right: calc(var(--gf-px) + 1.5rem);
  background-image: linear-gradient(45deg, transparent 50%, var(--gf-arrow) 50%), linear-gradient(135deg, var(--gf-arrow) 50%, transparent 50%);
  background-position: calc(100% - var(--gf-px) - 0.3125rem) 50%, var(--gf-arrow-x, calc(100% - var(--gf-px))) 50%;
  background-repeat: no-repeat;
  background-size: 0.3125rem 0.3125rem;
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) form select[multiple] {
  height: auto;
  padding: 0.5rem;
  background-image: none;
}

:is(#custom-form, .bootship-gf) form select[multiple] option {
  padding: 0.375rem 0.5rem;
  border-radius: calc(var(--gf-radius) / 2);
}

:is(#custom-form, .bootship-gf) form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"])::placeholder,
:is(#custom-form, .bootship-gf) form textarea::placeholder {
  color: var(--gf-placeholder);
  opacity: 1;
}

:is(#custom-form, .bootship-gf) form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"]):focus,
:is(#custom-form, .bootship-gf) form select:focus,
:is(#custom-form, .bootship-gf) form textarea:focus {
  border-color: var(--gf-focus);
  box-shadow: 0 0 0 3px var(--gf-ring);
}

:is(#custom-form, .bootship-gf) form .gfield_error input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"]),
:is(#custom-form, .bootship-gf) form .gfield_error select,
:is(#custom-form, .bootship-gf) form .gfield_error textarea {
  border-color: var(--gf-error);
}

:is(#custom-form, .bootship-gf) form .gfield_error input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"]):focus,
:is(#custom-form, .bootship-gf) form .gfield_error select:focus,
:is(#custom-form, .bootship-gf) form .gfield_error textarea:focus {
  box-shadow: 0 0 0 3px var(--gf-ring-error);
}

/* Total (lecture seule) : du texte, pas un champ */
:is(#custom-form, .bootship-gf) form input.gform-text-input-reset:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="hidden"]) {
  height: auto;
  padding: 0;
  font-weight: 600;
  background: none;
  border: 0;
  box-shadow: none;
}

/* Taille de la zone de texte réglée dans GF (petite, moyenne, grande) */
:is(#custom-form, .bootship-gf) form textarea.small { height: calc(var(--gf-textarea-h) * 0.6); }
:is(#custom-form, .bootship-gf) form textarea.large { height: calc(var(--gf-textarea-h) * 2); }

/* Titre et description du formulaire (si affichés) */
:is(#custom-form, .bootship-gf) .gform_heading {
  margin: 0 0 var(--gf-gap-y);
}

:is(#custom-form, .bootship-gf) .gform_title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gf-text);
}

:is(#custom-form, .bootship-gf) .gform_description {
  display: block;
  margin: 0.375rem 0 0;
  color: var(--gf-muted);
}

/* Compteur de caractères */
:is(#custom-form, .bootship-gf) .ginput_counter {
  text-align: right;
}

/* ---------- Champs composés (nom, adresse, e-mail + confirmation, date, heure) ---------- */

:is(#custom-form, .bootship-gf) .ginput_complex {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem var(--gf-gap-x);
}

:is(#custom-form, .bootship-gf) .ginput_complex > * {
  display: block;
  min-width: 0;
}

:is(#custom-form, .bootship-gf) .ginput_complex .ginput_full,
:is(#custom-form, .bootship-gf) .gf_name_has_1 > * {
  grid-column: 1 / -1;
}

:is(#custom-form, .bootship-gf) .gf_name_has_3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
:is(#custom-form, .bootship-gf) .gf_name_has_4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
:is(#custom-form, .bootship-gf) .gf_name_has_5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

:is(#custom-form, .bootship-gf) .gfield--type-date .ginput_complex {
  --gf-px: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.375rem;
}

:is(#custom-form, .bootship-gf) .gfield--input-type-datedropdown .ginput_complex {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
}

:is(#custom-form, .bootship-gf) form .gfield--type-date .ginput_complex select {
  padding-right: 1.25rem;
  background-position: calc(100% - 0.8125rem) 50%, calc(100% - 0.5rem) 50%;
}

:is(#custom-form, .bootship-gf) .gfield--type-time .ginput_complex {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 0.5rem;
}

:is(#custom-form, .bootship-gf) .gfield--type-time .ginput_complex:has(.gfield_time_ampm) {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
}

:is(#custom-form, .bootship-gf) .hour_minute_colon {
  align-self: center;
  font-weight: 600;
  color: var(--gf-muted);
}

/* ---------- Date : calendrier GF 3 ---------- */

:is(#custom-form, .bootship-gf) .ginput_container_date:has(> .gform-datepicker-toggle) {
  --gf-px-end: calc(var(--gf-px) + 2rem);
  display: grid;
  position: relative;
}

:is(#custom-form, .bootship-gf) .ginput_container_date > input,
:is(#custom-form, .bootship-gf) .ginput_container_date > .gform-datepicker-toggle {
  grid-area: 1 / 1;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-toggle {
  display: grid;
  place-items: center;
  justify-self: end;
  align-self: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 0.375rem 0 0;
  padding: 0;
  color: var(--gf-muted);
  background: none;
  border: 0;
  border-radius: calc(var(--gf-radius) / 2);
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-toggle:hover,
:is(#custom-form, .bootship-gf) .gform-datepicker-toggle:focus-visible {
  color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) .gform-datepicker-toggle-icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  font-size: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-toggle-icon::before {
  content: none;
}

/* Panneau : au-dessus des champs suivants */
:is(#custom-form, .bootship-gf) .gform-datepicker-calendar {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 30;
  width: 19rem;
  max-width: 100vw;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--gf-text);
  background-color: var(--gf-bg);
  border: 1px solid var(--gf-border);
  border-radius: var(--gf-radius);
  box-shadow: 0 1rem 2rem rgba(16, 24, 40, 0.14);
}

:is(#custom-form, .bootship-gf) .gfield:has(.gform-datepicker-calendar) {
  position: relative;
  z-index: 30;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0.125rem;
  table-layout: fixed;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar td,
:is(#custom-form, .bootship-gf) .gform-datepicker-calendar th {
  padding: 0;
  text-align: center;
  border: 0;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar th {
  padding: 0.375rem 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gf-muted);
}

/* GF met la classe .btn sur les flèches : neutraliser celle du thème (Bootstrap) */
:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .btn {
  display: table-cell;
  padding: 0;
  font: inherit;
  color: var(--gf-text);
  background: none;
  border: 0;
  box-shadow: none;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .btn,
:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .day {
  height: 2.125rem;
  border-radius: calc(var(--gf-radius) / 2);
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .btn:hover,
:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .day:hover {
  color: var(--gf-accent);
  background-color: color-mix(in srgb, var(--gf-accent) 10%, transparent);
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .dayToday {
  font-weight: 700;
  color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .day.selected {
  font-weight: 700;
  color: #ffffff;
  background-color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) form .gform-datepicker-calendar select {
  width: 100%;
  height: 2.125rem;
  padding: 0 1.75rem 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  background-position: calc(100% - 0.8125rem) 50%, calc(100% - 0.5rem) 50%;
}

:is(#custom-form, .bootship-gf) .gform-datepicker-calendar .monthMessage {
  display: none;
}

/* ---------- Choix : checkbox, radio, consentement ---------- */

:is(#custom-form, .bootship-gf) .gfield_checkbox,
:is(#custom-form, .bootship-gf) .gfield_radio {
  display: grid;
  gap: 0.625rem;
}

:is(#custom-form, .bootship-gf) .gfield--choice-align-horizontal .gfield_checkbox,
:is(#custom-form, .bootship-gf) .gfield--choice-align-horizontal .gfield_radio {
  grid-auto-flow: column;
  justify-content: start;
  gap: 0.625rem 1.5rem;
}

:is(#custom-form, .bootship-gf) .gchoice,
:is(#custom-form, .bootship-gf) .ginput_container_consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.625rem;
}

:is(#custom-form, .bootship-gf) .gchoice br {
  display: none;
}

:is(#custom-form, .bootship-gf) form .gchoice_other_control:not([type="hidden"]) {
  grid-column: 2;
  margin-top: 0.5rem;
}

:is(#custom-form, .bootship-gf) form input[type="checkbox"],
:is(#custom-form, .bootship-gf) form input[type="radio"] {
  display: block;
  flex: none;
  width: var(--gf-choice-size);
  height: var(--gf-choice-size);
  margin: calc((1.5em - var(--gf-choice-size)) / 2) 0 0;
  padding: 0;
  background: var(--gf-bg) center / 70% no-repeat;
  border: var(--gf-border-w) solid var(--gf-border);
  border-radius: var(--gf-choice-radius);
  appearance: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

:is(#custom-form, .bootship-gf) form input[type="radio"] {
  border-radius: 50%;
}

:is(#custom-form, .bootship-gf) form input[type="checkbox"]:checked {
  background-color: var(--gf-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  border-color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) form input[type="radio"]:checked {
  background-color: var(--gf-bg);
  border-color: var(--gf-accent);
  box-shadow: inset 0 0 0 calc(var(--gf-choice-size) / 4) var(--gf-bg), inset 0 0 0 var(--gf-choice-size) var(--gf-accent);
}

:is(#custom-form, .bootship-gf) form input[type="checkbox"]:focus-visible,
:is(#custom-form, .bootship-gf) form input[type="radio"]:focus-visible {
  outline: 2px solid var(--gf-focus);
  outline-offset: 2px;
}

:is(#custom-form, .bootship-gf) form .gfield_error input[type="checkbox"],
:is(#custom-form, .bootship-gf) form .gfield_error input[type="radio"] {
  border-color: var(--gf-error);
}

:is(#custom-form, .bootship-gf) .gfield_choice_all_toggle {
  justify-self: start;
  margin: 0.25rem 0 0;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gf-accent);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) .gfield_consent_description {
  max-height: 10rem;
  overflow: auto;
}

/* ---------- Fichiers ---------- */

:is(#custom-form, .bootship-gf) form input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.375rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--gf-muted);
  background-color: var(--gf-bg);
  border: var(--gf-border-w) dashed var(--gf-border);
  border-radius: var(--gf-radius);
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) form input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--gf-btn2-color);
  background-color: var(--gf-btn2-bg);
  border: var(--gf-border-w) solid var(--gf-btn2-border);
  border-radius: calc(var(--gf-radius) / 1.5);
  cursor: pointer;
}

/* Le champ caché de plupload se cale sur la zone d'envoi */
:is(#custom-form, .bootship-gf) .gform_fileupload_multifile {
  position: relative;
  overflow: hidden;
}

:is(#custom-form, .bootship-gf) .gform_drop_area {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--gf-muted);
  background-color: var(--gf-bg);
  border: var(--gf-border-w) dashed var(--gf-border);
  border-radius: var(--gf-radius);
}

:is(#custom-form, .bootship-gf) .gform_fileupload_rules {
  display: block;
}

:is(#custom-form, .bootship-gf) .ginput_preview_list {
  display: grid;
  gap: 0.5rem;
}

:is(#custom-form, .bootship-gf) .ginput_preview_list:not(:empty) {
  margin-top: 0.5rem;
}

:is(#custom-form, .bootship-gf) .ginput_preview {
  display: grid;
  grid-auto-columns: auto;
  grid-auto-flow: column;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: var(--gf-bg);
  border: var(--gf-border-w) solid var(--gf-border);
  border-radius: var(--gf-radius);
}

:is(#custom-form, .bootship-gf) .gfield_fileupload_filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:is(#custom-form, .bootship-gf) .gfield_fileupload_filesize,
:is(#custom-form, .bootship-gf) .gfield_fileupload_percent {
  font-size: 0.8125rem;
  color: var(--gf-muted);
}

:is(#custom-form, .bootship-gf) .gfield_fileupload_progress {
  display: grid;
  grid-template-columns: 4rem auto;
  align-items: center;
  gap: 0.5rem;
}

:is(#custom-form, .bootship-gf) .gfield_fileupload_progressbar {
  height: 0.25rem;
  overflow: hidden;
  background-color: var(--gf-track);
  border-radius: 1rem;
}

:is(#custom-form, .bootship-gf) .gfield_fileupload_progressbar_progress {
  display: block;
  height: 100%;
  background-color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) .gfield_fileupload_progress_complete {
  display: none;
}

:is(#custom-form, .bootship-gf) .gform_delete_file,
:is(#custom-form, .bootship-gf) .gfield_fileupload_cancel {
  display: grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.25rem;
  font-size: var(--gf-small-size);
  color: var(--gf-muted);
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: calc(var(--gf-radius) / 2);
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) .gform_delete_file:hover,
:is(#custom-form, .bootship-gf) .gfield_fileupload_cancel:hover {
  color: var(--gf-error);
}

:is(#custom-form, .bootship-gf) .gform_delete_file .dashicons {
  width: 1rem;
  height: 1rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(#custom-form, .bootship-gf) .gform_delete_file .dashicons::before {
  content: none;
}

/* ---------- Liste (lignes à ajouter / retirer) ---------- */

:is(#custom-form, .bootship-gf) .gfield_list_groups {
  display: grid;
  gap: 0.5rem;
}

:is(#custom-form, .bootship-gf) .gfield_list_header,
:is(#custom-form, .bootship-gf) .gfield_list_group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

:is(#custom-form, .bootship-gf) .gfield_list_header:has(> :nth-child(3):last-child),
:is(#custom-form, .bootship-gf) .gfield_list_group:has(> :nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
:is(#custom-form, .bootship-gf) .gfield_list_header:has(> :nth-child(4):last-child),
:is(#custom-form, .bootship-gf) .gfield_list_group:has(> :nth-child(4):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
:is(#custom-form, .bootship-gf) .gfield_list_header:has(> :nth-child(5):last-child),
:is(#custom-form, .bootship-gf) .gfield_list_group:has(> :nth-child(5):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
:is(#custom-form, .bootship-gf) .gfield_list_header:has(> :nth-child(6):last-child),
:is(#custom-form, .bootship-gf) .gfield_list_group:has(> :nth-child(6):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; }

:is(#custom-form, .bootship-gf) .gfield_list_header {
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gf-muted);
}

:is(#custom-form, .bootship-gf) .gfield_header_item--icons,
:is(#custom-form, .bootship-gf) .gfield_list_icons {
  width: 4.25rem;
}

:is(#custom-form, .bootship-gf) .gfield_list_icons {
  display: grid;
  grid-template-columns: repeat(2, 2rem);
  gap: 0.25rem;
}

:is(#custom-form, .bootship-gf) .add_list_item,
:is(#custom-form, .bootship-gf) .delete_list_item {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0;
  color: var(--gf-muted);
  background-color: var(--gf-bg);
  border: var(--gf-border-w) solid var(--gf-border);
  border-radius: 50%;
  cursor: pointer;
}

:is(#custom-form, .bootship-gf) .add_list_item::before,
:is(#custom-form, .bootship-gf) .delete_list_item::before {
  font-size: 1.125rem;
  line-height: 1;
}

:is(#custom-form, .bootship-gf) .add_list_item::before { content: "+"; }
:is(#custom-form, .bootship-gf) .delete_list_item::before { content: "−"; }

:is(#custom-form, .bootship-gf) .add_list_item:hover {
  color: var(--gf-accent);
  border-color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) .delete_list_item:hover {
  color: var(--gf-error);
  border-color: var(--gf-error);
}

/* ---------- Section, HTML, produits ---------- */

:is(#custom-form, .bootship-gf) .gsection {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gf-border);
}

:is(#custom-form, .bootship-gf) .gsection_title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gf-text);
}

/* Champ HTML : texte libre, pas de grille (sinon chaque morceau de texte passe à la ligne) */
:is(#custom-form, .bootship-gf) .gfield_html {
  display: block;
}

:is(#custom-form, .bootship-gf) .gfield_html > :first-child { margin-top: 0; }
:is(#custom-form, .bootship-gf) .gfield_html > :last-child { margin-bottom: 0; }

:is(#custom-form, .bootship-gf) .ginput_container_singleproduct {
  display: grid;
  grid-template-columns: auto minmax(0, 7rem);
  align-items: center;
  gap: 0.5rem 1rem;
}

:is(#custom-form, .bootship-gf) .ginput_product_price_wrapper {
  grid-column: 1 / -1;
}

:is(#custom-form, .bootship-gf) .ginput_product_price {
  font-weight: 600;
  color: var(--gf-text);
}

:is(#custom-form, .bootship-gf) .ginput_quantity_label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--gf-muted);
}

:is(#custom-form, .bootship-gf) .ginput_price {
  margin-left: 0.25rem;
  color: var(--gf-muted);
}

/* ---------- Erreurs et confirmation ---------- */

:is(#custom-form, .bootship-gf) .validation_message {
  margin: 0.375rem 0 0;
  font-size: var(--gf-small-size);
  color: var(--gf-error);
}

:is(#custom-form, .bootship-gf) .gform_validation_errors {
  margin: 0 0 var(--gf-gap-y);
  padding: 0.875rem 1rem;
  color: var(--gf-error);
  background-color: var(--gf-error-bg);
  border: 1px solid color-mix(in srgb, var(--gf-error) 30%, transparent);
  border-radius: var(--gf-radius);
}

:is(#custom-form, .bootship-gf) .gform_validation_errors:focus {
  outline: none;
}

:is(#custom-form, .bootship-gf) .gform_validation_errors h2 {
  margin: 0;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
}

:is(#custom-form, .bootship-gf) .gform_validation_errors ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

:is(#custom-form, .bootship-gf) .gform_validation_error_link {
  display: inline;
  color: inherit;
}

:is(#custom-form, .bootship-gf) .gform_confirmation_message {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--gf-success);
  background-color: var(--gf-success-bg);
  border: 1px solid color-mix(in srgb, var(--gf-success) 30%, transparent);
  border-radius: var(--gf-radius);
}

/* ---------- Étapes : barre de progression et pastilles ---------- */

:is(#custom-form, .bootship-gf) .gf_progressbar_wrapper {
  margin: 0 0 var(--gf-gap-y);
}

:is(#custom-form, .bootship-gf) .gf_progressbar_title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gf-muted);
}

:is(#custom-form, .bootship-gf) .gf_progressbar {
  height: 0.5rem;
  overflow: hidden;
  background-color: var(--gf-track);
  border-radius: 1rem;
}

:is(#custom-form, .bootship-gf) .gf_progressbar_percentage {
  height: 100%;
  background-color: var(--gf-accent) !important;
  border-radius: inherit;
  transition: width 0.3s;
}

:is(#custom-form, .bootship-gf) .gf_progressbar_percentage span {
  display: none;
}

:is(#custom-form, .bootship-gf) .gf_page_steps {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 0.75rem;
  margin: 0 0 var(--gf-gap-y);
  padding: 0 0 var(--gf-gap-y);
  border-bottom: 1px solid var(--gf-border);
}

:is(#custom-form, .bootship-gf) .gf_step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gf-muted);
}

:is(#custom-form, .bootship-gf) .gf_step_number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  font-weight: 600;
  border: var(--gf-border-w) solid var(--gf-border);
  border-radius: 50%;
}

:is(#custom-form, .bootship-gf) .gf_step_active {
  font-weight: 600;
  color: var(--gf-text);
}

:is(#custom-form, .bootship-gf) .gf_step_active .gf_step_number {
  color: #ffffff;
  background-color: var(--gf-accent);
  border-color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) .gf_step_completed .gf_step_number {
  color: var(--gf-accent);
  border-color: var(--gf-accent);
}

:is(#custom-form, .bootship-gf) .gf_step_hidden {
  display: none;
}

/* ---------- Pied de formulaire et boutons ---------- */

/* Boutons qui passent à la ligne dans une colonne étroite (seul cas en flex) */
:is(#custom-form, .bootship-gf) .gform_footer,
:is(#custom-form, .bootship-gf) .gform_page_footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: var(--gf-footer-justify);
  align-items: center;
  gap: var(--gf-footer-gap);
  margin: var(--gf-gap-y) 0 0;
  padding: 0;
}

:is(#custom-form, .bootship-gf) .gform_button,
:is(#custom-form, .bootship-gf) .gform_next_button,
:is(#custom-form, .bootship-gf) .gform_previous_button,
:is(#custom-form, .bootship-gf) .gform_save_link,
:is(#custom-form, .bootship-gf) .gform_button_select_files {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--gf-btn-h);
  margin: 0;
  padding: 0 var(--gf-btn-px);
  font-family: inherit;
  font-size: var(--gf-btn-size);
  font-weight: var(--gf-btn-weight);
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  color: var(--gf-btn-color);
  background-color: var(--gf-btn-bg);
  border: var(--gf-border-w) solid var(--gf-btn-border);
  border-radius: var(--gf-btn-radius);
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

:is(#custom-form, .bootship-gf) .gform_button:hover,
:is(#custom-form, .bootship-gf) .gform_next_button:hover {
  color: var(--gf-btn-color-hover);
  background-color: var(--gf-btn-bg-hover);
}

:is(#custom-form, .bootship-gf) .gform_previous_button,
:is(#custom-form, .bootship-gf) .gform_save_link,
:is(#custom-form, .bootship-gf) .gform_button_select_files {
  color: var(--gf-btn2-color);
  background-color: var(--gf-btn2-bg);
  border-color: var(--gf-btn2-border);
}

:is(#custom-form, .bootship-gf) .gform_previous_button:hover,
:is(#custom-form, .bootship-gf) .gform_save_link:hover,
:is(#custom-form, .bootship-gf) .gform_button_select_files:hover {
  background-color: var(--gf-btn2-bg-hover);
}

:is(#custom-form, .bootship-gf) .gform_button_select_files {
  min-height: 2.5rem;
  max-width: 100%;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  white-space: normal;
}

:is(#custom-form, .bootship-gf) .gform_save_link {
  max-width: 100%;
  white-space: normal;
}

:is(#custom-form, .bootship-gf) .gform_save_link svg path {
  fill: currentColor;
}

:is(#custom-form, .bootship-gf) .gform_button:focus-visible,
:is(#custom-form, .bootship-gf) .gform_next_button:focus-visible,
:is(#custom-form, .bootship-gf) .gform_previous_button:focus-visible,
:is(#custom-form, .bootship-gf) .gform_save_link:focus-visible {
  outline: 2px solid var(--gf-focus);
  outline-offset: 2px;
}

:is(#custom-form, .bootship-gf) .gform_button:disabled,
:is(#custom-form, .bootship-gf) .gform_next_button:disabled {
  cursor: progress;
  opacity: 0.6;
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  :is(#custom-form, .bootship-gf) .gfield {
    grid-column: 1 / -1;
  }

  :is(#custom-form, .bootship-gf) .ginput_complex {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#custom-form, .bootship-gf) .gfield--type-date .ginput_complex {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(#custom-form, .bootship-gf) .gfield--type-time .ginput_complex {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  :is(#custom-form, .bootship-gf) .gfield--type-time .ginput_complex:has(.gfield_time_ampm) {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
  }

  :is(#custom-form, .bootship-gf) .gf_page_steps {
    grid-auto-columns: max-content;
  }

  :is(#custom-form, .bootship-gf) .gform_button,
  :is(#custom-form, .bootship-gf) .gform_next_button,
  :is(#custom-form, .bootship-gf) .gform_previous_button,
  :is(#custom-form, .bootship-gf) .gform_save_link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    white-space: normal;
  }

  :is(#custom-form, .bootship-gf) .gf_step_label {
    display: none;
  }

  :is(#custom-form, .bootship-gf) .gf_step_active .gf_step_label {
    display: block;
  }

  :is(#custom-form, .bootship-gf) .gfield--choice-align-horizontal .gfield_checkbox,
  :is(#custom-form, .bootship-gf) .gfield--choice-align-horizontal .gfield_radio {
    grid-auto-flow: row;
  }
}

/* ---------- Newsletter en ligne : <div id="custom-form" data-gf-inline> ----------
   Champ et bouton sur la même ligne ; data-gf-inline="inset" : bouton dans le champ ;
   ajouter « stack » (ex. data-gf-inline="inset stack") pour empiler champ et bouton sous 576 px. Le message d'erreur passe sous le formulaire
   (position, demandée par le design) et sa place se réserve sur le div à id. */

:is(#custom-form, .bootship-gf)[data-gf-inline] .gform_validation_errors {
  display: none;
}

:is(#custom-form, .bootship-gf)[data-gf-inline] form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--gf-inline-gap);
  position: relative;
}

:is(#custom-form, .bootship-gf)[data-gf-inline] .gform_fields {
  display: block;
}

:is(#custom-form, .bootship-gf)[data-gf-inline] .gform_footer {
  margin: 0;
}

:is(#custom-form, .bootship-gf)[data-gf-inline] .validation_message {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}

:is(#custom-form, .bootship-gf)[data-gf-inline]:has(.gform_validation_error) {
  padding-bottom: var(--gf-inline-error);
}

/* data-gf-inline~="inset" : bouton dans le champ (même cellule de grille, sans position) */
:is(#custom-form, .bootship-gf)[data-gf-inline~="inset"] {
  --gf-px-end: var(--gf-inline-btn-space);
}

:is(#custom-form, .bootship-gf)[data-gf-inline~="inset"] .gform_button {
  min-height: calc(var(--gf-h) - 2 * var(--gf-inline-inset));
}

:is(#custom-form, .bootship-gf)[data-gf-inline~="inset"] form {
  grid-template-columns: minmax(0, 1fr);
}

:is(#custom-form, .bootship-gf)[data-gf-inline~="inset"] .gform_body,
:is(#custom-form, .bootship-gf)[data-gf-inline~="inset"] .gform_footer {
  grid-area: 1 / 1;
}

:is(#custom-form, .bootship-gf)[data-gf-inline~="inset"] .gform_footer {
  justify-self: end;
  padding: var(--gf-inline-inset);
}

@media (max-width: 575px) {
  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] form {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] {
    --gf-px-end: var(--gf-px);
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] .gform_button {
    min-height: var(--gf-btn-h);
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] .gform_body,
  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] .gform_footer {
    grid-area: auto;
    justify-self: stretch;
    padding: 0;
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] .gform_footer {
    justify-self: start;
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"] .validation_message {
    position: static;
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline~="stack"]:has(.gform_validation_error) {
    padding-bottom: 0;
  }
}

/* AYA-TCHAD */
:is(#custom-form, .bootship-gf) .gform_button {
  font-family: var(--font-heading);
}

:is(#custom-form, .bootship-gf) {
  --gf-btn-bg-hover: var(--forest-800);
  --gf-ring: transparent;
}

[data-modal-form] .gform_footer .gform_button {
  width: 100%;
}

:is(#custom-form, .bootship-gf)[data-gf-inline] {
  --gf-field-radius: 999px;
  --gf-inline-gap: 0.625rem;
}

@media (max-width: 767.98px) {
  :is(#custom-form, .bootship-gf) .gform_footer .gform_button {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  :is(#custom-form, .bootship-gf)[data-gf-inline] form {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#custom-form, .bootship-gf)[data-gf-inline] .gform_button {
    width: 100%;
  }
}
