/* botdoctor.io/book — on-site booking flow. Builds on css/front.css tokens (body.bd-front). */

.bd-book { --tile: #fbf8f2; --tile-on: #eef1f7; --ease: cubic-bezier(.22, 1, .36, 1); --btn: #18335f; }
.bd-book [hidden] { display: none !important; }
.bd-book .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bd-book .back { font-family: var(--mono); font-size: 14px; color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.bd-book .back:hover { color: var(--text); }

.bd-book .book { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-block: clamp(16px, 3vw, 36px) clamp(40px, 6vw, 80px); }

/* Ticket (live summary) */
.bd-book .ticket { position: sticky; top: 24px; background: var(--ink); color: #f5f0e6; border-radius: 14px; padding: 28px 26px 26px; }
.bd-book .ticket__k { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #a9c7ee; margin: 0 0 12px; }
.bd-book .ticket__title { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; letter-spacing: -.015em; margin: 0 0 22px; text-wrap: balance; }
.bd-book .ticket__facts { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; font-size: 15px; color: #d7dfed; }
.bd-book .ticket__facts li { display: flex; align-items: center; gap: 10px; }
.bd-book .ticket__facts svg { width: 18px; height: 18px; fill: none; stroke: #a9c7ee; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bd-book .ticket__picks { border-top: 1px solid rgba(215, 223, 237, .18); padding-top: 18px; display: grid; gap: 14px; }
.bd-book .pick { display: grid; gap: 3px; transition: transform .35s var(--ease); }
.bd-book .pick.is-set { animation: bd-pop .45s var(--ease); }
.bd-book .pick__k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #aebbd0; }
.bd-book .pick__v { font-size: 15px; color: #fff; }
.bd-book .pick__v.is-empty { color: #8f9bb0; }
@keyframes bd-pop { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

/* Flow card */
.bd-book .flow { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(22px, 3.2vw, 40px); box-shadow: 0 1px 0 rgba(23, 34, 58, .04), 0 18px 40px -28px rgba(23, 34, 58, .25); min-width: 0; }
.bd-book .flow__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.bd-book .flow__step { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin: 0 0 8px; }
.bd-book .flow__title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.02; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.bd-book .flow__pct { font-family: var(--mono); font-size: 13px; color: var(--dim); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.bd-book .bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 0 26px; }
.bd-book .bar span { height: 5px; border-radius: 99px; background: #e7e2d6; overflow: hidden; position: relative; }
.bd-book .bar span::after { content: ""; position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.bd-book .bar span.is-on::after { transform: scaleX(1); }
.bd-book .flow__lede { margin: 0 0 18px; color: var(--muted); font-size: 16px; }
.bd-book .notice { margin: 0 0 18px; padding: 12px 14px; border-radius: 8px; background: #f3efe5; border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.bd-book .notice a { color: var(--red); }

/* Steps */
.bd-book fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.bd-book .step { display: none; }
.bd-book .step.is-active { display: block; animation: bd-in .42s var(--ease) both; }
.bd-book .step.is-back { animation-name: bd-in-back; }
@keyframes bd-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes bd-in-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

/* Tiles */
.bd-book .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.bd-book .tile { position: relative; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; padding: 14px 16px; background: var(--tile); border: 1px solid #e3ddcf; border-radius: 10px; cursor: pointer; user-select: none; transition: border-color .18s ease, background-color .18s ease, transform .12s ease, box-shadow .18s ease; }
.bd-book .tile--wide { grid-column: 1 / -1; }
.bd-book .tile:hover { border-color: #b9c3d6; }
.bd-book .tile:active { transform: scale(.985); }
.bd-book .tile input { position: absolute; opacity: 0; pointer-events: none; }
.bd-book .tile__box { grid-row: 1 / span 2; align-self: start; margin-top: 1px; width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid #b8b3a6; background: #fff; display: grid; place-items: center; transition: background-color .18s ease, border-color .18s ease; }
.bd-book .tile__box::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .22s var(--ease); }
.bd-book .tile__t { font-weight: 600; font-size: 16px; color: var(--text); }
.bd-book .tile__d { font-size: 14px; color: var(--muted); line-height: 1.35; }
.bd-book .tile:has(input:checked) { background: var(--tile-on); border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.bd-book .tile:has(input:checked) .tile__box { background: var(--red); border-color: var(--red); }
.bd-book .tile:has(input:checked) .tile__box::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.bd-book .tile:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }

/* Fields */
.bd-book .field { display: grid; gap: 6px; }
.bd-book .field__l { font-size: 14px; font-weight: 500; color: var(--text); }
.bd-book .field__l em { font-style: normal; font-weight: 400; color: var(--dim); margin-left: 4px; }
.bd-book .field input, .bd-book .field textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--tile); border: 1px solid #e3ddcf; border-radius: 9px; padding: 12px 14px; min-height: 48px; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; width: 100%; }
.bd-book .field textarea { resize: vertical; min-height: 88px; }
.bd-book .field input:focus, .bd-book .field textarea:focus { outline: none; background: #fff; border-color: var(--red); box-shadow: 0 0 0 3px rgba(30, 58, 110, .14); }
.bd-book .field input.is-bad { border-color: #b3261e; box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.bd-book .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bd-book .meeting-type { display: grid; gap: 10px; }
.bd-book .meeting-type legend { width: 100%; }
.bd-book .meeting-type__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bd-book .meeting-option { min-width: 0; }
.bd-book .meeting-option .tile__box { border-radius: 50%; }
.bd-book .meeting-option .tile__box::after { width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; transform: scale(0); }
.bd-book .meeting-option:has(input:checked) .tile__box::after { transform: scale(1); }
.bd-book .field--wide { grid-column: 1 / -1; }
.bd-book .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Days */
.bd-book .days-wrap { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.bd-book .days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(78px, 1fr); gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px; }
.bd-book .days::-webkit-scrollbar { display: none; }
.bd-book .days-nav { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e3ddcf; background: var(--tile); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; transition: background-color .18s ease, transform .12s ease; }
.bd-book .days-nav:hover { background: #fff; }
.bd-book .days-nav:active { transform: scale(.94); }
.bd-book .days-nav:disabled { opacity: .35; cursor: default; }
.bd-book .day { scroll-snap-align: start; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 10px; background: var(--tile); border: 1px solid #e3ddcf; cursor: pointer; font: inherit; color: var(--text); transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .12s ease; }
.bd-book .day:hover { border-color: #b9c3d6; }
.bd-book .day:active { transform: scale(.97); }
.bd-book .day__w { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.bd-book .day__n { font-family: var(--serif); font-size: 30px; line-height: 1; }
.bd-book .day__m { font-size: 12px; color: var(--muted); }
.bd-book .day__c { font-family: var(--mono); font-size: 10.5px; color: var(--red); margin-top: 4px; }
.bd-book .day[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #f5f0e6; }
.bd-book .day[aria-checked="true"] .day__w, .bd-book .day[aria-checked="true"] .day__m { color: #aebbd0; }
.bd-book .day[aria-checked="true"] .day__c { color: #a9c7ee; }
.bd-book .day-label { margin: 22px 0 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Slots */
.bd-book .slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.bd-book .slot { font: inherit; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; min-height: 48px; border-radius: 9px; border: 1px solid #d6dbe6; background: #fff; color: var(--red); cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease; animation: bd-rise .35s var(--ease) both; }
.bd-book .slot:hover { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.bd-book .slot:active { transform: scale(.97); }
.bd-book .slot[aria-checked="true"] { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
@keyframes bd-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bd-book .empty { color: var(--muted); font-size: 15px; }

/* Review */
.bd-book .review { margin-top: 22px; border: 1px dashed #d6d0c2; border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
.bd-book .review b { color: var(--text); font-weight: 600; }

/* Footer nav */
.bd-book .flow__foot { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.bd-book .foot__hint { margin-left: auto; font-size: 14px; color: var(--dim); }
.bd-book .btn { --k: #0b1220; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #f6f2e9; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer; box-shadow: 0 2px 0 var(--k); transform: translateY(0); transition: transform .14s ease, box-shadow .14s ease, background-color .18s ease, opacity .18s ease; }
.bd-book .btn span[aria-hidden] { font-family: var(--sans); font-size: 16px; letter-spacing: 0; transition: transform .18s ease; }
.bd-book .btn:hover { background: #1e2c49; transform: translateY(-1px); box-shadow: 0 3px 0 var(--k); }
.bd-book .btn:hover span[aria-hidden="true"]:last-child { transform: translateX(3px); }
.bd-book .btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--k); }
.bd-book .btn:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: 0 2px 0 var(--k); }
.bd-book .btn--ghost { --k: #d6d0c2; background: #fff; color: var(--text); border-color: #d6d0c2; }
.bd-book .btn--ghost:hover { background: #f3efe5; }
.bd-book .btn--ghost:hover span[aria-hidden="true"]:last-child { transform: none; }
.bd-book .btn.is-loading { pointer-events: none; }
.bd-book .btn.is-loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: bd-spin .7s linear infinite; }
@keyframes bd-spin { to { transform: rotate(360deg); } }

/* Done */
.bd-book .step--done { text-align: left; padding-block: 8px; }
.bd-book .done__mark { width: 64px; height: 64px; margin-bottom: 18px; fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.bd-book .done__mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: bd-draw .6s var(--ease) forwards; }
.bd-book .done__mark path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: bd-draw .4s .45s var(--ease) forwards; }
@keyframes bd-draw { to { stroke-dashoffset: 0; } }
.bd-book .done__title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 60px); line-height: 1; margin: 0 0 10px; }
.bd-book .done__when { font-size: 20px; color: var(--text); margin: 0 0 6px; }
.bd-book .done__line { color: var(--muted); margin: 0 0 24px; }
.bd-book .done__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bd-book.is-done .flow__head, .bd-book.is-done .bar, .bd-book.is-done .flow__foot { display: none; }

/* Footer */
.bd-book footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 900px) {
  .bd-book .book { grid-template-columns: 1fr; }
  .bd-book .ticket { position: static; padding: 20px; }
  .bd-book .ticket__title { font-size: 30px; margin-bottom: 14px; }
  .bd-book .ticket__facts { grid-auto-flow: column; justify-content: start; gap: 16px; font-size: 14px; margin-bottom: 16px; }
}
@media (max-width: 600px) {
  .bd-book .tiles, .bd-book .grid2 { grid-template-columns: 1fr; }
  .bd-book .meeting-type__options { grid-template-columns: 1fr; }
  .bd-book .ticket { padding: 16px 18px; border-radius: 12px; }
  .bd-book .ticket__k { margin-bottom: 6px; }
  .bd-book .ticket__title { font-size: 26px; margin-bottom: 10px; }
  .bd-book .ticket__facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 0; }
  .bd-book .ticket__facts li { white-space: nowrap; }
  .bd-book .ticket__facts svg { width: 15px; height: 15px; }
  .bd-book .ticket__picks { display: none; }
  .bd-book .flow__foot { position: sticky; bottom: 0; background: #fff; margin-inline: -22px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .bd-book .foot__hint { display: none; }
  .bd-book #next { margin-left: auto; flex: 1; min-width: 0; white-space: normal; padding-inline: 12px; gap: 6px; font-size: 12px; letter-spacing: .08em; }
  .bd-book .days-nav { display: none; }
  .bd-book .days-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .bd-book *, .bd-book *::before, .bd-book *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

@media (max-width: 380px) {
  .bd-book .flow__foot { flex-wrap: wrap; }
  .bd-book #next { flex-basis: 100%; }
}
