/* Tiroir « Contacter » des fiches SIT (variante A, 19/11/2026)
   Couleurs du site : --terracota, --light_nude, --color-text. Le dégradé de .overlay:before est conservé.
   Chargé seulement sur les fiches (inc/SIT/formidable_overlay_contact.php). */

#overlay-contactsit .cf-fiche {
  display: grid;
  gap: 22px;
}

/* En-tête de la fiche */
#overlay-contactsit .cf-fiche__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-right: 48px; /* place du bouton fermer */
}

#overlay-contactsit .cf-fiche__head.--has-image {
  grid-template-columns: 72px minmax(0, 1fr);
}

#overlay-contactsit .cf-fiche__img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  margin: 0;
}

#overlay-contactsit .cf-fiche__id {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#overlay-contactsit .cf-fiche__kind {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracota);
}

#overlay-contactsit .cf-fiche__name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

#overlay-contactsit .cf-fiche__meta {
  font-size: 0.875rem;
  color: var(--color-text);
  opacity: 0.8;
}

#overlay-contactsit .cf-fiche__meta:empty {
  display: none;
}

#overlay-contactsit .cf-fiche__intro {
  font-size: 0.9375rem;
  color: var(--color-text);
  margin: 0 0 18px;
}

/* Grille des champs : deux colonnes, une seule sur mobile */
#overlay-contactsit .cf-fiche .frm_fields_container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  align-items: start;
}

#overlay-contactsit .cf-fiche .frm_fields_container > input[type="hidden"] {
  display: none;
}

#overlay-contactsit .cf-fiche .form-field {
  margin-bottom: 18px !important;
  min-width: 0;
}

#overlay-contactsit .cf-fiche .form-field.cf-full {
  grid-column: 1 / -1;
}

#overlay-contactsit .cf-fiche .form-field p {
  margin: 0;
}

#overlay-contactsit .cf-fiche .form-field br {
  display: none;
}

@media screen and (max-width: 600px) {
  #overlay-contactsit .cf-fiche .frm_fields_container {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Libellés visibles au-dessus des champs */
#overlay-contactsit .cf-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

#overlay-contactsit .cf-opt {
  font-weight: 400;
  opacity: 0.75;
}

#overlay-contactsit .cf-help {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text);
  opacity: 0.8;
  margin-top: 6px;
}

/* Champs : fond blanc pour rester lisibles sur le dégradé nude */
#overlay-contactsit .cf-fiche .form-field input[type="text"],
#overlay-contactsit .cf-fiche .form-field input[type="email"],
#overlay-contactsit .cf-fiche .form-field input[type="tel"],
#overlay-contactsit .cf-fiche .form-field textarea {
  background-color: #fff;
  padding: 12px 14px;
  border-color: var(--terracota);
}

#overlay-contactsit .cf-fiche .form-field textarea {
  height: 150px;
  min-height: 110px;
  resize: vertical;
}

#overlay-contactsit .cf-fiche .form-field input:focus,
#overlay-contactsit .cf-fiche .form-field textarea:focus {
  border-color: var(--color-text);
  box-shadow: 0 0 0 3px rgba(201, 138, 118, 0.3);
}

#overlay-contactsit .cf-fiche .form-field textarea::placeholder {
  color: rgba(60, 26, 26, 0.6);
}

/* Case de consentement */
#overlay-contactsit .cf-fiche .frm_checkbox .wpcf7-list-item {
  margin: 0;
}

#overlay-contactsit .cf-fiche .frm_checkbox label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-left: 0;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
}

#overlay-contactsit .cf-fiche .frm_checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: static;
  opacity: 1;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--terracota);
  background: #fff center / 14px 14px no-repeat;
  cursor: pointer;
  transition: background-color 0.15s;
}

#overlay-contactsit .cf-fiche .frm_checkbox input[type="checkbox"]:checked {
  background-color: var(--terracota);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

#overlay-contactsit .cf-fiche .frm_checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

#overlay-contactsit .cf-fiche .wpcf7-not-valid input[type="checkbox"],
#overlay-contactsit .cf-fiche .frm_checkbox .wpcf7-not-valid input[type="checkbox"] {
  box-shadow: inset 0 0 0 1px #f21d4e;
}

/* Le carré dessiné par le thème sur le label est remplacé par la case ci-dessus */
#overlay-contactsit .cf-fiche .frm_checkbox label::before,
#overlay-contactsit .cf-fiche .frm_checkbox label::after {
  content: none;
  display: none;
}

#overlay-contactsit .cf-fiche .frm_checkbox .wpcf7-list-item-label::before,
#overlay-contactsit .cf-fiche .frm_checkbox .wpcf7-list-item-label::after {
  content: none;
  display: none;
}

#overlay-contactsit .cf-fiche .frm_checkbox a {
  color: var(--terracota);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bouton plein, pleine largeur, collé en bas du tiroir */
#overlay-contactsit .cf-fiche .frm_submit {
  margin: 4px 0 0 !important;
}

/* Mobile : marges latérales pour que les champs ne touchent pas le bord de l'écran */
@media screen and (max-width: 600px) {
  #overlay-contactsit .bloc-form.cf-fiche {
    padding-left: 16px;
    padding-right: 16px;
  }
}

#overlay-contactsit .cf-fiche .frm_submit p {
  position: relative;
}

#overlay-contactsit .cf-fiche .wpcf7-submit {
  width: 100%;
  font-weight: 600;
}

#overlay-contactsit .cf-fiche .wpcf7-spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  margin: -12px 0 0;
}

/* Erreurs : rouge du site, sous chaque champ */
#overlay-contactsit .cf-fiche .wpcf7-not-valid-tip {
  font-size: 0.8125rem;
}

#overlay-contactsit .cf-fiche .wpcf7-response-output {
  font-size: 0.875rem;
}

#overlay-contactsit .cf-fiche .wpcf7-form.sent .wpcf7-response-output {
  display: none;
}

/* Confirmation après envoi */
#overlay-contactsit .cf-fiche__done {
  display: grid;
  gap: 14px;
  align-content: start;
  color: var(--color-text);
}

#overlay-contactsit .cf-fiche__done[hidden] {
  display: none;
}

#overlay-contactsit .cf-fiche__done:focus {
  outline: none;
}

#overlay-contactsit .cf-fiche__done p {
  margin: 0;
}

#overlay-contactsit .cf-fiche__check {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  color: var(--olivier, #879d82);
}

#overlay-contactsit .cf-fiche__done-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--terracota);
}

#overlay-contactsit .cf-fiche__small {
  font-size: 0.875rem;
  opacity: 0.85;
}

#overlay-contactsit .cf-fiche__next {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--light_nude);
}

#overlay-contactsit .cf-fiche__next .btn {
  width: 100%;
  margin: 0;
  text-align: center;
}

#overlay-contactsit .cf-fiche.--sent .cf-fiche__form {
  display: none;
}

/* Le tiroir passe devant l'assistante Rosie (conteneur .n8n-chat-widget, z-index 99999).
   Fermé, il reste hors écran et masqué : il ne gêne rien. */
#overlay-contactsit {
  z-index: 100000;
}

/* Le tiroir glisse depuis la droite (le thème fait descendre tous les tiroirs du haut) */
#overlay-contactsit:not(.open) {
  transform: translateX(100%);
}

#overlay-contactsit.open {
  transform: none;
}
