/* =========================================================
   ACCESSIBILITÉ UTILE
   ========================================================= */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   BACKDROP — DOCK À DROITE, AUCUNE BANDE NOIRE, PAS DE SCROLL
   (masquage par opacité pour permettre les animations)
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;

  /* Centrer la modale */
  display: flex;
  justify-content: right;
  align-items: center;
  padding: 20px;

  background: rgba(29, 48, 87, 0.52);
  /* backdrop-filter: blur(2px); */
  z-index: 10000;

  /* Fermé par défaut via opacité + interactions coupées */
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);

  /* Slide et fondu du voile */
  transition: opacity .5s ease, transform .4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Évite le scroll chaining sur mobile */
  overscroll-behavior: contain;
}

/* État ouvert : visible + interactif + slide */
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Masquer visuellement la scrollbar (si le moteur en dessine une) */
.modal-backdrop::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* =========================================================
   PANNEAU — SLIDE IN/OUT DROITE, PLEINE HAUTEUR, PAS DE SCROLL INTERNE
   ========================================================= */
.modal {
  width: 100%;
  max-width: 407px;
  max-height: 700px;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;

  background: #fff;
  color: #1D3057;

  /* Ombre centrale */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);

  /* Coins arrondis partout */
  border-radius: 4px;

  /* Animation : slide in/out de droite à gauche */
  transform: translateX(100%);
  opacity: 1;
  will-change: transform, opacity;
  transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* État ouvert : la modale slide vers la gauche */
.modal-backdrop.is-open .modal {
  transform: translateX(0);
  opacity: 1;
}

/* Mobile : dimensions optimisées */
@media (max-width: 520px) {
  .modal {
    width: calc(100% - 32px);
    max-width: none;
    max-height: 80vh;
    margin: 0 auto;
  }

  .modal-header {
    padding: 20px 20px 10px 20px;
  }

  .modal-header h6 {
    font-size: 22px !important;
    margin: 0 0 4px 0;
    padding-right: 40px;
  }

  .modal-close {
    top: 29px;
    right: 12px;
  }

  .modal-desc {
    margin: 0 20px 16px 20px;
    font-size: 14px !important;
    font-family: "Inter Tight", sans-serif;
  }

  .modal-form {
    padding: 0 20px 20px 20px;
  }
}

/* Option : si tu veux enlever toute ombre pour être sûr de 0 bande sombre */
/* .modal { box-shadow: none; } */

/* =========================================================
   NEUTRALISER LES .container INTERNES
   ========================================================= */
.modal .container {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* =========================================================
   HEADER
   ========================================================= */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 12px 24px;
  position: relative;
}

.modal-header h6 {
  font-size: 24px !important;
  line-height: 1.2;
  margin: 0;
  font-family: "Inter Tight", sans-serif;
  font-weight: 400;
  color: var(--blue-dark, #1D3057);
}


/* Bouton × en haut-droite de la modale */
.modal-close {
  appearance: none;
  background: transparent;
  border: none;
  color: transparent;
  border-radius: 4px;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  font-size: 0px;
  flex-shrink: 0;
  position: absolute;
  top: 30px;
  right: 14px;

  transition: background-color .2s ease, border-color .2s ease;
  
  /* Afficher l'icône X en pseudo-élément */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal-close::before {
  content: '';
  width: 34px;
  height: 34px;
  opacity: 1;
  display: block;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width=%2734%27 height=%2734%27 viewBox=%270 0 34 34%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3crect width=%2734%27 height=%2734%27 rx=%274%27 fill=%27%231D3057%27 fill-opacity=%270.08%27/%3e%3cpath d=%27M16.9997 15.5865L21.9495 10.6367L23.3637 12.0509L18.4139 17.0007L23.3637 21.9504L21.9495 23.3646L16.9997 18.4149L12.05 23.3646L10.6357 21.9504L15.5855 17.0007L10.6357 12.0509L12.05 10.6367L16.9997 15.5865Z%27 fill=%27%231D3057%27/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 34px 34px;
}

.modal-close:hover {
  background: #1D3057;
}

.modal-close:hover::before {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width=%2734%27 height=%2734%27 viewBox=%270 0 34 34%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3crect width=%2734%27 height=%2734%27 rx=%274%27 fill=%27%231D3057%27 fill-opacity=%270.08%27/%3e%3cpath d=%27M16.9997 15.5865L21.9495 10.6367L23.3637 12.0509L18.4139 17.0007L23.3637 21.9504L21.9495 23.3646L16.9997 18.4149L12.05 23.3646L10.6357 21.9504L15.5855 17.0007L10.6357 12.0509L12.05 10.6367L16.9997 15.5865Z%27 fill=%27%23FFFFFF%27/%3e%3c/svg%3e");
}


/* =========================================================
   DESCRIPTION
   ========================================================= */
.modal-desc {
  font-size: 16px !important;
  margin: 0 24px 20px 24px;
  color: #1D3057;
  font-family: "Inter Tight", sans-serif;
}

/* =========================================================
   FORMULAIRE
   ========================================================= */
.modal-form {
  padding: 0 24px 24px 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  /* espace horizontal + vertical */
}

.form-field {
  display: block;
  margin-bottom: 15px;
  position: relative;
}

.form-field label {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 12px;
  color: rgba(29, 48, 87, 0.52);
  font-family: "Inter Tight", sans-serif;
  font-weight: 400;
  pointer-events: none;
  z-index: 1;
  opacity: 1;
  transition: opacity .2s ease;
}

/* Masquer le label quand le placeholder est visible */
.form-field input:placeholder-shown ~ label,
.form-field textarea:placeholder-shown ~ label {
  opacity: 0;
  pointer-events: none;
}



.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 22px 14px 8px 14px;
  background: #f7f9fc;
  border: none;
  color: #1D3057;
  font-size: 16px;
  font-family: "Inter Tight", sans-serif;
  font-weight: 400;
  outline: none;
  border-radius: 4px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

/* Placeholder centré quand le champ est vide */
.form-field input:placeholder-shown,
.form-field textarea:placeholder-shown {
  padding: 0 14px;
  text-align: left;
  line-height: 47px;
  
}
.form-field textarea:placeholder-shown {
 
  height: 120px;
}


/* Si tu veux zéro scroll strict dans le panneau : garde resize vertical (ou mets none) */
.form-field textarea {
  resize: vertical;
  /* mettre "none" si tu veux interdire le resize */
  min-height: 120px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #1D3057;
  opacity: 0.8;
}

/* Focus */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  /* background: #fff; */
}

/* Select caret */
.select-field {
  position: relative;
}

.select-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231D3057' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  background-attachment: scroll;
}


/* Options du select */
select option {
  padding: 12px 14px;
  background: #f7f9fc;
  color: #1D3057;
  border: none;
}

select option:checked {
  background: linear-gradient(#EBF0F7, #EBF0F7);
  color: #1D3057;
}

select option:hover {
  background: #f7f9fc;
  color: #1D3057;
}

select option:disabled {
  background: #f7f9fc;
  color: #1D3057;
}

/* Afficher le placeholder quand aucune option n'est sélectionnée */
select:invalid {
  color: #1D3057;
}

/* Masquer le label du select quand le placeholder est visible */
.select-field select:invalid ~ label {
  opacity: 0;
  pointer-events: none;
}

.select-field .select-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #1D3057;
  pointer-events: none;
  display: none;
}

/* =========================================================
   CTA / BOUTON
   ========================================================= */
.form-actions {
  margin-top: 15px;
}

.btn-submit {
  background: #1D3057 !important;
  /* bleu foncé de ta maquette */
  color: #ffffff !important;
  width: 88px !important;
  height: 38px !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: "Inter Tight", sans-serif !important;
  transition: background .2s ease;
}

.btn-submit:hover {
  background: #1D3057 !important;
}

/* =========================================================
   RESPONSIVE (modale mobile)
   ========================================================= */
@media (max-width: 560px) {
  .modal {
    width: min(95vw, 500px);
    max-height: 95vh;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   ACCESSIBILITÉ — réduire animations
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .modal {
    transition: none !important;
  }

  .modal-backdrop {
    transition: none !important;
  }
}



/* ===== Succès : ne pas afficher le titre du header, garder la croix ===== */
.modal.is-success .modal-header h6 {
  display: none !important;
}

.modal.is-success {
  height: 700px;
  max-height: 700px;
}

/* ===== Écran de succès (bouton en bas, sans footer séparé) ===== */
.modal-success[hidden] {
  display: none !important;
}

.modal-success {
  display: flex;
  flex-direction: column;
  /* height: 100%; */
  /* prend toute la hauteur du panneau .modal */
  width: 100%;
  background: #fff;
  color: #1D3057;
  margin-top: 100px;
}

.success-body {
  flex: 0 0 auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 24px 8px !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
}

/* Icône */
.success-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  color: #1D3057;
  /* bleu foncé de ta palette */
  border-radius: 10px;
  flex-shrink: 0;
}

/* Titre (Kodchasan déjà déclarée dans style.css) */
.success-title {
  font-family: Inter Tight, sans-serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  margin: 8px 0 4px;
  color: #1D3057;
}

/* Texte */
.success-text {
  font-size: 16px;
  line-height: 1.5;
  color: #1D3057;
  max-width: 327px;
  max-height: 63px;
  margin: 0 auto 0px;
  font-family: Inter Tight, sans-serif;
}

/* Bouton en bas (même bloc succès) */
.success-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 8px 24px 16px 24px;
  background: #fff;
  margin-top: 266px;
}

.btn-return {
  font-family: Inter Tight, sans-serif;
  background: #1D3057;
  color: #fff;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 400;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, transform .06s ease, box-shadow .2s ease;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .06);
}

.btn-return:hover {
  background: #162747;
}

.btn-return:active {
  transform: translateY(1px);
}

/* Mobile */
@media (max-width: 560px) {
  .success-body {
    max-width: 86%;
    padding: 26px 16px 10px;
  }

  .success-title {
    font-size: 21px;
  }

  .success-text {
    font-size: 15px;
  }

  .success-actions {
    padding: 12px 12px 16px;
  }
}



/* ========= ÉTAT ERREUR (champs) — style "underline" comme la maquette ========= */
.form-field.is-error input,
.form-field.is-error select,
.form-field.is-error textarea {
  /* on garde l'apparence de tes inputs, mais on force une bordure basse rouge épaisse */
  border-color: rgba(0, 0, 0, 0.06);
  /* bordure gris clair par défaut */
  background-color: #f7f9fc;
  /* même couleur que les autres champs */
  box-shadow: none;
  border-bottom: 2px solid #D93025;
  /* << soulignement rouge */
}

/* Message d'erreur : sous le champ, aligné à droite */
.field-error {
  margin: 6px 2px 0 0;
  /* petit écart comme ta capture */
  color: #D93025;
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
}

/* Ajuste l'espacement vertical de chaque bloc champ */
.form-field {
  margin-bottom: 16px;
}

/* Focus accessible - pas d'outline visible */
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
}
.btn-submit:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.16),
      rgba(255, 255, 255, 0.16)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-submit:hover::after {
  opacity: 1;
}

