/*
 * Style de base des formulaires Aludoor : il remplace celui de Gravity Forms (thème
 * « Orbital ») avec les valeurs mesurées sur le site le 27/10/2026. Les variables
 * --form_* sont celles des options Avada (hauteur, couleurs et bordures des champs).
 * Le CSS personnalisé du thème garde la main sur ce qu'il définissait déjà : cartes à
 * images (.check-images), ombre des champs, boutons radio en pastilles, largeurs du
 * formulaire Catalogue (#field_6_5…). Pour cela, nos règles sont préfixées par
 * :where(.aludoor-form), qui ne compte pas dans la priorité CSS : à priorité égale
 * sans ce préfixe, une règle du thème l'emporte toujours sur les nôtres.
 */

.aludoor-form {
  margin-bottom: 50px;
}

:where(.aludoor-form) fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* Grille de 12 colonnes : un champ « demi » occupe 6 colonnes. */
:where(.aludoor-form) .gform_fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 35px;
}

:where(.aludoor-form) .gfield {
  grid-column: span 12;
  min-width: 0;
  line-height: 16px;
}

:where(.aludoor-form) .gfield--width-half {
  grid-column: span 6;
}

@media (max-width: 640px) {
  :where(.aludoor-form) .gfield--width-half {
    grid-column: span 12;
  }
}

/* Libellés */
:where(.aludoor-form) .gfield_label {
  display: block;
  margin: 0;
  padding: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  color: #112337;
}

:where(.aludoor-form) .gfield_required_text {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #db4b68;
}

/* Libellé masqué à l'écran mais lu par les lecteurs d'écran. */
:where(.aludoor-form) .hidden_label > .gfield_label,
:where(.aludoor-form) .screen-reader-text,
:where(.aludoor-form) .aludoor-forms-trap {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Champs de saisie : mêmes réglages que les champs Avada. */
:where(.aludoor-form) .gfield input[type='text'],
:where(.aludoor-form) .gfield input[type='email'],
:where(.aludoor-form) .gfield input[type='tel'],
:where(.aludoor-form) .gfield input[type='number'],
:where(.aludoor-form) .gfield select,
:where(.aludoor-form) .city-dropdown,
:where(.aludoor-form) .gfield textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: var(--form_input_height, 50px);
  margin: 0;
  padding: 0 15px;
  font-family: inherit;
  font-size: var(--form_text_size, 16px);
  font-weight: 400;
  line-height: 38px;
  color: var(--form_text_color, #000);
  background-color: var(--form_bg_color, #fff);
  border-style: solid;
  border-width: var(--form_border_width-top, 1px) var(--form_border_width-right, 1px)
    var(--form_border_width-bottom, 1px) var(--form_border_width-left, 1px);
  border-color: var(--form_border_color, #d2d2d2);
  border-radius: var(--form_border_radius, 0);
}

:where(.aludoor-form) .gfield input:focus,
:where(.aludoor-form) .gfield select:focus,
:where(.aludoor-form) .gfield textarea:focus {
  border-color: var(--form_focus_border_color, #204ce5);
  outline: none;
}

/* Au clavier, les cases, boutons et listes gardent un contour bien visible. */
:where(.aludoor-form) input[type='checkbox']:focus-visible,
:where(.aludoor-form) button:focus-visible,
:where(.aludoor-form) input[type='submit']:focus-visible,
:where(.aludoor-form) .gchoice input:focus-visible + label {
  outline: 2px solid #204ce5;
  outline-offset: 2px;
}

:where(.aludoor-form) .gfield textarea {
  height: 288px;
  min-height: 288px;
  padding: 12px 15px;
  line-height: 24px;
  resize: vertical;
}

/*
 * Taille « moyenne » de Gravity Forms : sur le site, elle ne raccourcit la saisie que
 * dans un champ « demi » (code postal du Contact). Ailleurs la saisie reste pleine.
 */
:where(.aludoor-form) .gfield--width-half input.medium {
  width: calc(50% - 8px);
}

:where(.aludoor-form) .gfield textarea.medium {
  height: 192px;
  min-height: 192px;
}

@media (max-width: 640px) {
  :where(.aludoor-form) .gfield--width-half input.medium {
    width: 100%;
  }
}

/* Listes : légère ombre et marge intérieure des listes Gravity Forms. */
:where(.aludoor-form) .gfield select,
:where(.aludoor-form) .city-dropdown {
  appearance: none;
  padding: 6px 40px 6px 15px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.3 0.3a1 1 0 0 1 1.4 0L5 3.6 8.3 0.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z' fill='rgba(17,35,55,0.65)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

:where(.aludoor-form) .city-dropdown {
  margin-top: 8px;
}

/* Adresses proposées sous le champ de la rue (même principe que dans ALU'LEAD). */
:where(.aludoor-form) .aludoor-forms-address-host {
  position: relative;
}

:where(.aludoor-form) .aludoor-forms-address-suggestions {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d2d2d2;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

:where(.aludoor-form) .address_line_1 .aludoor-forms-address-suggestions {
  left: 6px;
  right: 6px;
}

:where(.aludoor-form) .aludoor-forms-address-suggestions li {
  margin: 0;
  padding: 8px 15px;
  cursor: pointer;
}

:where(.aludoor-form) .aludoor-forms-address-suggestions li:hover,
:where(.aludoor-form) .aludoor-forms-address-suggestions li[aria-selected='true'] {
  background: #f2f6fb;
}

:where(.aludoor-form) .aludoor-forms-address-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #112337;
}

:where(.aludoor-form) .aludoor-forms-address-context {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: #585e6a;
}

:where(.aludoor-form) .address_country select {
  padding-left: 6px;
}

/* Numéro RCS : même ombre que les listes, sans flèches de nombre. */
:where(.aludoor-form) .gfield input[type='number'] {
  appearance: textfield;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
}

:where(.aludoor-form) .gfield input[type='number']::-webkit-inner-spin-button,
:where(.aludoor-form) .gfield input[type='number']::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

/* Nom (prénom + nom) et adresse : sous-champs côte à côte. */
:where(.aludoor-form) .ginput_complex {
  display: flex;
  flex-wrap: wrap;
  row-gap: 16px;
  margin: 0 -6px;
}

/* Chaque sous-champ garde sa moitié, même seul sur sa ligne (pays de l'adresse). */
:where(.aludoor-form) .ginput_complex > span {
  box-sizing: border-box;
  flex: 0 0 50%;
  padding: 0 6px;
}

:where(.aludoor-form) .ginput_complex > .ginput_full {
  flex-basis: 100%;
}

@media (max-width: 640px) {
  :where(.aludoor-form) .ginput_complex > span {
    flex-basis: 100%;
  }
}

:where(.aludoor-form) .gform-field-label--type-sub {
  display: block;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.43;
  color: #585e6a;
}

/* Descriptions et compteur de caractères */
:where(.aludoor-form) .gfield_description {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.43;
  color: #585e6a;
}

/* Cases à cocher et boutons radio */
:where(.aludoor-form) .gfield_checkbox,
:where(.aludoor-form) .gfield_radio {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

:where(.aludoor-form) .gf_list_inline .gfield_radio,
:where(.aludoor-form) .projet .gfield_radio {
  flex-direction: row;
  flex-wrap: wrap;
}

:where(.aludoor-form) .gf_list_inline .gfield_radio {
  column-gap: 16px;
}

:where(.aludoor-form) .gchoice {
  display: grid;
  grid-template-columns: minmax(20px, max-content) auto;
  align-items: center;
}

:where(.aludoor-form) .gchoice label,
:where(.aludoor-form) .gfield_consent_label {
  display: block;
  margin: 0 0 0 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  color: #112337;
  cursor: pointer;
}

:where(.aludoor-form) .gchoice input,
:where(.aludoor-form) .ginput_container_consent input {
  appearance: none;
  position: relative;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  margin: 0;
  background-color: #fff;
  border: 1px solid #686e77;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
  cursor: pointer;
  display: grid;
}

:where(.aludoor-form) .gchoice input[type='radio'] {
  border-radius: 50%;
}

/* Coche des consentements, dessinée en SVG (Gravity Forms utilisait sa police d'icônes). */
:where(.aludoor-form) .ginput_container_consent input:checked::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 7.5l3 3 7-7' fill='none' stroke='%23204ce5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/*
 * Cases à cocher visibles (« A quel sujet ? » du Catalogue) : le thème leur retire
 * cadre et fond, puis pose la coche avec la police d'icônes de Gravity Forms, qui
 * disparaît avec lui. On garde le cadre gris et on écrit la coche « ✓ » : le thème lui
 * donne déjà sa taille, sa couleur et sa place.
 */
:where(.aludoor-form) .gfield_checkbox input[type='checkbox'] {
  width: 20px;
  height: 20px;
  background-color: #fff;
  border: 1px solid #686e77;
}

:where(.aludoor-form) .gfield_checkbox input[type='checkbox']:checked::before {
  content: '✓';
}

:where(.aludoor-form) .gchoice input[type='radio']:checked::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background-color: #204ce5;
}

:where(.aludoor-form) .ginput_container_consent {
  display: inline-grid;
  grid-template-columns: 20px auto;
  align-items: center;
  vertical-align: top;
}

:where(.aludoor-form) .gfield_consent_description {
  margin-top: 12px;
}

/* Pièces jointes */
:where(.aludoor-form) .gform_drop_area {
  padding: 40px;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  color: rgba(17, 35, 55, 0.725);
  text-align: center;
  background-color: #fff;
  border: 1px dashed #686e77;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
}

/* Icône d'envoi au-dessus du texte (Gravity Forms la tirait de sa police d'icônes). */
:where(.aludoor-form) .gform_drop_area::before {
  content: '';
  display: block;
  height: 36px;
  margin: 0 0 8px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 15V4m0 0L7.5 8.5M12 4l4.5 4.5M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4' fill='none' stroke='%23204ce5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 36px 36px no-repeat;
}

:where(.aludoor-form) .gform_drop_area.aludoor-forms-drag-over {
  border-color: #204ce5;
}

:where(.aludoor-form) .gform_drop_instructions {
  display: block;
  margin-bottom: 12px;
}

:where(.aludoor-form) .aludoor-forms-file-input {
  display: none;
}

/*
 * Consigne puis liste des fichiers choisis, l'une sous l'autre : vu le 27/10 sur le site,
 * le nom du fichier chevauchait la consigne (marges des listes du thème).
 */
:where(.aludoor-form) .gform_fileupload_rules {
  display: block;
}

:where(.aludoor-form) .ginput_container_fileupload ul.ginput_preview_list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.43;
}

:where(.aludoor-form) .gform_delete_file {
  margin-left: 8px;
  padding: 0;
  font-size: 13px;
  color: #db4b68;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Boutons : couleur et forme des boutons de Gravity Forms sur le site. */
:where(.aludoor-form) .gform_footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

/* « .gform_drop_area button » : plus fort que la règle Avada « button.button ». */
:where(.aludoor-form) .gform_footer .gform_button,
:where(.aludoor-form) .gform_drop_area button.gform_button_select_files {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  margin: 0;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  color: #fff;
  text-transform: none;
  background: #204ce5;
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
  cursor: pointer;
}

:where(.aludoor-form) .gform_footer .gform_button:hover,
:where(.aludoor-form) .gform_drop_area button.gform_button_select_files:hover {
  background: #001ab3;
}

.aludoor-form.aludoor-forms-sending .gform_button {
  opacity: 0.6;
  cursor: wait;
}

/* Erreurs : même rendu que le site (cadre rouge centré, thème Avada). */
:where(.aludoor-form) .gform_validation_errors {
  margin-bottom: 20px;
  padding: 25px;
  text-align: center;
  color: var(--danger_accent_color, #db4b68);
  background: var(--danger_bg_color, #fdf3f5);
  border: 1px solid var(--danger_accent_color, #db4b68);
}

/*
 * Titre h2 du message d'erreur : le thème Avada impose aux h2 ses majuscules et sa
 * police par des règles plus fortes (vu le 27/10 sur le site). C'est un message, pas un
 * titre de page : « !important » est voulu ici.
 */
:where(.aludoor-form) .gform_submission_error {
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: inherit !important;
}

:where(.aludoor-form) .gfield_validation_message {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 14px;
  text-align: center;
  color: var(--danger_accent_color, #db4b68);
  background: var(--danger_bg_color, #fdf3f5);
  border: 1px solid var(--danger_accent_color, #db4b68);
}

:where(.aludoor-form) .gfield_error .gfield_label,
:where(.aludoor-form) .gfield_error .gfield_consent_label {
  color: #db4b68;
}

:where(.aludoor-form) .gfield_error input,
:where(.aludoor-form) .gfield_error select,
:where(.aludoor-form) .gfield_error textarea {
  border-color: #db4b68;
}

:where(.aludoor-form) .gform_confirmation_message {
  font-size: 16px;
  line-height: 1.5;
}

/*
 * Cartes à images du formulaire d'acquisition 21 : le CSS du thème ne vise que les
 * identifiants du Contact (#label_13_…). Mêmes images et mêmes tailles.
 */
:where(.aludoor-form) .check-images #label_21_15_1::before {
  background-image: url('/app/uploads/2025/06/plafond.jpg');
}
:where(.aludoor-form) .check-images #label_21_15_2::before {
  background-image: url('/app/uploads/2025/06/laterale.jpg');
}
:where(.aludoor-form) .check-images #label_21_15_3::before {
  background-image: url('/app/uploads/2025/06/battante.jpg');
}
:where(.aludoor-form) .check-images #label_21_15_4::before {
  background-image: url('/app/uploads/2025/09/checkenroulable.jpg');
}
:where(.aludoor-form) .check-images #label_21_42_1::before {
  background-image: url('/app/uploads/2025/06/insert.jpg');
}
:where(.aludoor-form) .check-images #label_21_42_2::before {
  background-image: url('/app/uploads/2025/06/hublot.jpg');
}
:where(.aludoor-form) .check-images #label_21_42_3::before {
  background-image: url('/app/uploads/2025/06/portillon.jpg');
}
:where(.aludoor-form) .check-images #label_21_42_4::before {
  background-image: url('/app/uploads/2025/06/pieces.jpg');
}

:where(.aludoor-form) .check-images #input_21_42 {
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
}

:where(.aludoor-form) .check-images #input_21_42 label {
  min-height: 210px;
  width: 170px;
}

:where(.aludoor-form) .check-images #input_21_42 label::before {
  width: 170px;
  height: 170px;
}

@media screen and (max-width: 600px) {
  :where(.aludoor-form) .check-images #input_21_42 {
    grid-template-columns: 1fr 1fr !important;
  }

  :where(.aludoor-form) .check-images #input_21_42 label {
    min-height: 190px;
    width: 130px;
  }

  :where(.aludoor-form) .check-images #input_21_42 label::before {
    width: 130px;
    height: 130px;
  }
}

/*
 * Reprises d'AluLead Connect, sur mobile : fenêtre Contact des portes industrielles, et
 * menu flottant masqué sur la page d'acquisition (il recouvrait Particulier / Professionnel).
 */
@media (max-width: 600px) {
  body.page-id-19187 nav.fixedmenu {
    display: none !important;
  }

  .fusion-modal.modale_contact .modal-body {
    padding: 12px !important;
  }

  .fusion-modal.modale_contact #gform_wrapper_19 .gform_fields {
    row-gap: 14px;
  }

  .fusion-modal.modale_contact #gform_wrapper_19 textarea {
    height: 120px;
    min-height: 120px;
  }
}

/*
 * Fenêtre produit (reprise d'AluLead Connect 0.4.3) : limitée à la hauteur de l'écran
 * avec défilement interne, et « Particulier / Professionnel » encadrés, car le thème
 * cache les ronds des boutons radio.
 */
.aludoor-modal-overlay {
  padding: 16px;
  box-sizing: border-box;
}

.aludoor-modal {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
}

/* Dans la fenêtre produit, Gravity Forms serrait les textes et espaçait Prénom / Nom. */
.aludoor-modal .gfield_description {
  font-size: 13px;
}

.aludoor-modal .ginput_complex {
  column-gap: 24px;
  margin: 0;
}

.aludoor-modal .ginput_complex > span {
  flex: 1 1 0;
  padding: 0;
}

.aludoor-modal .gfield--type-radio .gfield_radio {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
}

.aludoor-modal .gfield--type-radio .gchoice {
  display: block;
  flex: 1 1 180px;
}

.aludoor-modal .gfield--type-radio .gchoice label {
  width: 100%;
  margin: 0;
  border: 1px solid #c9d1d6;
  border-radius: 6px;
  text-align: center;
}
