/* ============================================================
   TAVEO — Booking Modal (landing v3)
   Editorial minimalist, white + #1788FD, Geist.
   Inherits design tokens from landing-v3.css.
   ============================================================ */

/* Lock body scroll without layout shift */
html.bm-lock,
body.bm-lock {
  overflow: hidden;
  touch-action: none;
}

/* ---------- Backdrop ---------- */
.bm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 22, 38, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .28s cubic-bezier(.22, 1, .36, 1),
    background-color .28s cubic-bezier(.22, 1, .36, 1),
    backdrop-filter .28s cubic-bezier(.22, 1, .36, 1);
  display: grid;
  place-items: center;
  padding: clamp(0px, 4vw, 40px);
}

.bm-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(10, 22, 38, .42);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
}

/* ---------- Dialog ---------- */
.bm-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(10, 22, 38, .04),
    0 4px 12px rgba(10, 22, 38, .04),
    0 32px 80px -16px rgba(10, 79, 168, .22);
  overflow: hidden;
  transform: translateY(14px) scale(.985);
  opacity: 0;
  transition:
    transform .32s cubic-bezier(.22, 1, .36, 1),
    opacity .28s cubic-bezier(.22, 1, .36, 1);
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
}

.bm-backdrop.is-open .bm-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---------- Close button ---------- */
.bm-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--mute);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.bm-close:hover {
  background: var(--line-2);
  color: var(--ink);
}

.bm-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.bm-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

/* ---------- Progress rail ---------- */
.bm-progress {
  height: 2px;
  background: var(--line-2);
  position: relative;
  flex-shrink: 0;
}

.bm-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 20%;
  background: var(--blue);
  transition: width .42s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Body / steps stage ---------- */
.bm-body {
  position: relative;
  padding: clamp(30px, 5vw, 44px) clamp(26px, 5vw, 44px) clamp(28px, 4vw, 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.bm-step {
  display: none;
}

.bm-step.is-active {
  display: block;
  animation: bm-step-in .32s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes bm-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Step header ---------- */
.bm-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mute);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 18px;
  letter-spacing: -.005em;
  transition: color .15s var(--ease);
}

.bm-back:hover {
  color: var(--ink);
}

.bm-back:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.bm-back svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bm-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-ink);
  display: block;
  margin-bottom: 14px;
}

.bm-title {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}

.bm-desc {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: 8px;
  letter-spacing: -.005em;
}

/* ---------- Step 1: options ---------- */
.bm-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.bm-option {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color .18s var(--ease),
    background .18s var(--ease),
    transform .18s var(--ease);
  letter-spacing: -.005em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bm-option:hover {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: var(--blue-tint-2);
}

.bm-option.is-selected {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.bm-option:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 136, 253, .14);
}

.bm-option-arrow {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--mute);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform .2s var(--ease), stroke .2s var(--ease);
}

.bm-option:hover .bm-option-arrow,
.bm-option.is-selected .bm-option-arrow {
  stroke: var(--blue);
  transform: translateX(3px);
}

/* ---------- Step 2: email ---------- */
.bm-form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bm-input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition:
    border-color .18s var(--ease),
    box-shadow .18s var(--ease);
  letter-spacing: -.005em;
}

.bm-input::placeholder {
  color: var(--mute);
}

.bm-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 136, 253, .12);
}

.bm-input.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .12);
}

.bm-error {
  font-size: 13px;
  color: var(--red);
  line-height: 1.4;
  display: none;
  letter-spacing: -.005em;
}

.bm-error.is-visible {
  display: block;
  animation: bm-step-in .2s ease both;
}

.bm-btn-primary {
  appearance: none;
  border: none;
  width: 100%;
  height: 54px;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px -10px var(--blue-glow);
  transition:
    background .2s var(--ease),
    transform .2s var(--ease),
    box-shadow .25s var(--ease);
}

.bm-btn-primary:hover {
  background: var(--blue-ink);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -10px var(--blue-glow);
}

.bm-btn-primary:active {
  transform: translateY(0);
}

.bm-btn-primary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.bm-btn-primary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s var(--ease);
}

.bm-btn-primary:hover svg {
  transform: translateX(3px);
}

.bm-btn-primary[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.bm-btn-secondary {
  appearance: none;
  border: 1px solid var(--line);
  width: 100%;
  height: 54px;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    background .18s var(--ease),
    border-color .18s var(--ease);
}

.bm-btn-secondary:hover {
  background: var(--blue-tint-2);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
}

.bm-btn-secondary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Step 3: calendar ---------- */
.bm-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 14px;
}

.bm-calendar-month {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  text-transform: capitalize;
}

.bm-calendar-arrow {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition:
    background .15s var(--ease),
    border-color .15s var(--ease),
    color .15s var(--ease);
}

.bm-calendar-arrow:hover:not(:disabled) {
  background: var(--blue-tint-2);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  color: var(--ink);
}

.bm-calendar-arrow:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 136, 253, .14);
}

.bm-calendar-arrow:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.bm-calendar-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bm-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.bm-calendar-dayhead {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 0 10px;
}

.bm-calendar-cell {
  appearance: none;
  background: none;
  border: none;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  color: var(--ink);
  letter-spacing: -.005em;
  user-select: none;
  transition:
    background .15s var(--ease),
    color .15s var(--ease);
}

.bm-calendar-cell:hover:not(.is-disabled):not(.is-empty) {
  background: var(--blue-tint);
  color: var(--blue-ink);
}

.bm-calendar-cell:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue);
  border-radius: 50%;
}

.bm-calendar-cell.is-disabled {
  color: var(--mute);
  opacity: .35;
  cursor: not-allowed;
}

.bm-calendar-cell.is-empty {
  cursor: default;
}

.bm-calendar-cell.is-selected {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.bm-calendar-cell.is-today:not(.is-selected)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}

/* ---------- Step 4: time slots ---------- */
.bm-date-line {
  font-size: 15px;
  color: var(--ink-2);
  margin-top: 10px;
  letter-spacing: -.005em;
  text-transform: capitalize;
}

.bm-slots {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bm-slots-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bm-slots-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.bm-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bm-slot {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  height: 46px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  transition:
    border-color .15s var(--ease),
    background .15s var(--ease),
    color .15s var(--ease);
}

.bm-slot:hover {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--line));
  background: var(--blue-tint-2);
}

.bm-slot:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 136, 253, .14);
}

.bm-slot.is-selected {
  border-color: var(--blue);
  background: var(--blue-tint);
  color: var(--blue-ink);
  font-weight: 600;
}

/* ---------- Step 5: confirmation ---------- */
.bm-confirm {
  text-align: center;
  padding: 8px 0 0;
}

.bm-confirm-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--blue-tint);
  display: grid;
  place-items: center;
  animation: bm-pop .42s cubic-bezier(.22, 1, .36, 1) both;
}

.bm-confirm-check svg {
  width: 26px;
  height: 26px;
  stroke: var(--blue);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes bm-pop {
  0%   { opacity: 0; transform: scale(.6); }
  60%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.bm-confirm .bm-title {
  font-size: clamp(28px, 3.6vw, 34px);
}

.bm-confirm-date {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 22px;
  letter-spacing: -.01em;
  text-transform: capitalize;
}

.bm-confirm-time {
  font-size: clamp(38px, 5vw, 48px);
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -.04em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.bm-confirm-rule {
  width: 32px;
  height: 1px;
  background: var(--line);
  margin: 26px auto;
}

.bm-confirm-email {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  letter-spacing: -.005em;
  max-width: 32ch;
  margin: 0 auto;
}

.bm-confirm-email b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .bm-backdrop {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .bm-dialog {
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    transform: translateY(24px);
  }

  .bm-backdrop.is-open .bm-dialog {
    transform: translateY(0);
  }

  .bm-body {
    padding: 32px 22px 28px;
  }

  .bm-close {
    top: 14px;
    right: 14px;
  }

  .bm-title {
    font-size: 24px;
  }

  .bm-calendar-cell {
    font-size: 13px;
  }

  .bm-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bm-backdrop,
  .bm-dialog,
  .bm-step.is-active,
  .bm-confirm-check,
  .bm-error.is-visible {
    animation: none !important;
    transition: opacity .15s linear !important;
  }
  .bm-progress-fill { transition: width .2s linear; }
}
