/* ==========================================================================
   Pacod call booking: the "Book 20 minutes" dialog, the reply page (/booking/respond)
   and the time picker for offered times (/booking/choose).
   Built on the tokens in styles.css. Every class starts with bk- so nothing collides.
   No inline styles anywhere: the site's CSP is style-src 'self'.
   ========================================================================== */

:root {
  --bk-ok-bg: #EAFBEE;
  --bk-ok-ink: #14783A;
  --bk-warn-bg: #FBEBCB;
  --bk-warn-ink: #8A5E0F;
  --bk-bad-bg: #F6DDD4;
  --bk-bad-ink: #B0472A;
  --bk-info-bg: #E6F1F9;
  --bk-info-ink: #1F6FA8;
  --bk-dot: #4BE067;
  --bk-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

html.bk-lock { overflow: hidden; }

/* Component display rules must never beat the hidden attribute. */
.bk-dialog [hidden], [data-booking] [hidden] { display: none !important; }

/* Dialog ---------------------------------------------------------------- */

.bk-dialog {
  width: min(1060px, calc(100vw - 32px));
  max-width: none;
  max-height: min(92vh, 900px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(6, 22, 14, 0.45);
  overflow: hidden;
}
.bk-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.bk-dialog::backdrop { background: rgba(6, 22, 14, 0.42); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) {
  .bk-dialog[open] { animation: bk-pop 0.32s var(--bk-ease); }
  .bk-dialog[open]::backdrop { animation: bk-fade 0.24s ease; }
}
@keyframes bk-pop { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.985); } }
@keyframes bk-fade { from { opacity: 0; } }

.bk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(18px, 3vw, 28px); border-bottom: 1px solid var(--line); }
.bk-top-title { display: grid; gap: 2px; min-width: 0; }
.bk-top-title h2 { margin: 0; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); line-height: 1.1; }
.bk-top-title p { margin: 0; color: var(--ink-3); font-size: 0.875rem; }
.bk-x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.bk-x svg { width: 18px; height: 18px; }
.bk-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.bk-scroll { overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }

/* Phones: a full-screen sheet. */
@media (max-width: 719px) {
  .bk-dialog { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); }
  @media (prefers-reduced-motion: no-preference) { .bk-dialog[open] { animation: bk-sheet 0.36s var(--bk-ease); } }
}
@keyframes bk-sheet { from { transform: translate3d(0, 40px, 0); opacity: 0; } }

/* Stepper --------------------------------------------------------------- */

.bk-steps-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(18px, 3vw, 28px); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.bk-stepper { display: flex; gap: 6px; align-items: center; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.bk-stepper li { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-3); }
.bk-stepper li + li::before { content: ""; width: 20px; height: 1px; background: var(--line-2); margin-right: 2px; }
.bk-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line-2); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.bk-stepper li.is-on { color: var(--ink); font-weight: 500; }
.bk-stepper li.is-on .bk-n { background: var(--ink); border-color: var(--ink); color: #fff; }
.bk-stepper li.is-done .bk-n { background: var(--bk-dot); border-color: var(--bk-dot); color: #0C2913; }
.bk-steps-bar small { color: var(--ink-3); font-size: 0.8125rem; white-space: nowrap; }
@media (max-width: 480px) { .bk-stepper li:not(.is-on) .bk-sl { display: none; } }

.bk-body { padding: clamp(18px, 3vw, 28px); min-width: 0; }
.bk-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px clamp(18px, 3vw, 28px) calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); position: sticky; bottom: 0; z-index: 2; }
.bk-hint { margin: 0; font-size: 0.875rem; color: var(--ink-3); min-width: 0; }
.bk-btns { display: flex; gap: 10px; margin-left: auto; }
@media (prefers-reduced-motion: no-preference) { .bk-in { animation: bk-in 0.35s var(--bk-ease) both; } }
@keyframes bk-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

/* Two columns inside step 1 on wide screens: a short "what this is" beside the form. */
.bk-split { display: grid; gap: 24px; }
@media (min-width: 960px) { .bk-split { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 36px; } }
.bk-aside { display: grid; gap: 14px; align-content: start; }
.bk-meta { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bk-meta li { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-size: 0.9375rem; }
.bk-meta svg { width: 18px; height: 18px; flex: none; }
.bk-next { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin: 0; padding-left: 0; list-style: none; counter-reset: bk; }
.bk-next li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 0.875rem; color: var(--ink-2); counter-increment: bk; }
.bk-next li::before { content: counter(bk); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); font-size: 0.75rem; font-weight: 500; }
@media (max-width: 959px) { .bk-aside .bk-next { display: none; } .bk-meta { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }

/* Fields ---------------------------------------------------------------- */

.bk-fs { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 20px; }
.bk-q { display: grid; gap: 8px; min-width: 0; align-content: start; }
.bk-ql { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.bk-ql small { font-weight: 400; color: var(--ink-3); }
.bk-grid2 { display: grid; gap: 18px 16px; }
@media (min-width: 640px) { .bk-grid2 { grid-template-columns: 1fr 1fr; } }
.bk-in-f, .bk-sel, .bk-ta {
  font: inherit; font-size: 1rem; color: var(--ink); width: 100%; min-width: 0;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; min-height: 46px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bk-ta { min-height: 84px; resize: vertical; }
.bk-in-f:focus, .bk-sel:focus, .bk-ta:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11, 11, 11, 0.06); }
.bk-in-f[aria-invalid="true"], .bk-sel[aria-invalid="true"] { border-color: var(--bk-bad-ink); }
.bk-err { color: var(--bk-bad-ink); font-size: 0.8125rem; margin: 0; }
.bk-flag { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8125rem; line-height: 1.4; padding: 8px 10px; border-radius: 10px; margin: 0; }
.bk-flag svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.bk-flag--ok { background: var(--bk-ok-bg); color: var(--bk-ok-ink); }
.bk-flag--warn { background: var(--bk-warn-bg); color: var(--bk-warn-ink); }
.bk-flag--bad { background: var(--bk-bad-bg); color: var(--bk-bad-ink); }

.bk-roles { display: grid; gap: 10px; }
@media (min-width: 560px) { .bk-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bk-role { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 3px 12px; align-items: start; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.bk-role input { position: absolute; opacity: 0; pointer-events: none; }
.bk-rd { grid-row: span 2; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); margin-top: 1px; display: grid; place-items: center; }
.bk-role b { font-weight: 500; font-size: 0.9375rem; }
.bk-role span:last-child { font-size: 0.8125rem; color: var(--ink-3); line-height: 1.35; }
.bk-role:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.bk-role:has(input:checked) .bk-rd { border-color: var(--ink); }
.bk-role:has(input:checked) .bk-rd::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.bk-role:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.bk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-chip { position: relative; }
.bk-chip input { position: absolute; opacity: 0; pointer-events: none; }
.bk-chip span { display: inline-flex; align-items: center; padding: 8px 14px; min-height: 38px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.875rem; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.bk-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.bk-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Time zone, calendar, slots ------------------------------------------- */

.bk-tzbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--surface); border-radius: 14px; margin-bottom: 20px; }
.bk-tz-now { display: flex; gap: 10px; align-items: center; font-size: 0.9375rem; min-width: 0; }
.bk-tz-now svg { width: 18px; height: 18px; flex: none; }
.bk-tz-now b { font-weight: 500; }
.bk-tz-now small { color: var(--ink-3); font-size: 0.8125rem; }
.bk-tz-ctrl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.bk-tz-ctrl .bk-sel { min-height: 38px; padding: 6px 12px; font-size: 0.875rem; width: auto; max-width: 100%; border-radius: 999px; }
.bk-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--bg); }
.bk-seg button { font: inherit; font-size: 0.8125rem; border: 0; background: none; padding: 5px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-3); min-height: 30px; }
.bk-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.bk-pick { display: grid; gap: 24px; }
@media (min-width: 760px) { .bk-pick { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
.bk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bk-cal-head h3, .bk-slots-head h3 { margin: 0; font-family: inherit; font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; }
.bk-cal-nav { display: flex; gap: 6px; }
.bk-cal-nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.bk-cal-nav button:disabled { opacity: 0.35; cursor: default; }
.bk-cal-nav svg { width: 16px; height: 16px; }
.bk-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.bk-dow { font-size: 0.75rem; color: var(--ink-3); text-align: center; padding-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.bk-day { aspect-ratio: 1; max-width: 100%; border-radius: 12px; border: 1px solid transparent; background: none; font: inherit; font-size: 0.9375rem; font-variant-numeric: tabular-nums; color: var(--ink-4, #898985); display: grid; place-items: center; position: relative; padding: 0; }
.bk-day.is-open { background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; transition: background-color 0.15s ease, transform 0.15s ease; }
.bk-day.is-open::after { content: ""; position: absolute; bottom: 16%; width: 4px; height: 4px; border-radius: 50%; background: var(--green-500, #2E8B57); }
@media (hover: hover) and (pointer: fine) { .bk-day.is-open:hover { background: var(--surface-2); } }
.bk-day.is-open:active { transform: scale(0.95); }
.bk-day.is-today { border-color: var(--line-2); }
.bk-day[aria-pressed="true"] { background: var(--ink); color: #fff; }
.bk-day[aria-pressed="true"]::after { background: var(--bk-dot); }
.bk-day:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bk-blank { visibility: hidden; }
.bk-cal-key { display: flex; gap: 14px; margin-top: 12px; font-size: 0.75rem; color: var(--ink-3); flex-wrap: wrap; }
.bk-cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.bk-cal-key i { width: 12px; height: 12px; border-radius: 4px; background: var(--surface); display: inline-block; }

.bk-slots-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.bk-slots-head small { color: var(--ink-3); font-size: 0.8125rem; }
.bk-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.bk-slot { font: inherit; color: var(--ink); text-align: left; display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; min-height: 52px; }
.bk-slot b { font-weight: 500; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.bk-slot small { font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .bk-slot:hover:not(:disabled) { border-color: var(--ink); } }
.bk-slot:active:not(:disabled) { transform: scale(0.97); }
.bk-slot[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.bk-slot[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.72); }
.bk-slot:disabled { cursor: default; color: var(--ink-3); background: var(--surface); border-color: transparent; text-decoration: line-through; }
.bk-slot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bk-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 0.9375rem; border: 1px dashed var(--line-2); border-radius: 14px; margin: 0; grid-column: 1 / -1; }

/* The node loader: three nodes, a green dot travelling along them. */
.bk-loader { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 28px 0; color: var(--ink-3); font-size: 0.875rem; grid-column: 1 / -1; }
.bk-loader i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
@media (prefers-reduced-motion: no-preference) {
  .bk-loader i { animation: bk-node 1.2s ease-in-out infinite; }
  .bk-loader i:nth-child(2) { animation-delay: 0.2s; }
  .bk-loader i:nth-child(3) { animation-delay: 0.4s; }
}
@keyframes bk-node { 0%, 100% { background: var(--line-2); } 40% { background: var(--bk-dot); } }

/* Review and sent ------------------------------------------------------- */

.bk-review { display: grid; margin: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.bk-review > div { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; align-items: start; }
.bk-review > div + div { border-top: 1px solid var(--line); }
.bk-review dt { color: var(--ink-3); font-size: 0.875rem; }
.bk-review dd { margin: 0; font-size: 0.9375rem; min-width: 0; overflow-wrap: anywhere; }
.bk-review dd small { display: block; color: var(--ink-3); font-size: 0.8125rem; margin-top: 2px; }
.bk-edit { font: inherit; font-size: 0.8125rem; color: var(--ink); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
@media (max-width: 520px) { .bk-review > div { grid-template-columns: 1fr auto; } .bk-review dt { grid-column: 1 / -1; } }
.bk-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--ink-2); margin-top: 18px; }
.bk-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: #0B0B0B; flex: none; }
.bk-consent a { color: inherit; }

.bk-done { display: grid; gap: 16px; justify-items: start; padding-block: 8px; max-width: 60ch; }
.bk-done-mark { width: 52px; height: 52px; border-radius: 50%; background: var(--bk-ok-bg); display: grid; place-items: center; }
.bk-done-mark svg { width: 24px; height: 24px; color: var(--bk-ok-ink); }
.bk-done h3 { margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); }
.bk-done p { margin: 0; color: var(--ink-2); }
.bk-when { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--surface); }
.bk-when b { font-weight: 500; }
.bk-when small { color: var(--ink-3); }
.bk-pill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; }
.bk-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bk-pill--wait { background: var(--bk-warn-bg); color: var(--bk-warn-ink); }
.bk-pill--ok { background: var(--bk-ok-bg); color: var(--bk-ok-ink); }
.bk-pill--no { background: var(--bk-bad-bg); color: var(--bk-bad-ink); }
.bk-pill--new { background: var(--bk-info-bg); color: var(--bk-info-ink); }

/* Reply page (/booking/respond) and choose page (/booking/choose) -------- */

.bk-page { max-width: 880px; margin: 0 auto; display: grid; gap: 20px; }
.bk-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.bk-page-head h1 { margin: 0; font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); }
.bk-card { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
.bk-card-top { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: baseline; }
.bk-card-top b { font-size: 1.0625rem; font-weight: 500; }
.bk-card-top small { color: var(--ink-3); }
.bk-kv { display: grid; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bk-kv > div { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr); gap: 12px; padding: 10px 14px; font-size: 0.875rem; }
.bk-kv > div + div { border-top: 1px solid var(--line); }
.bk-kv dt { color: var(--ink-3); }
.bk-kv dd { margin: 0; overflow-wrap: anywhere; }
.bk-checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bk-checks li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.875rem; color: var(--ink-2); }
.bk-checks svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.bk-checks .ok svg { color: var(--bk-ok-ink); }
.bk-checks .warn svg { color: var(--bk-warn-ink); }
.bk-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.bk-tabs button { font: inherit; font-size: 0.9375rem; color: var(--ink); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); cursor: pointer; min-height: 42px; }
.bk-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.bk-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bk-alts { display: grid; gap: 14px; }
.bk-alt-day { display: grid; gap: 8px; }
.bk-alt-day h4 { margin: 0; font-family: inherit; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.bk-alt-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-alt-slots .bk-slot { min-height: 0; padding: 7px 10px; }
.bk-counter { font-size: 0.8125rem; color: var(--ink-3); }
.bk-choices { display: grid; gap: 10px; }
@media (min-width: 640px) { .bk-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bk-choices .bk-slot { min-height: 64px; padding: 12px 14px; }
