/* =============================================================
   Demo booking modal
   ============================================================= */

.book-modal {
  position: fixed; inset: 0; z-index: 9200;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  animation: book-fade 0.18s ease;
}
.book-modal[hidden] { display: none; }
@keyframes book-fade { from { opacity: 0; } to { opacity: 1; } }

.book-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 19, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.book-modal-shell {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 50px 120px -30px rgba(11, 19, 32, 0.45),
    0 8px 24px -10px rgba(11, 19, 32, 0.18);
  animation: book-pop 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow: hidden;
}
@keyframes book-pop {
  from { transform: translateY(12px) scale(0.985); opacity: 0; }
  to   { transform: translateY(0)    scale(1);     opacity: 1; }
}

.book-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, var(--surface-subtle));
}
.book-modal-eyebrow {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.book-modal-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.book-modal-tz {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-soft);
  font-family: var(--font-mono);
}
.book-modal-close {
  width: 32px; height: 32px;
  border: 0; background: transparent;
  color: var(--text-soft);
  font-size: 22px; line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.book-modal-close:hover { background: var(--surface-muted); color: var(--text); }

.book-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 26px 24px;
  -webkit-overflow-scrolling: touch;
}

.book-step { display: flex; flex-direction: column; gap: 18px; }
.book-step-head { display: flex; flex-direction: column; gap: 10px; }
.book-step-blurb { margin: 0; color: var(--text-muted); font-size: 14px; }
.book-step-title { display: flex; align-items: center; gap: 10px; font-size: 15px; }

.book-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
}

.book-back {
  appearance: none; background: transparent; border: 0;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  padding: 4px 0; text-align: left; align-self: flex-start;
}
.book-back:hover { color: var(--teal-deep); }

.book-loading {
  padding: 40px 16px; text-align: center; color: var(--text-soft);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.book-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-muted);
  border-top-color: var(--teal);
  animation: book-spin 0.8s linear infinite;
}
@keyframes book-spin { to { transform: rotate(360deg); } }

/* ---- Step: Type picker ---- */
.book-type-list {
  display: flex; flex-direction: column; gap: 10px;
}
.book-type-card {
  appearance: none;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.book-type-card:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(15,23,42,0.18);
}
.book-type-card-row { display: flex; align-items: center; gap: 14px; }
.book-type-card-dot {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(25,173,197,0.15);
  flex-shrink: 0;
}
.book-type-card-name {
  font-size: 15.5px; font-weight: 600; line-height: 1.25;
}
.book-type-card-desc {
  font-size: 13px; color: var(--text-soft); margin-top: 2px;
}
.book-type-card-meta {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.book-arrow { color: var(--text-soft); font-size: 18px; }

/* ---- Step: Time picker ---- */
.book-time-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) {
  .book-time-grid { grid-template-columns: 1fr; gap: 18px; }
}

.book-cal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 14px;
}
.book-cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.book-cal-month { font-size: 14px; font-weight: 600; }
.book-cal-arrow {
  appearance: none; background: transparent; border: 1px solid var(--border);
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 16px; line-height: 1; cursor: pointer;
  color: var(--text);
}
.book-cal-arrow:hover { background: var(--surface-subtle); border-color: var(--teal); color: var(--teal-deep); }

.book-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 10.5px;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.book-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.book-cal-cell {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
}
.book-cal-cell--blank { visibility: hidden; }
.book-cal-cell.is-available {
  background: var(--teal-wash);
  color: var(--teal-deep);
  font-weight: 600;
}
.book-cal-cell.is-available:hover {
  background: var(--teal);
  color: #fff;
}
.book-cal-cell.is-unavailable,
.book-cal-cell.is-past {
  color: var(--text-soft);
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
}
.book-cal-cell.is-selected {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(25,173,197,0.25);
}

.book-slots {
  display: flex; flex-direction: column; gap: 10px;
}
.book-slots-head {
  font-size: 13.5px; font-weight: 600; color: var(--text);
}
.book-slots-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 360px; overflow-y: auto;
}
.book-slot {
  appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.book-slot:hover {
  border-color: var(--teal);
  background: var(--teal-wash);
  color: var(--teal-deep);
}
.book-slots-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px; color: var(--text-soft);
  background: var(--surface-subtle);
  border-radius: 8px;
}

/* ---- Step: Form ---- */
.book-summary {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.book-summary-row { font-size: 13.5px; color: var(--text); }
.book-summary-when { color: var(--teal-deep); font-weight: 600; }

.book-form { display: flex; flex-direction: column; gap: 14px; }
.book-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 540px) { .book-row { grid-template-columns: 1fr; } }

.book-field { display: flex; flex-direction: column; gap: 6px; }
.book-field > span {
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.book-field > span em {
  color: var(--teal); font-style: normal; font-weight: 700; margin-left: 2px;
}
.book-field .book-optional { color: var(--text-soft); font-weight: 400; font-style: normal; }
.book-field input,
.book-field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.book-field textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.book-field input:focus,
.book-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(25,173,197,0.16);
}

.book-form-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 8px; flex-wrap: wrap;
}
.book-form-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-soft); flex: 1; }
.book-required-note em { color: var(--teal); font-style: normal; font-weight: 700; }
.book-error { color: #B91C1C; font-weight: 500; }

#book-submit { min-width: 160px; position: relative; }
#book-submit.is-loading .book-submit-label { visibility: hidden; }
.book-submit-spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  display: none;
  animation: book-spin 0.7s linear infinite;
}
#book-submit.is-loading .book-submit-spinner { display: block; }

/* ---- Step: Success ---- */
.book-success { text-align: center; padding: 16px 4px 0; }
.book-success-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: var(--teal-wash);
  color: var(--teal-deep);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
}
.book-success-title {
  margin: 0 0 10px;
  font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em;
}
.book-success-when {
  margin: 0 0 6px;
  font-size: 15.5px; color: var(--text); font-weight: 500;
}
.book-success-tz {
  font-size: 12.5px; color: var(--text-soft); font-family: var(--font-mono);
}
.book-success-blurb {
  margin: 12px auto 22px; max-width: 50ch;
  color: var(--text-muted); font-size: 14px; line-height: 1.5;
}
.book-success-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}

/* ---- Step: Error ---- */
.book-error-step { text-align: center; padding: 16px 4px 0; }
.book-error-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: #FEE2E2;
  color: #B91C1C;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700;
}
.book-error-title {
  margin: 0 0 10px;
  font-size: 20px; line-height: 1.2; font-weight: 700;
}
.book-error-blurb {
  margin: 0 auto 22px; max-width: 56ch;
  color: var(--text-muted); font-size: 14px; line-height: 1.5;
}

/* Responsive */
@media (max-width: 640px) {
  .book-modal { padding: 12px; }
  .book-modal-shell { border-radius: 16px; max-height: calc(100vh - 24px); }
  .book-modal-header { padding: 16px 18px 12px; }
  .book-modal-body   { padding: 18px 18px 18px; }
  .book-modal-title  { font-size: 18px; }
}
