/* ========== Booking Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: #ffffff;
  border-radius: 16px;
  max-width: 580px;
  width: 90%;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0; /* padding moved to sticky wrapper & form */
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

/* ========== Sticky Top Section ========== */
.modal-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  padding: 2.5rem 2.5rem 0.5rem 2.5rem; /* same spacing as original container */
  display: flex;
  flex-direction: column;
  /* ensure close button stays within this area */
}

/* Close button inside sticky wrapper */
.modal-top .modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.3rem;
}

/* --- Close Button --- */
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  color: var(--sunlife-dark);
}

/* --- Header --- */
.modal-header {
  margin-bottom: 2rem;
}

.modal-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.8rem;
  color: var(--sunlife-dark, #1e293b);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.modal-subtitle {
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* --- Form (scrollable area) --- */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 0 2.5rem 2.5rem 2.5rem; /* left/right/bottom padding, no top (sticky wrapper provides it) */
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sunlife-dark, #1e293b);
  margin-bottom: 0.3rem;
}

.required {
  color: #e53e3e;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  background: #f8fafc;
  color: #1e293b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--sunlife-marigold, #eab308);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.12);
  background: #ffffff;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* --- Submit Button --- */
.form-actions {
  margin-top: 0.5rem;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--sunlife-marigold, #eab308);
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
  width: 100%;
}

.btn-submit:hover {
  background: #d49b06;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.45);
}

.btn-submit i {
  font-size: 0.9rem;
}

/* --- Form Status (success/error messages) --- */
.form-status {
  text-align: center;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  min-height: 1.5em;
  font-weight: 500;
}

.form-status.success {
  color: #16a34a;
}

.form-status.error {
  color: #dc2626;
}

.modal-container::-webkit-scrollbar {
  display: none;
}

.modal-container {
  scrollbar-width: none;
}

/* ========== Mobile (max-width: 600px) ========== */
@media (max-width: 600px) {
  .modal-top {
    padding: 2rem 1.5rem 0.5rem 1.5rem;
  }

  .booking-form {
    padding: 0 1.5rem 2rem 1.5rem;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1.2rem;
  }

  .form-row .form-group {
    min-width: 100%;
  }
}
