.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(22, 66, 131, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden; /* Empêche le scroll sur le body */
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh; /* hauteur max à 90% de la fenêtre */
  overflow-y: auto; /* permet le scroll interne si contenu long */
  position: relative;
  color: #164283;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #164283;
}

.step h3 {
  margin-top: 1.5rem;
  font-size: 1.2rem;
}

.calendar-section,
.slots-section {
  margin-top: 1rem;
}

.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.slots button {
  padding: 0.5rem 1rem;
  border: none;
  background-color: #eeeeee;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.slots button:hover {
  background-color: #164283;
  color: white;
}

.slots button.selected {
  background-color: #e94e1b;
  color: white;
}

.confirmation-message {
  margin-top: 1rem;
  font-weight: bold;
  color: #164283;
}

.btn {
  margin-top: 2rem;
  padding: 0.6rem 1.2rem;
  background-color: #e94e1b;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  /* opacity: 0.5; */
  /* pointer-events: none; */
}

.btn.enabled {
  opacity: 1;
  pointer-events: auto;
}

/* Effet d'apparition du popup */
.popup-content {
  animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Curseur pointer sur fond cliquable */
.popup {
  cursor: pointer;
}

.popup-content {
  cursor: default; /* empêche le clic sur fond de fermer le popup quand on clique sur le contenu */
}

#appointment-date {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
  max-width: 250px;
}

.hidden {
  display: none;
}

#autre-motif {
  margin-top: 0.5rem;
  display: block;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.step label {
  display: block;
  margin-top: 0.5rem;
}

#contact-form input {
  margin-top: 0.3rem;
  padding: 0.4rem;
  width: 100%;
  max-width: 300px;
  border: 1px solid #ccc;
  border-radius: 5px;
}


/* Scroll smooth */
.popup-content::-webkit-scrollbar {
  width: 6px;
}

.popup-content::-webkit-scrollbar-thumb {
  background: #e94e1b;
  border-radius: 3px;
}

/* ------------------ Responsive ------------------ */
@media screen and (max-width: 768px) {
  .popup-content {
    width: 90%;
    box-sizing: border-box;
    padding: 2rem;
    max-height: 95vh;
  }

  .step h3 {
    font-size: 1rem;
  }

  .slots {
    flex-direction: column;
  }

  .slots button {
    width: 100%;
    text-align: center;
  }

  #contact-form input,
  #autre-motif {
    max-width: 100%;
  }

  .btn {
    width: 100%;
    padding: 0.8rem;
  }
}

@media screen and (max-width: 480px) {
  .popup-content {
    padding: 1rem;
  }

  .close-btn {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.2rem;
  }

  .step h3 {
    font-size: 0.95rem;
  }
}