/*
  Book a call: the calendar that used to play a booking by itself is now the
  real one. Same card, same ruby pick; a day, then a time, then a short form.
  Booking happens once in a while, so the picks move a little; the times for a
  day arrive in a quick stagger, and the confirmation draws its check once.
*/

.book-facts { display: grid; gap: 12px; margin-top: 32px; }
.book-facts li { display: flex; gap: 12px; align-items: center; color: var(--ink-2); font-size: 15.5px; }
.book-facts svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ruby); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.book-intro .form-note { margin-top: 28px; }

.booker { padding: 20px; background: var(--panel); box-shadow: var(--lift-2); min-height: 452px; display: grid; grid-template-rows: auto 1fr; }
.booker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.booker-title { font-size: 16px; font-weight: 500; }
.booker-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mute); }
.booker-tz select { max-width: 190px; padding: 4px 24px 4px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.booker-tz select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.booker-body { padding-top: 16px; min-width: 0; }

.booker-pick { display: grid; grid-template-columns: minmax(0, 1fr) 156px; gap: 20px; }
.booker-month { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.booker-month p { font-size: 14.5px; font-weight: 500; }
.booker-nav { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; transition: border-color 0.15s var(--ease-ui), color 0.15s var(--ease-ui); }
.booker-nav svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.booker-nav:disabled { opacity: 0.35; cursor: default; }
.booker-week, .booker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.booker-week { margin-top: 12px; font-size: 11.5px; color: var(--faint); text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.booker-days { margin-top: 6px; }
.booker-date { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--btn-r); border: 1px solid transparent; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 0.15s var(--ease-ui), color 0.15s var(--ease-ui), border-color 0.15s var(--ease-ui); }
.booker-date:not(:disabled) { background: var(--accent-bg); color: var(--accent-ink); font-weight: 500; }
.booker-date:disabled { color: var(--faint); cursor: default; }
.booker-date.is-today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.booker-date[aria-pressed="true"] { background: var(--primary); color: #ffffff; }
.booker-date:focus-visible, .booker-slot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.booker-times { display: grid; align-content: start; gap: 10px; min-width: 0; }
.booker-day { font-size: 13.5px; font-weight: 500; color: var(--ink); min-height: 2.6em; }
.booker-slots { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px 2px 28px; margin: -2px; overscroll-behavior: contain; mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); }
.booker-slot { padding: 9px 0; border-radius: var(--btn-r); border: 1px solid var(--ghost-border); background: transparent; text-align: center; font: inherit; font-size: 14px; font-weight: 500; color: var(--accent-ink); font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 0.15s var(--ease-ui), color 0.15s var(--ease-ui), border-color 0.15s var(--ease-ui); }
.booker-slot:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .booker-date:not(:disabled):not([aria-pressed="true"]):hover { border-color: var(--ghost-border); }
  .booker-slot:hover { background: var(--primary); border-color: var(--primary); color: #ffffff; }
  .booker-nav:not(:disabled):hover { border-color: var(--line-strong); color: var(--ink); }
}
.booker-note { grid-column: 1 / -1; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line-strong); color: var(--ink); font-size: 14px; }

.booker-form { display: grid; gap: 16px; align-content: start; }
.booker-when { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.booker-when svg { width: 20px; height: 20px; fill: none; stroke: var(--ruby); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.booker-when b { display: block; font-weight: 500; font-size: 14.5px; }
.booker-when small { font-size: 12.5px; color: var(--mute); }
.booker-form .form-error { margin-top: 0; }
.booker-form .btn { width: 100%; justify-content: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.booker-msg { display: grid; gap: 12px; align-content: center; justify-items: start; min-height: 360px; }
.booker-msg h2 { font-size: 22px; font-weight: 400; letter-spacing: -0.012em; outline: none; }
.booker-msg p { color: var(--ink-2); max-width: 29.172em; }
.booker-msg a:not(.btn) { color: var(--ink); text-decoration-color: var(--ruby); text-underline-offset: 3px; }
.booker-check { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-bg); }
.booker-check svg { width: 28px; height: 28px; fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; }

.booker-skel { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 30px; }
.booker-skel i { aspect-ratio: 1; border-radius: var(--r-md); background: var(--surface-2); }

@media (prefers-reduced-motion: no-preference) {
  .js .booker-body:not([hidden]) { animation: book-in 0.24s cubic-bezier(0.23, 1, 0.32, 1); }
  .js .booker-slot { animation: book-in 0.22s cubic-bezier(0.23, 1, 0.32, 1) both; animation-delay: calc(var(--i, 0) * 24ms); }
  .js .booker-check { animation: book-pop 0.35s cubic-bezier(0.23, 1, 0.32, 1) both; }
  .js .booker-check svg path { stroke-dashoffset: 24; animation: book-draw 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.2s forwards; }
  .booker-skel i { animation: book-pulse 1.2s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) {
  /* !important: site.css's reduced-motion reset otherwise cuts this gentle fade to nothing. */
  .js .booker-body:not([hidden]) { animation: book-fade 0.2s ease !important; }
}
@keyframes book-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes book-fade { from { opacity: 0; } }
@keyframes book-pop { from { opacity: 0; transform: scale(0.9); } }
@keyframes book-draw { to { stroke-dashoffset: 0; } }
@keyframes book-pulse { to { opacity: 0.5; } }

@media (max-width: 1023px) {
  .booker { max-width: 560px; }
}
@media (max-width: 520px) {
  .booker { padding: 16px; }
  .booker-pick { grid-template-columns: minmax(0, 1fr); }
  .booker-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: none; padding-bottom: 2px; mask-image: none; }
}
