/* ─────────────────────────────────────────────────────────────
   BrightSmile — custom styles beyond Tailwind utilities.
   Brand tokens, Ava panel glow, mic pulse, waveform, transcript
   bubble fade-in, calendar slot highlight, front-desk wave,
   route crossfade.
   ───────────────────────────────────────────────────────────── */

:root {
  --brand:        #1E40AF;
  --brand-light:  #3B82F6;
  --brand-glow:   #60A5FA;
  --ink:          #0F172A;
  --ink-muted:    #475569;
  --paper:        #FFFFFF;
  --paper-warm:   #F8FAFC;
  --success:      #10B981;
  --danger:       #EF4444;
  --ring-soft:    rgba(96, 165, 250, 0.35);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body { height: 100%; }
body { background: var(--paper); color: var(--ink); }

/* ───────── Buttons & nav ───────── */
.cta-primary {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .65rem 1.1rem; border-radius: .75rem;
  background: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 8px 22px -10px rgba(30,64,175,.55);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cta-primary:hover { background: #1d3aa3; transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(30,64,175,.65); }

.cta-ghost {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .65rem 1.1rem; border-radius: .75rem;
  background: #fff; color: var(--ink); border: 1px solid #E2E8F0; font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.cta-ghost:hover { border-color: var(--brand-light); background: var(--paper-warm); }

.nav-link { position: relative; transition: color .15s ease; padding: .25rem 0; }
.nav-link:hover, .nav-link.is-active { color: var(--brand); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px;
  background: var(--brand); border-radius: 2px;
}

/* ───────── Route outlet crossfade ───────── */
.route-outlet { min-height: calc(100vh - 5rem); }
.route-view {
  animation: routeIn .28s cubic-bezier(.21,.74,.34,1) both;
  will-change: opacity, transform;
}
@keyframes routeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ───────── Hero gradient text ───────── */
.hero-grad {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-light) 55%, var(--brand-glow) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ───────── Cards ───────── */
.card {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 1.25rem;
  box-shadow: 0 10px 30px -12px rgba(15,23,42,.08), 0 2px 6px -2px rgba(15,23,42,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -16px rgba(15,23,42,.18); border-color: #CBD5E1; }

/* ───────── Booking widget ───────── */
.bw-step-row { display: flex; gap: .75rem; align-items: center; }
.bw-step {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .85rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--ink-muted);
  background: #F1F5F9; border: 1px solid transparent;
}
.bw-step[data-active="true"] { color: var(--brand); background: #DBEAFE; border-color: #BFDBFE; }
.bw-step .bw-step-num {
  width: 1.25rem; height: 1.25rem; border-radius: 999px; background: #fff;
  display: grid; place-items: center; font-size: .7rem; color: var(--ink);
}
.bw-step[data-active="true"] .bw-step-num { background: var(--brand); color: #fff; }

.bw-service-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem; border-radius: 999px;
  background: #EFF6FF; color: var(--brand); font-weight: 600; font-size: .85rem;
  border: 1px solid #BFDBFE;
}

/* Calendar grid */
.bw-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.bw-cal-head { font-size: .7rem; text-align: center; color: var(--ink-muted); padding: .35rem 0; font-weight: 600; }
.bw-cal-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: .65rem; border: 1px solid transparent;
  display: grid; place-items: center; font-size: .82rem; color: var(--ink); cursor: pointer;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.bw-cal-cell[data-state="muted"] { color: #CBD5E1; cursor: default; }
.bw-cal-cell[data-state="available"]::after {
  content: ""; position: absolute; bottom: .35rem; width: 4px; height: 4px; border-radius: 999px; background: var(--brand-light);
}
.bw-cal-cell[data-state="available"]:hover { background: #EFF6FF; border-color: #BFDBFE; }
.bw-cal-cell[data-state="focused"] {
  background: #DBEAFE; border-color: var(--brand-light); color: var(--brand);
  animation: pulseFocus 1.6s ease-out 1;
}
.bw-cal-cell[data-state="selected"] {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 8px 18px -6px rgba(30,64,175,.5);
  animation: pulseSelect 1.4s ease-out infinite;
}
@keyframes pulseFocus {
  0%   { box-shadow: 0 0 0 0 var(--ring-soft); }
  100% { box-shadow: 0 0 0 14px rgba(96,165,250,0); }
}
@keyframes pulseSelect {
  0%, 100% { box-shadow: 0 8px 18px -6px rgba(30,64,175,.5), 0 0 0 0 rgba(30,64,175,.45); }
  50%      { box-shadow: 0 8px 18px -6px rgba(30,64,175,.5), 0 0 0 8px rgba(30,64,175,0); }
}

/* Times list */
.bw-time {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: .65rem .9rem; border-radius: .65rem;
  background: #fff; border: 1px solid #E2E8F0; font-weight: 600; color: var(--ink);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.bw-time:hover { border-color: var(--brand-light); background: var(--paper-warm); }
.bw-time[data-selected="true"] {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 6px 14px -6px rgba(30,64,175,.45);
}
.bw-time[data-selected="true"] .bw-time-check { opacity: 1; transform: scale(1); }
.bw-time-check { opacity: 0; transform: scale(.8); transition: .15s ease; }

/* Summary bar */
.bw-summary {
  display: none; align-items: center; gap: .85rem;
  padding: .85rem 1.1rem; border-radius: .85rem;
  background: linear-gradient(90deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 1px solid #6EE7B7; color: #064E3B; font-weight: 600;
  animation: routeIn .28s ease both;
}
.bw-summary[data-visible="true"] { display: flex; }
.bw-summary .bw-summary-dot { width: .55rem; height: .55rem; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,.18); }

/* Demo banner */
.demo-banner {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A;
  padding: .35rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}

/* ───────── Ava panel ───────── */
.ava-panel {
  position: fixed; right: 1.25rem; top: 6rem; width: 380px; max-height: calc(100vh - 7.5rem);
  z-index: 50;
}
@media (max-width: 1024px) { .ava-panel { width: 340px; } }
/* On phones we keep the panel reachable. Collapsed by default — only the
 * mic + status pill peek out. Tap to expand to full panel. */
@media (max-width: 860px) {
  .ava-panel {
    right: .75rem; left: .75rem; top: auto; bottom: .75rem;
    width: auto; max-height: 70vh;
  }
  /* Collapsed-on-mobile: hide transcript + chips by default; show only the
   * compact header + mic. Tap the header to flip data-mobile-open. */
  .ava-panel:not([data-mobile-open="true"]) .ava-transcript,
  .ava-panel:not([data-mobile-open="true"]) .ava-chips,
  .ava-panel:not([data-mobile-open="true"]) .ava-footer { display: none; }
  .ava-panel:not([data-mobile-open="true"]) .ava-panel-inner { padding-bottom: .5rem; }
  .ava-panel[data-mobile-open="true"] .ava-transcript { max-height: 40vh; }
}

.ava-panel-inner {
  position: relative; height: 100%;
  border-radius: 1.4rem; overflow: hidden;
  background: linear-gradient(165deg, #0B1437 0%, #14275C 55%, #1E40AF 100%);
  color: #E2E8F0;
  box-shadow: 0 0 60px -10px rgba(96,165,250,.45), 0 25px 50px -12px rgba(15,23,42,.65);
  display: flex; flex-direction: column;
}
.ava-panel-inner::before {
  content: ""; position: absolute; inset: -1px; border-radius: 1.4rem;
  background: linear-gradient(135deg, rgba(96,165,250,.5), rgba(96,165,250,0) 60%);
  pointer-events: none; mask: linear-gradient(#000, transparent 60%);
}

.ava-header { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.15rem .9rem; position: relative; }
.ava-avatar {
  width: 44px; height: 44px; border-radius: 999px; overflow: hidden;
  border: 2px solid rgba(96,165,250,.55); box-shadow: 0 0 0 4px rgba(96,165,250,.15);
}
.ava-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ava-identity { flex: 1; min-width: 0; }
.ava-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.1rem; color: #fff; line-height: 1.1; }
.ava-subtitle { font-size: .72rem; color: rgba(226,232,240,.7); }
.ava-status-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(15,23,42,.55); padding: .3rem .65rem; border-radius: 999px;
  font-size: .68rem; font-weight: 600; color: #DBEAFE;
  border: 1px solid rgba(96,165,250,.25);
}
.ava-status-dot {
  width: .5rem; height: .5rem; border-radius: 999px; background: #94A3B8;
  transition: background .2s ease;
}
.ava-status-dot[data-state="connecting"] { background: #FBBF24; animation: dotPulse 1.2s ease-in-out infinite; }
.ava-status-dot[data-state="listening"]  { background: var(--success); animation: dotPulse 1.4s ease-in-out infinite; }
.ava-status-dot[data-state="thinking"]   { background: #A78BFA; animation: dotPulse .8s ease-in-out infinite; }
.ava-status-dot[data-state="speaking"]   { background: var(--brand-glow); animation: dotPulse .6s ease-in-out infinite; }
.ava-status-dot[data-state="ended"]      { background: #EF4444; }
@keyframes dotPulse { 0%,100%{ box-shadow:0 0 0 0 currentColor; } 50%{ box-shadow:0 0 0 6px rgba(255,255,255,0); } }

.ava-transcript {
  flex: 1; min-height: 220px; max-height: 320px; overflow-y: auto;
  padding: .35rem 1.15rem .85rem; display: flex; flex-direction: column; gap: .55rem;
  scrollbar-width: thin; scrollbar-color: rgba(96,165,250,.35) transparent;
}
.ava-transcript::-webkit-scrollbar { width: 6px; }
.ava-transcript::-webkit-scrollbar-thumb { background: rgba(96,165,250,.35); border-radius: 999px; }

.ava-bubble {
  max-width: 88%; padding: .55rem .8rem; border-radius: .9rem; font-size: .85rem; line-height: 1.35;
  animation: bubbleIn .25s ease both;
  word-wrap: break-word;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ava-bubble--assistant {
  align-self: flex-start; background: rgba(255,255,255,.08); color: #F1F5F9;
  border: 1px solid rgba(255,255,255,.08); border-bottom-left-radius: .25rem;
}
.ava-bubble--user {
  align-self: flex-end; background: var(--brand); color: #fff;
  border-bottom-right-radius: .25rem;
  box-shadow: 0 8px 18px -10px rgba(30,64,175,.7);
}
.ava-bubble--partial { opacity: .65; font-style: italic; }
.ava-tool-chip {
  align-self: flex-start; font-size: .72rem; color: #BFDBFE;
  background: rgba(96,165,250,.12); border: 1px dashed rgba(96,165,250,.35);
  padding: .25rem .55rem; border-radius: .55rem;
  animation: bubbleIn .25s ease both;
}

.ava-waveform {
  width: 100%; height: 48px; padding: 0 1rem; display: block;
}

.ava-quick-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: .45rem;
  padding: .2rem 1rem .9rem;
}
.ava-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem .6rem; border-radius: .65rem;
  font-size: .76rem; font-weight: 600; color: #DBEAFE;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.ava-chip:hover { background: rgba(96,165,250,.18); border-color: rgba(96,165,250,.55); }
.ava-chip:active { transform: scale(.97); }

.ava-mic-row {
  display: flex; align-items: center; gap: .85rem;
  padding: .35rem 1rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: .9rem;
}
.ava-mic-btn {
  position: relative; width: 62px; height: 62px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(30,64,175,.85), 0 0 0 0 rgba(96,165,250,.55);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  flex-shrink: 0;
}
.ava-mic-btn:hover { transform: scale(1.04); }
.ava-mic-btn[data-state="listening"] {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}
.ava-mic-btn[data-state="speaking"] {
  background: linear-gradient(135deg, var(--brand-glow) 0%, var(--brand-light) 100%);
}
.ava-mic-btn[data-state="off"] .ava-mic-ring { display: none; }
.ava-mic-ring {
  position: absolute; inset: -6px; border-radius: 999px;
  border: 2px solid var(--brand-glow); opacity: 0;
  animation: micRing 1.8s ease-out infinite;
}
.ava-mic-ring--2 { animation-delay: .9s; }
@keyframes micRing {
  0%   { transform: scale(.85); opacity: .7; }
  100% { transform: scale(1.6);  opacity: 0; }
}

.ava-mic-caption .ava-mic-title { font-weight: 600; color: #F8FAFC; font-size: .9rem; }
.ava-mic-caption .ava-mic-sub   { font-size: .7rem; color: rgba(226,232,240,.6); }

/* ───────── Front-desk toast ───────── */
.front-desk-toast {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
  display: inline-flex; align-items: center; gap: .85rem;
  padding: .85rem 1.1rem .85rem 1rem; border-radius: 1rem;
  background: linear-gradient(135deg, #0B1437 0%, #1E40AF 100%);
  color: #fff; overflow: hidden;
  box-shadow: 0 18px 40px -12px rgba(15,23,42,.55);
  animation: routeIn .3s ease both;
}
.front-desk-toast[hidden] { display: none !important; }
.fd-dot { width: .55rem; height: .55rem; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,.25); animation: dotPulse 1.4s ease-in-out infinite; }
.fd-phone { color: var(--brand-glow); }
.fd-title { font-weight: 700; font-size: .9rem; }
.fd-meta  { font-size: .75rem; color: rgba(219,234,254,.85); }
.fd-end {
  background: var(--danger); color: #fff; font-weight: 600;
  padding: .45rem .8rem; border-radius: .65rem; font-size: .78rem;
}
.fd-wave {
  position: absolute; left: -30%; bottom: 0; width: 160%; height: 6px;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,.55), transparent);
  animation: fdWave 2.4s linear infinite;
}
@keyframes fdWave { from { transform: translateX(-30%); } to { transform: translateX(30%); } }

/* ───────── Highlight pulse (agent → highlight tool) ───────── */
.bs-highlight {
  position: relative; animation: bsGlow 1.2s ease-in-out infinite;
  border-radius: 1rem;
}
@keyframes bsGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96,165,250,.65); }
  50%      { box-shadow: 0 0 0 12px rgba(96,165,250,0); }
}

/* ───────── Misc helpers ───────── */
.section-pad { padding: 4rem 1.5rem; }
@media (min-width: 768px) { .section-pad { padding: 5.5rem 2.5rem; } }

.star-row { display: inline-flex; align-items: center; gap: .25rem; color: #F59E0B; }
.star-row svg { width: 16px; height: 16px; fill: currentColor; }

.feature-icon {
  width: 48px; height: 48px; border-radius: 1rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  color: var(--brand); display: grid; place-items: center;
}

/* Service cards */
.service-card .price { color: var(--brand); font-weight: 700; }
.service-card .duration { color: var(--ink-muted); font-size: .8rem; }

/* Team cards */
.team-card-photo { aspect-ratio: 4 / 5; border-radius: 1.25rem; overflow: hidden; background: #E2E8F0; }
.team-card-photo img { width: 100%; height: 100%; object-fit: cover; }
