/* Booking window (js/booking.js), shared by the homepage and the service pages:
   the AI booking assistant tab and the Microsoft Bookings calendar tab. */
.booking-dialog {
  --bk-ink: #1A1A2E;
  --bk-muted: #626274;
  --bk-line: rgba(26, 26, 46, 0.1);
  --bk-accent: #FF6B2B;
  --bk-accent-soft: #FF8A5B;
  --bk-warm: #FFF0EA;
  --bk-brand: #6C3CE1;
  /* The site's reset zeroes margins, which would pin the dialog to the top-left. */
  position: fixed; inset: 0; margin: auto;
  width: min(1120px, calc(100vw - 32px));
  height: min(860px, calc(100dvh - 32px));
  max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 18px;
  background: #fff; color: var(--bk-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 30px 80px rgba(10, 10, 25, 0.35);
  overflow: hidden;
}
.booking-dialog[open] { display: flex; flex-direction: column; animation: booking-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.booking-dialog::backdrop { background: rgba(14, 14, 30, 0.55); backdrop-filter: blur(4px); animation: booking-fade 0.22s ease; }
html.booking-open { overflow: hidden; }

.booking-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 16px 16px 24px;
  border-bottom: 1px solid var(--bk-line);
}
.booking-head h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
.booking-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--bk-muted); }
.booking-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.booking-newtab { font-size: 13px; font-weight: 500; color: var(--bk-ink); text-underline-offset: 4px; padding: 8px 10px; }
.booking-newtab[hidden] { display: none; }
.booking-close {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(26, 26, 46, 0.06); color: var(--bk-ink);
  transition: background 0.2s ease;
}
.booking-close:hover { background: rgba(26, 26, 46, 0.12); }
.booking-dialog svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.booking-dialog :focus-visible { outline: 3px solid var(--bk-accent); outline-offset: 2px; }

/* Tabs */
.booking-tabs { display: flex; gap: 4px; padding: 10px 24px 0; border-bottom: 1px solid var(--bk-line); }
.booking-tabs[hidden] { display: none; }
.booking-tabs [role="tab"] {
  position: relative; border: 0; background: none; cursor: pointer;
  padding: 10px 14px 12px; font: inherit; font-size: 14px; font-weight: 500; color: var(--bk-muted);
  transition: color 0.2s ease;
}
.booking-tabs [role="tab"]:hover { color: var(--bk-ink); }
.booking-tabs [role="tab"][aria-selected="true"] { color: var(--bk-ink); }
.booking-tabs [role="tab"]::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--bk-accent); transform: scaleX(0); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.booking-tabs [role="tab"][aria-selected="true"]::after { transform: scaleX(1); }

.booking-body { position: relative; flex: 1; min-height: 0; background: #f6f5f4; }
.booking-cal { position: absolute; inset: 0; }
.booking-cal[hidden], .ba[hidden] { display: none; }
.booking-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity 0.3s ease; }
.booking-dialog.is-loaded iframe { opacity: 1; }
.booking-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--bk-muted); }
.booking-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.booking-fallback p { margin: 0; max-width: 380px; font-size: 15px; line-height: 1.5; color: var(--bk-muted); }
.booking-fallback .btn-cal { padding: 12px 20px; border-radius: 999px; background: var(--bk-ink); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.booking-fallback .btn-cal:hover { background: #2c2c48; }

/* --- Assistant ------------------------------------------------------------------- */
.ba {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bk-warm) 0%, #fff 220px);
}

.ba-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ba-presence { display: flex; align-items: center; gap: 14px; padding: 22px 24px 14px; }
.ba-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ba-name { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1.05; letter-spacing: -0.01em; }
.ba-hint { font-size: 13px; color: var(--bk-muted); margin-top: 3px; min-height: 1.2em; }
.ba-voice {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--bk-line); background: #fff; color: var(--bk-ink);
  display: grid; place-items: center; cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.ba-voice:hover { background: #fafafa; }
.ba-voice[aria-pressed="false"] { color: var(--bk-muted); }

/* The orb: idle breathes, listening pulses a ring, thinking shimmers, speaking moves with the voice. */
.ba-orb {
  position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFE1D3 0%, var(--bk-accent-soft) 32%, var(--bk-accent) 62%, #C2459B 88%, var(--bk-brand) 110%);
  box-shadow: 0 12px 28px -10px rgba(255, 107, 43, 0.6), inset 0 -6px 14px rgba(108, 60, 225, 0.25);
  animation: ba-breathe 4.5s ease-in-out infinite;
}
.ba-orb::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid rgba(255, 107, 43, 0.45); opacity: 0; transform: scale(0.9);
}
.ba-orb span {
  position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(255, 255, 255, 0.55) 70%, transparent 85%);
}
.ba[data-mood="listening"] .ba-orb::before { animation: ba-ring 1.4s ease-out infinite; }
.ba[data-mood="thinking"] .ba-orb span { opacity: 1; animation: ba-spin 1.2s linear infinite; }
.ba[data-mood="speaking"] .ba-orb { animation: ba-talk 0.9s ease-in-out infinite; }

.ba-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 12px; overscroll-behavior: contain; }
.ba-log { display: flex; flex-direction: column; gap: 10px; }
.ba-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 86%; animation: ba-msg-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ba-msg--user { align-self: flex-end; align-items: flex-end; }
.ba-bubble {
  margin: 0; padding: 11px 15px; border-radius: 18px 18px 18px 6px;
  background: #fff; border: 1px solid var(--bk-line); font-size: 15px; line-height: 1.5; white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ba-msg--user .ba-bubble { background: var(--bk-ink); border-color: var(--bk-ink); color: #fff; border-radius: 18px 18px 6px 18px; }
.ba-msg--error .ba-bubble { background: #FFF6F2; border-color: rgba(255, 107, 43, 0.3); }
.ba-typing .ba-bubble { display: flex; gap: 4px; padding: 15px 16px; }
.ba-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--bk-muted); opacity: 0.4; animation: ba-dot 1.1s ease-in-out infinite; }
.ba-typing i:nth-child(2) { animation-delay: 0.15s; }
.ba-typing i:nth-child(3) { animation-delay: 0.3s; }

.ba-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ba-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 9px 14px; border-radius: 12px; cursor: pointer; font: inherit; text-align: left;
  background: #fff; color: var(--bk-ink); border: 1px solid rgba(255, 107, 43, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.ba-choice:hover:not(:disabled) { background: var(--bk-warm); border-color: var(--bk-accent); }
.ba-choice:active:not(:disabled) { transform: scale(0.97); }
.ba-choice.is-picked { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }
.ba-choice:disabled:not(.is-picked) { opacity: 0.45; cursor: default; }
.ba-choice-time { font-size: 14px; font-weight: 600; }
.ba-choice-local { font-size: 12px; opacity: 0.75; }
.ba-link {
  margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 14px;
  color: var(--bk-ink); text-decoration: underline; text-underline-offset: 4px;
}

.ba-booked {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 4px; padding: 16px 18px; border-radius: 16px;
  background: #fff; border: 1px solid rgba(255, 107, 43, 0.35); box-shadow: 0 12px 30px -18px rgba(255, 107, 43, 0.6);
  animation: ba-msg-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ba-booked-icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bk-accent); color: #fff; }
.ba-booked div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--bk-muted); }
.ba-booked strong { font-size: 16px; color: var(--bk-ink); }
.ba-booked a { color: var(--bk-ink); text-underline-offset: 4px; margin-top: 4px; }

.ba-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 24px 6px; }
.ba-input {
  flex: 1; min-height: 46px; max-height: 140px; resize: none; padding: 12px 16px; border-radius: 23px;
  border: 1px solid rgba(26, 26, 46, 0.16); background: #fff; color: var(--bk-ink);
  font: inherit; font-size: 16px; line-height: 1.35; /* 16px stops iOS zooming the page */
  transition: border-color 0.2s ease;
}
.ba-input:focus { outline: none; border-color: var(--bk-ink); }
.ba-mic, .ba-send {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; transition: background 0.2s ease, transform 0.15s ease;
}
.ba-mic[hidden] { display: none; }
.ba-mic { background: var(--bk-warm); color: var(--bk-accent); }
.ba-mic:hover { background: #FFE3D6; }
.ba-mic.is-on { background: var(--bk-accent); color: #fff; animation: ba-mic 1.4s ease-out infinite; }
.ba-send { background: var(--bk-ink); color: #fff; }
.ba-send:hover { background: #2c2c48; }
.ba-mic:active, .ba-send:active { transform: scale(0.94); }
.ba-mic svg, .ba-send svg { width: 20px; height: 20px; }
.ba-foot { margin: 0 auto; padding: 4px 24px 14px; font-size: 11.5px; line-height: 1.45; color: #8a8a99; text-align: center; }

/* Quick questions shown before the assistant opens. */
.ba-intake { display: none; }
.ba.is-intake .ba-intake { display: block; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px 24px; }
.ba.is-intake .ba-scroll, .ba.is-intake .ba-composer, .ba.is-intake .ba-foot { display: none; }
.ba-q { max-width: 520px; animation: ba-msg-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ba-q-step { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bk-accent); }
.ba-q-title { margin: 0 0 18px; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.ba-q-title:focus { outline: none; }
.ba-q-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--bk-muted); }
.ba-q-text a { color: var(--bk-ink); text-underline-offset: 3px; }
.ba-q-options { display: flex; flex-direction: column; gap: 8px; }
.ba-q-opt {
  display: block; width: 100%; padding: 13px 16px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 500; text-align: left;
  background: #fff; color: var(--bk-ink); border: 1px solid var(--bk-line);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.ba-q-opt:hover { background: var(--bk-warm); border-color: var(--bk-accent); }
.ba-q-opt:active { transform: scale(0.985); }
.ba-q-opt.is-picked { border-color: var(--bk-accent); box-shadow: inset 0 0 0 1px var(--bk-accent); }
.ba-q-form { display: flex; gap: 8px; }
.ba-q-input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 24px;
  border: 1px solid rgba(26, 26, 46, 0.16); background: #fff; color: var(--bk-ink);
  font: inherit; font-size: 16px; transition: border-color 0.2s ease;
}
.ba-q-input:focus { outline: none; border-color: var(--bk-ink); }
.ba-q-next {
  flex-shrink: 0; height: 48px; padding: 0 22px; border: 0; border-radius: 24px; cursor: pointer;
  background: var(--bk-ink); color: #fff; font: inherit; font-size: 15px; font-weight: 600; transition: background 0.2s ease;
}
.ba-q-next:hover:not(:disabled) { background: #2c2c48; }
.ba-q-next:disabled { opacity: 0.6; cursor: default; }
.ba-q-note { margin: 10px 0 0; font-size: 13px; color: var(--bk-muted); }
.ba-q-error { margin: 8px 0 0; font-size: 14px; color: #B3261E; min-height: 0; }
.ba-q-error:empty { display: none; }
.ba-q-nav { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 22px; }
.ba-q-nav .ba-link { margin-top: 0; color: var(--bk-muted); }
.ba-q-nav .ba-link:hover { color: var(--bk-ink); }

/* Video avatar: a stage beside the chat on wide screens, above it on narrow ones. */
.ba-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ba-main > * { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
.ba > .ba-main { max-width: none; }
.ba-stage { display: none; position: relative; overflow: hidden; background: #12121f; }
.ba.has-avatar { flex-direction: row; }
.ba.has-avatar > .ba-stage { display: block; flex: 0 0 44%; max-width: none; margin: 0; }
.ba.has-avatar .ba-orb { display: none; }
.ba-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s ease; }
.ba-stage[data-state="live"] .ba-video { opacity: 1; }
.ba-stage-loading {
  position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.7); font-size: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 107, 43, 0.25), transparent 60%);
}
.ba-stage[data-state="live"] .ba-stage-loading { display: none; }
.ba-stage-ai {
  position: absolute; left: 14px; top: 14px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; color: #fff; background: rgba(18, 18, 31, 0.55); backdrop-filter: blur(6px);
}
.ba[data-mood="speaking"] .ba-stage { box-shadow: inset 0 0 0 3px rgba(255, 107, 43, 0.65); }
.ba[data-mood="listening"] .ba-stage { box-shadow: inset 0 0 0 3px rgba(108, 60, 225, 0.6); }
@media (max-width: 900px) {
  .ba.has-avatar { flex-direction: column; }
  .ba.has-avatar > .ba-stage { flex: 0 0 auto; height: 34vh; min-height: 200px; }
  .ba-video { object-position: 50% 25%; }
}

@media (max-width: 640px) {
  .booking-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .booking-head { padding: 12px 12px 12px 16px; }
  .booking-head p, .booking-newtab { display: none; }
  .booking-tabs { padding: 4px 8px 0; }
  .ba-presence { padding: 14px 16px 10px; }
  .ba-orb { width: 46px; height: 46px; }
  .ba-name { font-size: 24px; }
  .ba-scroll { padding: 4px 16px 10px; }
  .ba.is-intake .ba-intake { padding: 4px 16px 20px; }
  .ba-q-title { font-size: 20px; }
  .ba-q-form { flex-direction: column; }
  .ba-composer { padding: 8px 12px 4px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .ba-foot { padding: 2px 16px 10px; }
  .ba-msg { max-width: 92%; }
}

@keyframes booking-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
@keyframes booking-fade { from { opacity: 0; } }
@keyframes ba-msg-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes ba-breathe { 50% { transform: scale(1.04); } }
@keyframes ba-talk { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.08); } 60% { transform: scale(0.98); } }
@keyframes ba-ring { from { opacity: 0.9; transform: scale(0.92); } to { opacity: 0; transform: scale(1.3); } }
@keyframes ba-spin { to { transform: rotate(360deg); } }
@keyframes ba-dot { 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes ba-mic { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 43, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(255, 107, 43, 0); } }
@media (prefers-reduced-motion: reduce) {
  .booking-dialog[open], .booking-dialog::backdrop, .ba-msg, .ba-booked, .ba-q, .ba-orb, .ba-orb::before, .ba-orb span, .ba-typing i, .ba-mic.is-on { animation: none; }
  .booking-body iframe, .booking-tabs [role="tab"]::after { transition: none; }
}
