/* Custom Select2 Styles - Style pilule violette */

#formulaire_recherche_formation .select2-container {
  font-family: "Montserrat";
  display: inline-block;
  width: 100% !important;
}

/* Style principal du Select2 - Conteneur pilule blanche/bordure violette */
#formulaire_recherche_formation .select2-container--default .select2-selection--single {
  background: #ffffff !important;
  border: 1.5px solid #592494 !important;
  border-bottom: 1.5px solid #592494 !important;
  border-radius: 50px !important;
  min-height: 60px !important;
  height: 60px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 60px 0 32px !important;
  position: relative !important;
}

/* Texte sélectionné */
#formulaire_recherche_formation .select2-container--default .select2-selection--single .select2-selection__rendered {
  background: transparent !important;
  color: #592494 !important;
  font-size: 1.15rem !important;
  font-weight: 500 !important;
  line-height: 1.5rem !important;
  text-transform: none !important;
  width: 100% !important;
  display: flex !important;
  justify-content: flex-start !important;
}

/* Icône de localisation à gauche - repasse en violet */
#formulaire_recherche_formation .select2-container--default .select2-selection--single::before {
  content: '' !important;
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 22px !important;
  background: url('data:image/svg+xml;utf8,<svg width="20" height="25" viewBox="0 0 20 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 1.5C12.2551 1.5 14.2237 2.27573 15.9678 3.88379C17.6253 5.41217 18.5007 7.47831 18.5 10.25C18.5 11.9324 17.8287 13.9071 16.2725 16.207C14.8764 18.2702 12.7985 20.5387 10 23.0127C7.20069 20.538 5.12287 18.2695 3.72754 16.207C2.17237 13.9083 1.50083 11.9336 1.5 10.25C1.5 7.4782 2.37556 5.41229 4.0332 3.88379C5.7774 2.27555 7.74583 1.5 10 1.5Z" stroke="%23592494" stroke-width="3"/></svg>') no-repeat center/contain !important;
  z-index: 2 !important;
}

/* Chevron - flèche violette nue, sans bouton carré */
#formulaire_recherche_formation .select2-container--default .select2-selection--single .select2-selection__arrow {
  background: transparent !important;
  border-radius: 0 !important;
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  right: 28px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Flèche vers le bas */
#formulaire_recherche_formation .select2-container--default .select2-selection--single .select2-selection__arrow b {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M5 8l5 5 5-5" stroke="%23592494" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center/contain !important;
  border: none !important;
  margin: 0 !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Flèche vers le haut quand le dropdown est ouvert */
#formulaire_recherche_formation .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  width: 18px !important;
  height: 18px !important;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M15 12l-5-5-5 5" stroke="%23592494" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center/contain !important;
  border: none !important;
  margin: 0 !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Placeholder */
#formulaire_recherche_formation .select2-container--default .select2-selection--single .select2-selection__placeholder {
  background: transparent !important;
  opacity: 0.6;
  font-size: 1.4rem !important;
  color: #592494 !important;
  line-height: 60px !important;
  width: 100% !important;
  display: flex !important;
  justify-content: flex-start;
  color: var(--c-secondaire);
}

/* Focus */
#formulaire_recherche_formation .select2 .selection:focus,
#formulaire_recherche_formation .select2-search__field:focus {
  outline: none !important;
}

/* Erreur */
#formulaire_recherche_formation span.select2.error .select2-selection {
  border: solid red 1.5px !important;
  margin-bottom: 5px !important;
}

/* Options du dropdown */
#formulaire_recherche_formation .select2-container--default .select2-results__option {
  background: white !important;
  color: #592494 !important;
  padding: 0.7rem 1.5rem !important;
}

#formulaire_recherche_formation .select2-container--default .select2-results__option[aria-selected=true] {
  background: #f3ebfa !important;
}

#formulaire_recherche_formation .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #592494 !important;
  color: white !important;
}

/* Select2 sans icône de localisation */
#formulaire_recherche_formation .no-location-icon+.select2-container--default .select2-selection--single::before {
  display: none !important;
}

#formulaire_recherche_formation .no-location-icon+.select2-container--default .select2-selection--single {
  padding-left: 32px !important;
}

.select2-results__options {
  padding: 0.3rem;
  font-weight: 300;
}

/* Style "pilule blanche" pour les select2 de la section Ma structure (gestionnaire) */
#section-mon-compte-structure .select2-container--default .select2-selection--single,
#section-mon-compte-structure .select2-container--default .select2-selection--multiple {
    box-sizing: border-box !important;
    background-color: #fff !important;
    border: none !important;
    border-radius: 0.75rem !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 3rem 0.75rem 1.5rem !important;
    /* padding-right agrandi pour laisser la place au chevron */
    box-shadow: #0000001A 0px 4px 10px !important;
    line-height: normal !important;
}

#section-mon-compte-structure .select2-container--default .select2-selection--single .select2-selection__rendered,
#section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    box-sizing: border-box !important;
    color: #272727 !important;
    font-weight: 300 !important;
    font-size: 1rem !important;
    line-height: normal !important;
    padding: 0 !important;
    margin: 0 !important;
}

#section-mon-compte-structure .select2-container--default .select2-selection--single .select2-selection__arrow {
  box-sizing: border-box !important;
  background: transparent !important;
  width: 1.4rem !important;
  height: 1.4rem !important;
  right: 1.2rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

#section-mon-compte-structure .select2-container--default .select2-selection--single .select2-selection__arrow b {
  width: 1.1rem !important;
  height: 1.1rem !important;
  border: none !important;
  margin: 0 !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M5 8l5 5 5-5" stroke="%23592494" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center/contain !important;
}

#section-mon-compte-structure .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M15 12l-5-5-5 5" stroke="%23592494" stroke-width="3" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center/contain !important;
}

/* Placeholder / multi-select (aPerimetreTerritorial), identique aux placeholders des inputs de #formulaire_mon_compte */
#section-mon-compte-structure .select2-selection__placeholder,
#section-mon-compte-formateur .select2-selection__placeholder {
  color: #888 !important;
  font-weight: 300 !important;
  font-size: 1rem !important;
}

#section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-selection__choice,
#section-mon-compte-formateur .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--c-tertiaire) !important;
  border: none !important;
  border-radius: 1rem !important;
  color: var(--c-secondaire) !important;
  padding: 0.2rem 0.6rem !important;
}

/* S'assure que le conteneur select2 (span) ne rajoute pas sa propre hauteur */
#section-mon-compte-structure .select2-container,
#section-mon-compte-formateur .select2-container {
  box-sizing: border-box !important;
  width: 100% !important;
  vertical-align: middle !important;
}

/* Surcharge scopée au formulaire "Mon compte" (priorité sur les règles ci-dessus) */
#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--single,
#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--single,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple {
    box-sizing: border-box !important;
    background-color: #fff !important;
    border: none !important;
    border-radius: 0.75rem !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 3rem 0.75rem 1.5rem !important;
    box-shadow: #0000001A 0px 4px 10px !important;
    line-height: normal !important;
}

/* Aspect grisé pour les Selects désactivés (readonly) */
#formulaire_mon_compte #section-mon-compte-structure .select2-container--disabled .select2-selection--single,
#formulaire_mon_compte #section-mon-compte-structure .select2-container--disabled .select2-selection--multiple {
    background-color: #E6E6E6 !important;
    cursor: not-allowed !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--single .select2-selection__rendered,
#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-selection__rendered,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--single .select2-selection__rendered,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    box-sizing: border-box !important;
    color: #272727 !important;
    font-weight: 300 !important;
    font-size: 1rem !important;
    line-height: normal !important;
    padding: 0 !important;
    margin: 0 !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--single .select2-selection__arrow,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--single .select2-selection__arrow {
    box-sizing: border-box !important;
    background: transparent !important;
    width: 1.4rem !important;
    height: 1.4rem !important;
    right: 1.2rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container {
    box-sizing: border-box !important;
    margin: 0.5rem !important;
    width: calc(100% - 1rem) !important;
    /* 100% moins les 0.5rem de marge de chaque côté */
    vertical-align: middle !important;
}

/* Placeholder identique à celui des inputs du formulaire */
#formulaire_mon_compte #section-mon-compte-structure .select2-selection__placeholder,
#formulaire_mon_compte #section-mon-compte-formateur .select2-selection__placeholder {
    color: #888 !important;
    font-weight: 300 !important;
    font-size: 1rem !important;
}

/* Correctif d'affichage du select multiple "Périmètre territorial" : la liste de choix
   et le champ de recherche interne de Select2 gardaient leurs styles par défaut (float,
   largeur figée) et débordaient du conteneur en pilule blanche. */
#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-selection__rendered,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
    list-style: none !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-search--inline,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple .select2-search--inline {
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    min-width: 4rem !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-search__field,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple .select2-search__field {
box-sizing: border-box !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 1.5rem !important;
    width: 100% !important;
    min-width: 4rem !important;
    font-size: 1rem !important;
    font-weight: 300 !important;
    color: #272727 !important;
}

#formulaire_mon_compte #section-mon-compte-structure .select2-container--default .select2-selection--multiple .select2-selection__choice,
#formulaire_mon_compte #section-mon-compte-formateur .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.select2-container--default .select2-search--dropdown .select2-search--inline {
    float: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    box-sizing: border-box !important;
    border: none !important;
    border-bottom: 1px solid #ccc !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0.4rem 0.2rem !important;
    height: auto !important;
    width: 100% !important;
    font-size: 1rem !important;
    font-weight: 300 !important;
    color: #272727 !important;
    outline: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-bottom-color: var(--c-secondaire) !important;
}

.select2-dropdown {
  border-radius: 0.75rem !important;
  box-shadow: #0000001A 0px 4px 10px !important;
}