/* Style général des labels et textes */
.custom-contact-form a {
  color: #d70108;
  text-decoration: none;
}
.custom-contact-form label {
  font-size: 18px !important;
  font-weight: 400 !important;
  color: #505050 !important;
  padding-bottom: 10px;
  padding-top: 10px;
}

/* Message d'erreur */
.error-message {
  color: #d32f2f;
  background-color: #ffebee;
  border: 1px solid #f8bbd9;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 500;
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Système de grille */
.custom-contact-form .row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
  margin-bottom: 0;
}

.custom-contact-form .col-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 10px;
}

.custom-contact-form .col-12 {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0 10px;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .custom-contact-form .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.custom-contact-form h3 {
  font-size: 25px!important;
  font-weight: 700;
  text-transform: uppercase;
  color: #d70108 !important;
  margin-bottom: 5px;
}

.custom-contact-form textarea,
.custom-contact-form input[type="text"],
.custom-contact-form input[type="email"],
.custom-contact-form input[type="tel"],
.custom-contact-form select {
  border: 2px solid #d9d9d9;
  border-radius: 10px !important;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Services concernés : conteneur */
.custom-contact-form .services-form {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 0;
  flex-wrap: wrap;
}

/* Chaque checkbox service avec icône */
.custom-contact-form .services-form .service-checkbox {
flex: 1 1 0;
    min-width: 0;
    max-width: 25%;
    box-sizing: border-box;
    height: auto;
    display: flex
;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #dcdcdc;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: 0.2s 
ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 8px 10px;
    text-align: center;
    position: relative;
}

.custom-contact-form .services-form .service-checkbox:hover {
  border-color: #d70108;
  box-shadow: 0 2px 6px rgba(215, 1, 8, 0.1);
}

.custom-contact-form .services-form input[type="checkbox"] {
  display: none; /* cache la vraie checkbox */
}

.custom-contact-form .services-form input[type="radio"] {
  opacity: 0; /* cache le radio mais garde la fonctionnalité */
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.custom-contact-form .services-form .service-checkbox:has(input:checked),
.custom-contact-form
  .services-form
  input[type="checkbox"]:checked
  + .service-icon
  + .label,
.custom-contact-form
  .services-form
  .service-checkbox:has(input[type="radio"]:checked) {
  border-color: #d70108;
}

/* Style initial pour les services pré-cochés */
.custom-contact-form .services-form .service-checkbox:has(input[checked]),
.custom-contact-form .services-form .service-checkbox.selected {
  border-color: #d70108;
}

/* Icônes des services */
.custom-contact-form .services-form .service-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  transition: filter 0.2s ease;
}

/* Quand il n'y a pas d'icône, ajuster l'espacement */
.custom-contact-form
  .services-form
  .service-checkbox:not(:has(.service-icon))
  .label {
  margin-top: 8px;
}

/* Labels des services */
.custom-contact-form .services-form .label {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  color: #333;
  word-break: normal;
}

/* Bouton envoyer */
.custom-contact-form .btn-submit {
  width: 100% !important;
  border-radius: 5px !important;
  background: #d70108;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding: 10px;
  border: none;
  cursor: pointer;
  margin-top: 0px;
}

.custom-contact-form .btn-submit:hover {
  background: #b60006;
}

/* Cases à cocher */
.custom-contact-form input[type="checkbox"] {
  margin-right: 8px;
}

.custom-contact-form span.checkbox-label {
  font-size: 16px !important;
}

/* Checkboxes rouge pour has_code_broker et consentement */
.custom-contact-form input[type="checkbox"][name="has_code_broker"],
.custom-contact-form input[type="checkbox"][name="consentement"],
.custom-contact-form input[type="checkbox"][name="centres[]"] {
  accent-color: #d70108;
  width: 18px;
  height: 18px;
  display: inline-block !important;
  margin-right: 8px;
  cursor: pointer;
  transform: scale(1);
}

/* Style personnalisé pour les checkboxes (fallback) */
#contact_buro
  .custom-contact-form
  input[type="checkbox"][name="has_code_broker"]:not(:checked),
#contact_buro
  .custom-contact-form
  input[type="checkbox"][name="consentement"]:not(:checked),
#contact_buro
  .custom-contact-form
  input[type="checkbox"][name="centres[]"]:not(:checked) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #d70108 !important;
  border-radius: 3px !important;
  background: white;
  position: relative;
}

#contact_buro
  .custom-contact-form
  input[type="checkbox"][name="has_code_broker"]:checked,
#contact_buro
  .custom-contact-form
  input[type="checkbox"][name="consentement"]:checked,
#contact_buro
  .custom-contact-form
  input[type="checkbox"][name="centres[]"]:checked {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #d70108;
  border-color: #d70108 !important;
  border-radius: 3px !important;
  position: relative;
}

.custom-contact-form
  input[type="checkbox"][name="has_code_broker"]:checked::after,
.custom-contact-form input[type="checkbox"][name="consentement"]:checked::after,
.custom-contact-form input[type="checkbox"][name="centres[]"]:checked::after {
  content: "✓";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Labels pour checkboxes importantes */
.custom-contact-form label:has(input[name="has_code_broker"]),
.custom-contact-form label:has(input[name="consentement"]),
.custom-contact-form .centres-list label {
  cursor: pointer;
  margin-bottom: 0;
}

.custom-contact-form label:has(input[name="has_code_broker"]):hover,
.custom-contact-form label:has(input[name="consentement"]):hover,
.custom-contact-form .centres-list label:hover {
  color: #d70108;
}

/* Champ de recherche des centres */
.custom-contact-form #search-centre-pays {
  border: 2px solid #d9d9d9;
  border-radius: 10px !important;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  font-size: 14px;
}

.custom-contact-form #search-centre-pays:focus {
  border-color: #d70108;
  outline: none;
}

/* Style pour la liste des centres */
.custom-contact-form .centres-list {
  max-height: 130px;
  overflow-y: auto;
  border: 2px solid #d9d9d9;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  background: white;
  box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.14);
}

.custom-contact-form .centres-list label {
  display: flex;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 5px;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.2s ease;
  padding: 0;
  padding-bottom: 5px;
}

.custom-contact-form .centres-list label:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.custom-contact-form .centres-list input[type="checkbox"] {
  margin-right: 10px;
}

/* Champ code broker caché par défaut */
.custom-contact-form #row-code-broker,
.custom-contact-form #row-code-broker-general {
  display: none;
  margin-top: 0;
  margin-bottom: 10px;
  animation: slideDown 0.3s ease-out;
}

.custom-contact-form #row-code-broker.show,
.custom-contact-form #row-code-broker-general.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 100px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .custom-contact-form .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .custom-contact-form .services-form {
    flex-direction: column;
  }

  .custom-contact-form .services-form .service-checkbox {
    max-width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px;
  }

  .custom-contact-form .services-form .service-icon {
    margin-bottom: 0;
    margin-right: 12px;
  }
}
