
/* =========================================================
   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;

  /* Toujours en flex pour permettre l’anim de sortie */
  display: flex;
  align-items: stretch;           /* occupe toute la hauteur */
  justify-content: flex-end;      /* panneau collé à droite */
  padding: 0;                     /* ← supprime l’espace qui créait la bande noire */

  background: rgba(4, 12, 24, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 10000;

  /* Fermé par défaut via opacité + interactions coupées */
  opacity: 0;
  pointer-events: none;

  /* Fondu du voile */
  transition: opacity .5s ease;

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

/* État ouvert : visible + interactif */
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 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: 407px;
  height: 100vh;                  /* plein écran vertical */
  max-height: 100vh;
  overflow: hidden;               /* aucune barre de scroll dans le panneau */

  background: #fff;
  color: #1D3057;

  /* Ombre orientée vers la gauche (pas de halo côté droit) */
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.18);

  /* Coins côté gauche (style drawer) */
  border-radius: 10px 0 0 10px;

  /* Animation : part hors-écran à droite */
  transform: translateX(100%);
  will-change: transform;
  transition: transform .7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* État ouvert : le panneau revient en place */
.modal-backdrop.is-open .modal {
  transform: translateX(0);
}

/* iOS safe area : évite tout liseré sur iPhone avec encoche */
@supports (padding: max(0px)) {
  .modal {
    padding-right: max(env(safe-area-inset-right), 0px);
  }
}

/* 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: center;
  justify-content: space-between;
  gap: 12px;
  padding: 52px 20px 6px 20px;
}

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


/* Bouton × toujours en haut-droite du panneau */
.modal-close {
  appearance: none;
  background: #f2f4f8;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #1D3057;
  border-radius: 5px;
  width: 32px;
  height: 32px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  font-size: 18px;

  /* >>> positionnement fixe en haut-droite du header <<< */
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;                 /* au-dessus du contenu si besoin */
}
.modal-close:hover { background: #e9edf3; }


/* =========================================================
   DESCRIPTION
   ========================================================= */
.modal-desc {
  font-size: 16px !important;
  line-height: 1.45;
  margin: 0 20px 18px 20px;
  color: #4a5568;
}

/* =========================================================
   FORMULAIRE
   ========================================================= */
.modal-form {
  padding: 8px 20px 20px 20px;
}

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

.form-field {
  display: block;
  margin-bottom: 15px;            /* 15px entre les champs */
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #1D3057;
  font-size: 14px;
  outline: none;
  border-radius: 4px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

/* 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: #7a869a; }

/* Focus */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--blue-primary, #1D3057);
  box-shadow: 0 0 0 3px rgba(39, 80, 158, 0.15);
  background: #fff;
}

/* Select caret */
.select-field { position: relative; }
.select-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-color: #f7f9fc;
}
.select-field .select-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #3b4453;
  pointer-events: none;
}

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

.btn-submit {
  background: #1D3057 !important;     /* bleu foncé de ta maquette */
  color: #ffffff !important;
  padding: 10px 22px !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: "Kodchasan", sans-serif !important;
  transition: background .2s ease;
}
.btn-submit:hover { background: #1D3057 !important; }

/* =========================================================
   RESPONSIVE (drawer mobile)
   ========================================================= */
@media (max-width: 560px) {
  .modal {
    width: min(92vw, 420px);
    height: 100vh;       /* plein écran en hauteur */
    max-height: 100vh;
  }
  .form-row { grid-template-columns: 1fr; }
}

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



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

/* ===== É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;
}

.success-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 200px 20px 12px!important; /* padding bas réduit car bouton en bas */
}

/* Icône */
.success-icon {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  margin: 6px auto 10px;
  color: #1D3057;                    /* bleu foncé de ta palette */
  background: rgba(29,48,87,0.08);
  border-radius: 10px;
}

/* Titre (Kodchasan déjà déclarée dans style.css) */
.success-title {
  font-family: InterTight;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  margin: 12px 0 6px;
  color: #1D3057;
}

/* Texte */
.success-text {
  font-size: 16px;
  line-height: 1.55;
  color: #1D3057;
  max-width: 420px;
  margin: 0 auto;
  font-family: InterTight;
}

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

.btn-return {
  font-family: InterTight;
  background: #1D3057;
  color: #fff;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 400;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Kodchasan", sans-serif;
  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: #fff;               /* fond blanc pour bien voir l'underline */
  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 (tu l'as déjà, on renforce un peu) */
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid #1D3057;           /* ton bleu primary */
  outline-offset: 2px;
}
