/* =========================================
   BOOKING MODAL — centered, premium
========================================= */

.book-modal[hidden] {
  display: none !important;
}

.book-modal {
  position: fixed;
  inset: 0;
  z-index: 1200; /* above site header (z-index: 999) */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Keep clear of sticky header so dialog sits mid-viewport */
  padding:
    max(32px, calc(var(--topbar-height, 42px) + var(--navbar-height, 88px) + 24px))
    clamp(16px, 4vw, 32px)
    max(32px, 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.book-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.book-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: min(72vh, 640px);
  margin: auto;
  overflow: auto;
  padding: 0;
  border-radius: 28px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background: #ffffff;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 28px 64px rgba(15, 23, 42, 0.2);
  animation: bookModalIn 0.28s ease;
}

@keyframes bookModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.book-modal-dialog::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-700), var(--primary-400));
  border-radius: 28px 28px 0 0;
}

.book-modal-close {
  position: absolute;
  top: 18px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.95);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.book-modal-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
  transform: scale(1.04);
}

.book-modal-close svg,
.book-modal-close i {
  width: 18px;
  height: 18px;
}

.book-modal-progress {
  display: flex;
  gap: 8px;
  padding: 22px 28px 0;
  margin: 0;
}

.book-modal-progress span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.25s ease;
}

.book-modal-progress span.is-active,
.book-modal-progress span.is-done {
  background: var(--primary-700);
}

.book-modal-form {
  padding: 20px 28px 28px;
}

.book-modal-eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-700);
}

.book-modal-form h2 {
  margin: 0 0 10px;
  padding-right: 36px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--primary-800);
}

.book-modal-lead {
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.book-step {
  display: grid;
  gap: 16px;
}

.book-step[hidden] {
  display: none !important;
}

.book-modal-field {
  display: grid;
  gap: 8px;
}

.book-modal-field span {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary);
}

.book-modal-field span em {
  font-style: normal;
  color: var(--danger);
}

.book-modal-field span small {
  font-weight: 500;
  color: var(--text-light);
}

.book-modal-field input,
.book-modal-field select,
.book-modal-field textarea {
  width: 100%;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.book-modal-field input,
.book-modal-field select {
  height: 52px;
  padding: 0 16px;
}

.book-modal-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.book-modal-field textarea {
  padding: 14px 16px;
  resize: vertical;
  min-height: 96px;
}

.book-modal-field input:hover,
.book-modal-field select:hover,
.book-modal-field textarea:hover {
  border-color: #cbd5e1;
}

.book-modal-field input:focus,
.book-modal-field select:focus,
.book-modal-field textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary-700);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.book-modal-locked {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f0fdfa, #ecfdf5);
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.book-modal-locked span {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-700);
}

.book-modal-locked strong {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.book-modal-mode {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.book-modal-mode legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary);
}

.book-modal-mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid #dbe3ea;
  background: #f8fafc;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.book-modal-mode-option:hover {
  border-color: rgba(15, 118, 110, 0.35);
}

.book-modal-mode-option:has(input:checked) {
  border-color: var(--primary-700);
  background: #f0fdfa;
  color: var(--primary-800);
}

.book-modal-mode-option input {
  accent-color: var(--primary-700);
}

.book-modal-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-family: var(--font-body);
  font-size: 13px;
}

.book-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.book-modal-actions--split {
  justify-content: space-between;
}

.book-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.book-modal-btn--primary {
  flex: 1;
  background: var(--primary-700);
  color: #ffffff;
  border-color: var(--primary-700);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.book-modal-btn--primary:hover {
  background: var(--primary-800);
  border-color: var(--primary-800);
  transform: translateY(-1px);
}

.book-modal-btn--primary:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.book-modal-btn--secondary {
  min-width: 108px;
  background: #ffffff;
  color: var(--primary-800);
  border-color: rgba(15, 118, 110, 0.22);
}

.book-modal-btn--secondary:hover {
  background: #f0fdfa;
  border-color: var(--primary-700);
}

.book-modal-success {
  text-align: center;
  padding: 20px 4px 4px;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.book-modal-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ecfdf5, #ccfbf1);
  color: var(--primary-700);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
}

.book-modal-success-icon svg,
.book-modal-success-icon i {
  width: 32px;
  height: 32px;
}

.book-modal-success h2 {
  margin: 0;
  padding: 0;
}

.book-modal-success p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
}

.book-modal-success-note {
  max-width: 34ch;
  color: var(--text-secondary) !important;
  font-size: 14px !important;
}

.book-modal-success .book-modal-btn {
  width: 100%;
  margin-top: 6px;
}

body.book-modal-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .book-modal {
    align-items: center;
    padding:
      max(24px, calc(var(--navbar-height, 72px) + 20px))
      14px
      24px;
  }

  .book-modal-dialog {
    width: 100%;
    max-height: min(70vh, 620px);
    border-radius: 24px;
  }

  .book-modal-progress {
    padding: 20px 20px 0;
  }

  .book-modal-form {
    padding: 18px 20px 22px;
  }

  .book-modal-mode {
    grid-template-columns: 1fr;
  }
}
