/* ============================================================
   SKY JIU JITSU - Booking Modal (V2.1)
   ============================================================ */

.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.booking-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.booking-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.booking-modal__card {
  position: relative;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--duration-normal) var(--ease-spring);
  max-height: calc(100vh - var(--space-lg));
  overflow-y: auto;
}

.booking-modal.is-open .booking-modal__card {
  transform: translateY(0) scale(1);
}

.booking-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-modal__close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.booking-modal__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-display);
  color: var(--text-primary);
  margin: 0 0 var(--space-2xs);
  line-height: var(--lh-tight);
}

.booking-modal__subtitle {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
  line-height: var(--lh-body);
}

/* ====================
   FORM
   ==================== */

.booking-modal__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.booking-form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.booking-form__field label {
  font-size: var(--fs-tag);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-tag);
  color: var(--text-secondary);
}

.booking-form__field input,
.booking-form__field select {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.booking-form__field input:focus,
.booking-form__field select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.booking-form__field input::placeholder {
  color: var(--text-muted);
}

/* Honeypot - hidden from real users */
.booking-form__honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.booking-form__error {
  color: #B91C1C;
  font-size: var(--fs-small);
  min-height: 0;
  line-height: var(--lh-body);
}

.booking-form__error:not(:empty) {
  padding: var(--space-2xs) var(--space-sm);
  background: rgba(185, 28, 28, 0.06);
  border-left: 3px solid #B91C1C;
  border-radius: var(--radius-sm);
}

/* Submit button */
.booking-form__submit {
  position: relative;
  margin-top: var(--space-2xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
}

.booking-form__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.booking-form__submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bm-spin 0.7s linear infinite;
}

.booking-form__submit.is-loading .booking-form__submit-text {
  opacity: 0.6;
}

.booking-form__submit.is-loading .booking-form__submit-spinner {
  display: inline-block;
}

@keyframes bm-spin {
  to { transform: rotate(360deg); }
}

.booking-form__alt {
  text-align: center;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  margin: var(--space-sm) 0 0;
}

.booking-form__alt a {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
}

.booking-form__alt a:hover {
  text-decoration: underline;
}

/* ====================
   SUCCESS STATE
   ==================== */

.booking-modal__success-state {
  text-align: center;
  padding: var(--space-md) 0;
}

.booking-modal__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: rgba(58, 110, 165, 0.1);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-modal__success-icon svg {
  width: 32px;
  height: 32px;
}

.booking-modal__success-state .booking-modal__title {
  margin-bottom: var(--space-sm);
}

.booking-modal__success-state .booking-modal__subtitle {
  margin-bottom: var(--space-md);
}

/* ====================
   MOBILE
   ==================== */

@media (max-width: 600px) {
  .booking-modal {
    padding: 0;
    align-items: flex-end;
  }

  .booking-modal__card {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    padding: var(--space-lg) var(--space-md) var(--space-md);
    transform: translateY(100%);
  }

  .booking-modal.is-open .booking-modal__card {
    transform: translateY(0);
  }

  .booking-modal__title {
    font-size: 1.75rem;
  }
}

/* Prevent body scroll when modal is open */
body:has(.booking-modal.is-open) {
  overflow: hidden;
}
