/* =========================
   MODAL RDV
   ========================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 9999;

  /* Permet le scroll si la popup dépasse l'écran */
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal.active {
  display: flex;
}

/* CONTENU */
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: min(92%, 760px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

/* BOUTON FERMER */
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;

  font-size: 22px;
  border: none;
  background: none;
  cursor: pointer;
}

/* FORM */
.modal-content form {
  margin-top: 10px;
}

.modal-content input,
.modal-content select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

/* =========================
   FORMULAIRE RDV 2 COLONNES
   ========================= */

.rdv-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* COLONNE GAUCHE */
.rdv-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* COLONNE DROITE */
.rdv-right {
  display: flex;
}

.rdv-right textarea {
  width: 100%;
  height: 100%;
  min-height: 200px;
  resize: vertical;
}

/* BOUTON */
.rdv-submit {
  grid-column: span 2;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* NOTE CONFIDENTIALITÉ */
.form-privacy-note {
  grid-column: span 2;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #555;
  text-align: center;
}

.form-privacy-note a {
  color: var(--blue, #002191);
  text-decoration: underline;
}

/* INPUT STYLE */
.rdv-form-grid input,
.rdv-form-grid select,
.rdv-form-grid textarea {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 768px) {
  .modal {
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
  }

  .modal-content {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 22px 16px;
    border-radius: 14px;
  }

  .rdv-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .rdv-submit,
  .form-privacy-note {
    grid-column: span 1;
  }

  .rdv-right textarea {
    min-height: 120px;
  }

  .rdv-submit .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 10px;
  }

  .modal-content {
    max-height: calc(100dvh - 20px);
    padding: 20px 14px;
  }

  .modal-content h3 {
    padding-right: 34px;
    font-size: 1.25rem;
  }

  .modal-close {
    font-size: 24px;
  }
}


/* =========================
   LABELS FORMULAIRE RDV
   ========================= */

.rdv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rdv-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue, #002191);
  line-height: 1.35;
}

.rdv-field__hint {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 400;
  color: #666;
}

.rdv-field--message {
  width: 100%;
  height: 100%;
}

.rdv-form-grid input:focus,
.rdv-form-grid select:focus,
.rdv-form-grid textarea:focus {
  outline: none;
  border-color: var(--blue, #002191);
  box-shadow: 0 0 0 3px rgba(0, 33, 145, 0.12);
}

/* =========================
   CENTRAGE BAS FORMULAIRE RDV
   ========================= */

.rdv-submit {
  display: flex;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.rdv-submit .btn {
  margin-left: auto;
  margin-right: auto;
}

.rdv-form-grid .form-privacy-note {
  grid-column: 1 / -1;
  text-align: center;
  max-width: 720px;
  margin: 0.75rem auto 0;
}
