.global-form-popup-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(16, 19, 38, 0.90) !important;
  z-index: 999998 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.global-form-popup-overlay.is-active {
  opacity: 1 !important;
  visibility: visible !important;
}

.global-form-popup-wrapper {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  height: 100% !important;
  width: 100% !important; 
  background-color: #F3F4F9 !important; /* Fond gris clair */
  z-index: 999999 !important;
  transform: translateX(100%) !important;
  transition: transform 0.5s ease-in-out !important;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  padding: 48px 24px !important;
}

.global-form-popup-wrapper.is-active {
  transform: translateX(0) !important;
}

.global-form-popup-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 24px !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.global-form-popup-header h3 {
  margin: 0 !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  color: var(--secondary-color-hex) !important;
}

.close-global-form-popup-btn {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 5px !important;
  color: var(--secondary-color-hex) !important;
}

.close-global-form-popup-btn svg {
  display: block !important;
}

.global-form-popup-content {
  flex-grow: 1 !important;
  background-color: transparent !important;
  padding: 0 !important;
}

/* Styles pour le formulaire HubSpot injecté */
.global-form-popup-content .hs-form {
  display: flex !important;
  flex-direction: column !important;
}

/* Styles pour chaque champ du formulaire */
.global-form-popup-content .hs-form .hs-form-field {
  margin-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

/* Espacement entre les champs du formulaire */
.global-form-popup-content .hs-form .hs-form-field:not(:last-of-type) {
  margin-bottom: 16px !important;
}

/* Espacement entre le dernier champ et le RGPD */
.global-form-popup-content .hs-form .hs-form-field:last-of-type {
  margin-bottom: 24px !important;
}

/* Styles pour la section RGPD (consentement légal) */
.global-form-popup-content .hs-form .legal-consent-container {
  margin-bottom: 24px !important;
}

/* Styles pour le bouton de soumission */
.global-form-popup-content .hs-form .hs_submit {
  margin-top: 0 !important;
}

/* Ciblage spécifique de la div .actions */
.global-form-popup-content .hs-form .hs_submit .actions {
  margin-top: 0 !important; 
}

/* Cacher les conteneurs complets des champs cachés */
.global-form-popup-content .hs-form-field:has(input[name*="commercial_name_of_programme"]),
.global-form-popup-content .hs-form-field:has(input[name*="id_bastion_programme"]),
.global-form-popup-content .hs-form-field:has(input[name*="lot_number"])  {
  display: none !important;
}

/* Version de secours pour les navigateurs sans support de :has() */
@supports not selector(:has(*)) {
  .global-form-popup-content input[name*="commercial_name_of_programme"],
  .global-form-popup-content input[name*="id_bastion_programme"],
    .global-form-popup-content input[name*="lot_number"]{
    display: none !important;
  }
  
  .global-form-popup-content label[for*="commercial_name_of_programme"],
  .global-form-popup-content label[for*="id_bastion_programme"] {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .global-form-popup-wrapper {
    width: 41.666667% !important; /* col-lg-5 */
    padding: 72px 80px !important;
  }

  /* Centrage du bouton de soumission en desktop */
  .global-form-popup-content .hs-form .hs_submit {
    align-self: center !important;
  }
}