/* Request a session: three short steps that slide (what, when, your details). Built only from base.css
   role tokens. Without JS (no .is-live) the steps show one after the other; see the block at the end. */

.book-wrap { max-width: 44rem; }
.book [hidden] { display: none !important; }
.book-wrap .sub { margin-left: 0; }
/* clip, not hidden: it still clips the slide, but lets each step's footer stick to the screen bottom. */
.book { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; }

/* Step indicator: the current step full ink, the others muted. */
.book-steps { display: flex; gap: var(--s4); margin: 0; padding: var(--s3) var(--s4); list-style: none; border-bottom: 1px solid var(--line); }
.book-steps li { display: flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: .9375rem; color: var(--ink-soft); }
.book-steps li[aria-current="step"] { color: var(--ink); }
.step-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid currentColor; font-size: .8125rem; }
.book-steps li[aria-current="step"] .step-num { background: var(--ink); border-color: var(--ink); color: var(--ground); }

/* The slide: the panels side by side, the track moves one panel width per step. Height follows the step. */
.book.is-live .book-viewport { overflow: clip; }
.book-track { display: flex; align-items: flex-start; transition: transform .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1); }
.book.is-live[data-at="2"] .book-track { transform: translateX(-100%); }
.book.is-live[data-at="3"] .book-track { transform: translateX(-200%); }
.book-panel { flex: 0 0 100%; min-width: 0; padding: var(--s4) var(--s4) 0; outline: none; }
@media (prefers-reduced-motion: reduce) { .book-track { transition: none; } }

/* Each step opens with its question; steps 2 and 3 have a back arrow beside it. */
.panel-head { display: flex; align-items: center; gap: var(--s1); margin: 0 0 var(--s4); min-height: var(--control); }
.panel-title { margin: 0; font-size: 1.375rem; line-height: 1.2; outline: none; }
.panel-back { display: inline-grid; place-items: center; flex: none; width: var(--control); height: var(--control); margin-left: calc(var(--s2) * -1); padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.panel-back:hover { background: var(--hover); }
.panel-back .icon { width: 1.375rem; height: 1.375rem; }

.step-label { margin: 0 0 var(--s2); font-weight: 700; }
.type-name { font-weight: 700; line-height: 1.25; }
.type-sub { color: var(--ink-soft); font-size: .875rem; }

/* Step 1, the only two-column step: sessions and who's coming as the same slim rows, a two by two grid.
   The radio shows as a dot. Selected: coral border and a soft tint. */
.pick-grid { display: grid; gap: var(--s5); }
.choice-rows { display: grid; gap: var(--s2); }
.choice-row { position: relative; display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background-color .15s; }
.choice-row:hover { border-color: var(--ink-soft); }
.choice-row input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.choice-row .icon-disc { flex: none; width: 2.5rem; height: 2.5rem; margin: 0; }
.choice-row .icon-disc .icon { width: 1.25rem; height: 1.25rem; }
.choice-text { display: grid; flex: 1; min-width: 0; }
.choice-dot { flex: none; width: 1.25rem; height: 1.25rem; border: 2px solid var(--ink-soft); border-radius: 50%; }
.choice-row:has(input:checked) { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, transparent); }
.choice-row:has(input:checked) .choice-dot { border-color: var(--coral); background: var(--coral); box-shadow: inset 0 0 0 3px var(--surface); }
.choice-row:has(input:focus-visible) { box-shadow: var(--focus); }

/* Step 2: the calendar, then the picked day's times: part of the day, then its times as buttons.
   One column on phones, calendar and times side by side from 48rem. */
.when-grid { display: grid; gap: var(--s5); }
.when-side { display: grid; align-content: start; gap: var(--s3); }

/* Month calendar: only free days are buttons, so they need no legend. */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.cal-month { margin: 0; font-weight: 800; font-size: 1.125rem; }
.cal-nav { display: inline-grid; place-items: center; width: var(--control); height: var(--control); padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; }
.cal-nav:hover:not(:disabled) { background: var(--hover); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-nav .icon { width: 1.5rem; height: 1.5rem; }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); }
.cal-week span { text-align: center; font-size: .75rem; font-weight: 600; color: var(--ink-soft); padding-block: var(--s1); }
.day { height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink-soft); font: inherit; font-size: .9375rem; opacity: .45; }
.day.free { opacity: 1; color: var(--ink); font-weight: 700; background: var(--hover); cursor: pointer; }
.day.free:hover { box-shadow: inset 0 0 0 2px var(--ink-soft); }
.day.today { text-decoration: underline; text-underline-offset: 3px; }
.day[aria-pressed="true"] { background: var(--coral); color: var(--onyx); }
.day.blank { visibility: hidden; }

.times-empty { display: flex; align-items: center; justify-content: center; gap: var(--s2); margin: 0; padding: var(--s4); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); text-align: center; }
.times-empty .icon { flex: none; width: 1.5rem; height: 1.5rem; }
html:has(.book.is-live) { scroll-padding-bottom: 6rem; }
.time-pick .field { margin-bottom: 0; }
.times-ui { display: grid; align-content: start; gap: var(--s3); }
.times-day { margin: 0; font-weight: 800; font-size: 1.125rem; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s1); padding: var(--s1); border-radius: 999px; background: var(--hover); }
.part { min-height: 40px; padding: 0 var(--s2); border: 0; border-radius: 999px; background: none; color: var(--ink); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.part[aria-pressed="true"] { background: var(--surface); font-weight: 700; box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
.part:disabled { opacity: .35; cursor: default; }
.time-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: var(--s2); }
.time-chip { min-height: var(--control); padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.time-chip:hover { border-color: var(--ink-soft); }
.time-chip[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: var(--onyx); }

/* Footer of each step: what you picked so far and Next. On a phone it sticks to the bottom of the
   screen while its step is in view, so Next is always under the thumb. */
.book-foot { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s5) calc(var(--s4) * -1) 0; padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--band); }
.book-pick { margin: 0; min-width: 0; font-weight: 700; font-size: .9375rem; line-height: 1.3; }
.book-pick.missing { color: var(--danger); }
.book-foot .btn { flex: none; }
.book-foot .btn .icon { width: 1.25rem; height: 1.25rem; }
.book-send { justify-content: space-between; }

/* Step 3 */
.book-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s5); padding: var(--s3) var(--s4); border-radius: 10px; background: var(--hover); font-weight: 700; font-size: .9375rem; line-height: 1.35; }
.book-summary .link-button { flex: none; min-height: var(--control); }
.detail-grid { display: grid; gap: 0 var(--s4); }
.detail-block { margin-top: var(--s4); }
.chip-options { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip-option { position: relative; }
.chip-option input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.chip-option span { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control); padding: 0 var(--s4); border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.chip-option span:hover { border-color: var(--ink-soft); }
.chip-option input:checked + span { background: var(--coral); border-color: var(--coral); color: var(--onyx); }
.chip-option input:focus-visible + span { box-shadow: var(--focus); }
.place-other { margin-top: var(--s4); }
.link-button { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.add-note { min-height: var(--control); }
.note { margin-top: var(--s3); }
.book-privacy { margin: 0; padding: var(--s3) 0 var(--s4); font-size: .875rem; color: var(--ink-soft); text-align: center; }

@media (max-width: 39.99rem) {
  .book-send .btn[type="submit"] { flex: 1; }
  .day { height: 40px; }
}
@media (min-width: 40rem) {
  .pick-grid { grid-template-columns: 1fr 1fr; gap: var(--s5); }
}
@media (min-width: 48rem) {
  .when-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); }
  .when-side { align-content: stretch; }
  .times-empty { height: 100%; flex-direction: column; }
}
@media (min-width: 48rem) {
  .book-steps { gap: var(--s5); padding: var(--s4) var(--s6); }
  .book-panel { padding: var(--s6) var(--s6) 0; }
  .book-foot { margin: var(--s6) calc(var(--s6) * -1) 0; padding: var(--s4) var(--s6); }
}

/* Nudge: the logo's three dashes burst beside whatever is still missing. */
/* Anchors size to their text, so the burst sits right after the words without moving them. */
.step-label, .cal-month, .times-day { position: relative; width: fit-content; }
.nudge { position: absolute; left: 100%; bottom: 55%; width: 2.25rem; height: 1.9rem; margin-left: .1rem; color: var(--ink); pointer-events: none; transform: rotate(22deg); transform-origin: 50% 100%; }
.nudge svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* "Ting": each dash shoots out along its own line, then flies on and shrinks away, like a spark. */
.nudge path { transform-box: fill-box; transform-origin: center; opacity: 0; animation: nudge-ting .7s cubic-bezier(.23, 1, .32, 1) forwards; }
.nudge path:nth-child(1) { --x: -34px; --y: -46px; }
.nudge path:nth-child(2) { --x: 0px; --y: -58px; animation-delay: 30ms; }
.nudge path:nth-child(3) { --x: 36px; --y: -46px; animation-delay: 60ms; }
@keyframes nudge-ting {
  0% { opacity: 0; transform: translate(calc(var(--x) * -.6), calc(var(--y) * -.6)) scale(.3); }
  28% { opacity: 1; transform: translate(calc(var(--x) * .2), calc(var(--y) * .2)) scale(1.1); }
  50% { opacity: 1; transform: translate(calc(var(--x) * .4), calc(var(--y) * .4)) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3); }
}
/* The thing that is missing does a small pop at the same moment: the "ta-da". */
.nudged { animation: nudge-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
.control.nudged { animation-name: nudge-pop-soft; }
@keyframes nudge-pop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes nudge-pop-soft { 0% { transform: scale(1); } 40% { transform: scale(1.02); } 100% { transform: scale(1); } }
.step-label, .times-day { transform-origin: left center; }
/* In a text field it sits at the right end of the box. */
.control > .nudge { left: auto; right: var(--s3); bottom: auto; top: 50%; margin: 0; transform: translateY(-75%) rotate(22deg); }
@media (prefers-reduced-motion: reduce) {
  .nudge path { animation-name: nudge-fade; }
  .nudged { animation: none; }
  @keyframes nudge-fade { 0% { opacity: 0; } 20%, 75% { opacity: 1; } 100% { opacity: 0; } }
}

/* Server errors and field errors inside the card. */
.book > .error-summary { margin: var(--s4) var(--s4) 0; }
.pick-group .error { margin: var(--s2) 0 0; color: var(--danger); font-weight: 600; font-size: .875rem; }
.when-fallback { display: grid; gap: var(--s4); }

/* No JS: one long form. The step bar, Next, Back and the summary need the script, so they hide. */
.book:not(.is-live) .book-track { display: block; }
.book:not(.is-live) :is(.book-steps, .book-summary, [data-back], .book-foot:not(.book-send)) { display: none; }

