/*
  forms.css
  Styles des formulaires, messages, boutons, desktop et responsive.
  Factorisation, optimisation, documentation complète.
*/

/* Style pour la case à cocher cotisation dans le formulaire bénévolat */
.form-bloc input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--color-orange);
  margin-right: 10px;
  vertical-align: middle;
  display: inline-block;
  border: 2px solid var(--color-orange);
  background: #fff;
  box-shadow: 0 0 2px var(--color-orange);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
/* Affiche la case orange quand cochée */
.form-bloc input[type="checkbox"]:checked {
  background: var(--color-orange);
  border-color: var(--color-orange);
}
.form-bloc label input[type="checkbox"] {
  margin-bottom: 0;
}
/* Harmonise la largeur des groupes de champs dans les formulaires */
.form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Largeur maximale pour le conteneur d'injection dynamique des formulaires */
#contact-form-dynamic-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
/* CSS BLOC SEPARATION ORANGE */
.header-separation-orange {
  width: 100vw;
  height: 5px;
  background: var(--gradient-secondary-orange);
  margin-left: calc(-50vw + 50%);
  margin-right: 0;
  max-width: 100vw;
  box-sizing: border-box;
}

/* CSS SECTION FORM */
.form-section{
  background: var(--gradient-principal-grey);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: auto;
  gap: 0;
  padding: 50px 20px;
  margin: 0 auto;
  box-sizing: border-box;
  
  /* Permettre l'effet stellar en arrière-plan */
  position: relative;
  overflow: hidden;
}

/* CSS BLOC FORM */
.form-bloc{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  padding: 50px 25px;
  width: 100%;
  max-width: 1190px;
  border-radius: 25px;
  background: var(--gradient-secondary-grey);
  color: #000;
  box-sizing: border-box;
  height: auto;
  margin: 0 auto;
  border: 2px solid var(--color-orange);
}

/* CSS CONTENER FORM */
.contener-form {
  width: 100%;
  height: auto;
  padding-left: 25px;
  padding-right: 25px;
}

/* Style clair pour tous les enfants de .form-bloc */
.form-bloc * {
  color: #000;
  font-family: inherit;
  box-sizing: border-box;
}

/* Centrage des titres et textes dans les formulaires */
.form-bloc label,
.form-bloc .form-title,
.form-bloc .form-desc,
.form-bloc h2,
.form-bloc h3,
.form-bloc p {
  color: #000;
  text-align: center;
  width: 100%;
}

.form-bloc label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #000;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  text-align: center;
}

 .form-bloc input[type="text"],
 .form-bloc input[type="email"],
 .form-bloc input[type="password"],
 .form-bloc input[type="tel"],
 .form-bloc input[type="number"],
 .form-bloc input[type="url"],
 .form-bloc textarea,
 .form-bloc select {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-orange);
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: 1rem;
  margin-bottom: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: 0 2px 8px 0 rgba(255,152,0,0.08);
  display: block;
}
.form-bloc input[type="text"]:focus,
.form-bloc input[type="email"]:focus,
.form-bloc input[type="password"]:focus,
.form-bloc input[type="tel"]:focus,
.form-bloc input[type="number"]:focus,
.form-bloc textarea:focus,
.form-bloc select:focus {
  border-color: var(--color-orange);
  box-shadow: 0 4px 16px 0 rgba(255,152,0,0.15);
}

/* Style du bouton principal (comme btn-rechercher mais orange) */
.form-bloc .btn-form {
  width: fit-content;
  margin: 32px auto 0 auto;
  padding: 20px 40px;
  background: var(--gradient-principal-grey);
  border: 1px solid var(--color-orange);
  border-radius: 50px;
  color: #000000;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 16px 0 var(--shadow-orange, #ff980033), inset 0 2px 8px 0 #fff;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  transition: 
    background 0.2s,
    border-color 0.2s,
    border-radius 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  display: block;
}
.form-bloc .btn-form:hover {
  background: #fff;
  border: 1px solid var(--color-orange);
  border-radius: 0px;
  color: var(--color-orange);
  box-shadow: 0 4px 16px 0 var(--shadow-grey), inset 0 2px 8px 0 var(--shadow-grey);
}

/* Responsive / fix selecteurs formulaire contact (appliqué depuis forms.css chargé sur la page contact) */
@media (max-width: 899px) {
  /* Conteneur centré et limité pour éviter que les blocs touchent les bords */
  .bloc-contact-selecteurs-forms {
    width: 100%;
    max-width: 720px;    /* limite la largeur totale du groupe */
    margin: 0 auto;      /* centre horizontalement */
    padding: 0 22px;     /* éloigne des bords */
    box-sizing: border-box;
    display: flex;
    justify-content: center; /* rapproche les blocs vers le centre */
    gap: 18px;
    flex-wrap: wrap;     /* autorise passage en 2 lignes si besoin */
    align-items: flex-start;
  }

  /* Blocs enfants compacts pour rapprocher les côtés du centre */
  .bloc-contact-form-simple,
  .bloc-contact-form-benevolat,
  .bloc-contact-form-pro {
    flex: 0 0 calc(33.333% - 12px); /* trois colonnes visuelles mais compactes */
    min-width: 140px;               /* évite que le contenu s'écrase trop */
    max-width: 240px;
    padding: 6px 8px;
    box-sizing: border-box;
    margin: 6px 0;
    background: transparent; /* laisse apparence inchangée */
  }

  /* Assure que le titre peut wrap normalement et reste centré */
  .bloc-contact-form-simple .form-radio-title,
  .bloc-contact-form-benevolat .form-radio-title,
  .bloc-contact-form-pro .form-radio-title,
  .form-radio-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    margin: 0 0 6px 0;
  }

  /* Centre la case radio sous le label et conserve alignement après déplacement */
  .form-radio-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .form-radio-group input[type="radio"] {
    margin: 0 auto;
  }
}

/* Très petits écrans : empilement vertical pour éviter écrasement */
@media (max-width: 420px) {
  .bloc-contact-selecteurs-forms {
    padding: 0 14px;
    gap: 12px;
    max-width: 100%;
  }
  .bloc-contact-form-simple,
  .bloc-contact-form-benevolat,
  .bloc-contact-form-pro {
    flex: 0 0 100%;
    min-width: 0;
    max-width: none;
    padding: 10px 6px;
  }
  .form-radio-title { font-size: 15px; }
}

/* La visibilité des formulaires est gérée dynamiquement par le JS, ne pas cacher ici. */