/* Self-serve booking picker (js/booking.js) and the exit-intent popup
   (js/exit-intent.js). Loaded on /book-a-call and lazily by the popup on any
   page, including /xi-code, so tokens are scoped here rather than read from
   the host page's :root. Light system only. */

.aeb, .aex {
  --b-paper: #F8F8F5;
  --b-card: #FFFFFF;
  --b-ink: #24251F;
  --b-mute: #72736B;
  --b-hairline: #E6E6DF;
  --b-slate: #3D5876;
  --b-cream: #EFEEE2;
  font-family: 'Switzer', system-ui, sans-serif;
  color: var(--b-ink);
}

.aeb { background: var(--b-card); border: 1px solid var(--b-hairline); border-radius: 14px; padding: 28px 26px; }
.aeb button, .aeb input, .aeb textarea { font: inherit; }
.aeb a { color: var(--b-slate); font-weight: 550; }
.aeb :focus-visible { outline: 2px solid var(--b-slate); outline-offset: 3px; }

.aeb-status { font-size: 14.5px; color: var(--b-mute); line-height: 1.6; }
.aeb-status[hidden] { display: none; }
.aeb-status:not([hidden]) ~ .aeb-pick, .aeb-status:not([hidden]) ~ .aeb-form { margin-top: 14px; }

.aeb-h { font-size: 13.5px; font-weight: 550; margin: 0 0 10px; }
.aeb-days + .aeb-h { margin-top: 22px; margin-bottom: 2px; }
.aeb-tz { font-size: 13px; color: var(--b-mute); margin: 0 0 10px; }

.aeb-days { display: flex; flex-wrap: wrap; gap: 8px; }
.aeb-day, .aeb-time {
  min-height: 44px; padding: 10px 14px;
  background: var(--b-paper); color: var(--b-ink);
  border: 1px solid var(--b-hairline); border-radius: 9px;
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.aeb-day:hover, .aeb-time:hover { border-color: var(--b-slate); }
.aeb-day[aria-pressed="true"] { background: var(--b-ink); border-color: var(--b-ink); color: var(--b-paper); }
.aeb-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }

.aeb-chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--b-cream); border-radius: 9px; padding: 12px 14px; margin-bottom: 18px; }
.aeb-chosen-t { font-size: 14.5px; font-weight: 550; margin: 0; }
.aeb-link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--b-slate); font-size: 14px; font-weight: 550; cursor: pointer; text-decoration: underline; }

.aeb-fields { display: grid; gap: 14px; }
.aeb-field label { display: block; font-size: 13.5px; font-weight: 550; margin-bottom: 6px; }
.aeb-field input, .aeb-field textarea {
  width: 100%; font-size: 15px; padding: 12px 14px;
  border: 1px solid var(--b-hairline); border-radius: 9px;
  background: var(--b-paper); color: var(--b-ink);
}
.aeb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.aeb-submit {
  margin-top: 18px; min-height: 44px; padding: 13px 26px;
  background: var(--b-ink); color: var(--b-paper);
  border: none; border-radius: 9px; font-size: 15px; font-weight: 550; cursor: pointer;
}
.aeb-submit:hover { background: #000; }
.aeb-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.aeb-note { font-size: 13.5px; color: var(--b-mute); margin: 14px 0 0; line-height: 1.55; }

.aeb-done, .aeb-done:focus, .aeb-done:focus-visible { outline: none; }
.aeb-done h3 { font-size: 20px; font-weight: 550; letter-spacing: -0.018em; margin: 0 0 8px; }
.aeb-done p { font-size: 14.5px; color: var(--b-mute); line-height: 1.6; margin: 0 0 8px; }
.aeb-done .aeb-when { color: var(--b-ink); font-weight: 550; font-size: 16px; }
.aeb-done b { color: var(--b-ink); font-weight: 550; }

/* ============ EXIT-INTENT POPUP ============ */
.aex {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: 16px; background: var(--b-paper);
  box-shadow: 0 30px 80px rgba(16, 16, 14, 0.28); overflow: auto;
}
.aex::backdrop { background: rgba(16, 16, 14, 0.5); }
.aex-in { padding: 30px 28px 28px; }
.aex-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.aex h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 500; letter-spacing: -0.022em; line-height: 1.15; margin: 0 0 8px; text-wrap: balance; }
.aex-sub { font-size: 15px; color: var(--b-mute); line-height: 1.6; margin: 0 0 20px; }
.aex-close {
  flex: none; min-height: 44px; padding: 10px 14px; margin: -10px -12px 0 0;
  background: none; border: 0; border-radius: 9px; color: var(--b-mute);
  font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
}
.aex-close:hover { color: var(--b-ink); }
.aex :focus-visible { outline: 2px solid var(--b-slate); outline-offset: 3px; }
.aex .aeb { padding: 22px 20px; }

.aex[open] { animation: aex-rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes aex-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .aeb { padding: 22px 18px; }
  .aex-in { padding: 24px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .aex[open] { animation: none; }
  .aeb-day, .aeb-time { transition: none; }
}
