/*
 Theme Name:   ATTPS
 Theme URI:    https://example.com
 Description:  Thème enfant ATTPS pour Divi 5 – Personnalisations préservées lors des mises à jour.
 Author:       Votre Nom
 Author URI:   https://example.com
 Template:     Divi
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  attps
*/

/* ==========================================================================
   Vos styles personnalisés ci-dessous
   ========================================================================== */
body,
#page-container {
  overflow-x: hidden !important;
}

html {
  scroll-behavior: smooth;
}

h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.75vw, 4.5rem);
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 2vw, 3rem);
}

h3 {
  font-size: clamp(1.35rem, 1.15rem + 1vw, 1.75rem);
}

/* ==========================================================================
   VERSION CORRIGÉE ET SÉCURISÉE POUR GRAVITY FORMS
   ========================================================================== */

/* Structure globale */
.gform_wrapper {
  margin: 2rem auto !important;
  padding: 2.5rem !important;
  background-color: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif !important;
}

/* On réinitialise la grille interne de Gravity Forms pour éviter le bug */
.gform_wrapper .gform_fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.gform_wrapper .gform_heading,
.gform_wrapper .gform_description {
  display: none !important;
}

/* Cacher le gros titre "Informations" si inutile, ou le styliser proprement */
.gform_wrapper legend.gfield_label {
  display: block !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #2c3e50 !important;
  margin-bottom: 0.5rem !important;
  border: none !important;
}

.gform_wrapper label.gfield_label {
  display: none !important; /* Cache "Téléphone", "E-mail" car il y a déjà les placeholders */
}

/* --- CORRECTION DES CHAMPS PRÉNOM / NOM --- */
.gform_wrapper .ginput_container_name {
  display: flex !important;
  gap: 15px !important;
  width: 100% !important;
}

.gform_wrapper .ginput_container_name span.gform-grid-col {
  flex: 1 !important;
  display: block !important;
  width: 50% !important;
}

/* --- STYLISATION UNIFIÉE DES CHAMPS --- */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="email"],
.gform_wrapper select,
.gform_wrapper textarea {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  padding: 0.85rem 1rem !important;
  font-size: 1rem !important;
  border: 1px solid #dcdde1 !important;
  border-radius: 8px !important;
  background-color: #f8f9fa !important;
  color: #2f3640 !important;
  transition: all 0.3s ease !important;
  box-sizing: border-box !important;
}

/* Focus sur les champs */
.gform_wrapper input:focus,
.gform_wrapper textarea:focus {
  outline: none !important;
  border-color: #3498db !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15) !important;
}

/* Correction spécifique pour le Message */
.gform_wrapper .ginput_container_textarea,
.gform_wrapper textarea {
  width: 100% !important;
}
.gform_wrapper textarea {
  min-height: 120px !important;
  resize: vertical !important;
}

/* --- SECTION RGPD / CONSENTEMENT --- */
.gform_wrapper .gfield--type-consent {
  background: #f8f9fa !important;
  padding: 1rem !important;
  border-radius: 8px !important;
  border: 1px solid #e1e8ed !important;
}

.gform_wrapper .gfield--type-consent legend {
  display: none !important; /* Cache le titre "RGPD" doublon */
}

.gform_wrapper .ginput_container_consent {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
}

.gform_wrapper .ginput_container_consent input[type="checkbox"] {
  margin-top: 3px !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important; /* Évite qu'il s'écrase */
  cursor: pointer !important;
  accent-color: #3498db !important;
}

.gform_wrapper label.gfield_consent_label {
  display: block !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #2c3e50 !important;
  cursor: pointer !important;
}

.gform_wrapper .gfield_consent_description {
  font-size: 0.8rem !important;
  color: #7f8c8d !important;
  line-height: 1.5 !important;
  margin-top: 0.75rem !important;
  border-top: 1px solid #e1e8ed !important;
  padding-top: 0.75rem !important;
}

/* --- BOUTON ENVOYER --- */
.gform_wrapper .gform_footer {
  text-align: left !important; /* Aligné à gauche */
  margin-top: 0.5rem !important;
  padding: 0 !important;
}

.gform_wrapper .gform_button {
  background-color: var(--gcid-primary-color) !important;
  color: #ffffff !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  padding: 0.85rem 2.5rem !important;
  border: 1px solid var(--gcid-primary-color) !important;
  border-radius: 50px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 6px rgba(20, 130, 67, 0.2) !important;
  width: auto !important;
}

.gform_wrapper .gform_button:hover {
  background-color: #fff !important;
  color: var(--gcid-primary-color) !important;
  box-shadow: 0 6px 12px rgba(20, 130, 67, 0.3) !important;
}

/* Responsive */
@media (max-width: 500px) {
  .gform_wrapper .ginput_container_name {
    flex-direction: column !important;
    gap: 1.25rem !important;
  }
  .gform_wrapper .ginput_container_name span.gform-grid-col {
    width: 100% !important;
  }
  .gform_wrapper .gform_button {
    width: 100% !important;
  }
}

.title-with-img {
  display: flex;
  align-items: center;
  gap: 15px;
}

.agro-btn-onglet {
  border-radius: 60px;
  background: #f69323;
  opacity: 0.4;
  text-align: center;
  font-size: 19px;
  color: #ffffff;
  padding: 10px 30px;
  width: 260px;
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  .agro-btn-onglet {
    width: 100%;
  }
}

.agro-btn-onglet .et_pb_text_inner {
  text-align: center;
}

.agro-btn-onglet.active {
  opacity: 1;
}

.li-custom {
  &.orange {
    --check-color: #f69323;
  }

  &.green {
    --check-color: #00943b;
  }

  ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
  }

  li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 16px;
    line-height: 1.4;
    font-weight: 600;
  }

  li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    background-color: var(--check-color, #00943b);
    border-radius: 50%;
  }

  li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    width: 10px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9' fill='none'%3E%3Cpath d='M1 4.5L4.2 8L11 1' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
  }
}

[class*="onglet-content-"] {
  display: none !important;
}

[class*="onglet-content-"].active {
  display: flex !important;
}

[class*="onglet-link-"].active {
  opacity: 1;
  font-weight: bold;
}

.titre-mission img {
  padding: 20px 25px;
  background-color: #e7ebe4;
  border-radius: 20px;
}

.titre-mission h2 {
  font-size: 24px;
}

/* Style de base du header sticky */
.header-sticky {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99999;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.3s ease;
}

/* 1. Pendant qu'on scroll dans la zone neutre (menu masqué) */
.header-sticky.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
}

/* 2. Quand on a dépassé le seuil (menu sticky qui réapparaît) */
.header-sticky.is-fixed {
  position: fixed !important;
  top: 0;
  left: 0;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  background: #ffffff;
}
