/* Booking pages (cs/website-light, plan §3.8): a person's booking page, /book/<address>/, and the page a guest moves or
   cancels a booking on, /book/manage/, in all seven website themes. Built on theme.css's tokens, so each theme keeps
   its own colours and type (Light and Black read their dBoss palette through the same tokens). The calendar mock's
   booking page is the reference. The staff screen, /calendar/booking/, is at the end, on the CRM's tokens.
   Every bit of text sits on the card; loading is a sheen, never a spinner. */

.bk-section {
    padding: 128px 5% 80px;
    min-height: 70vh;
}
.bk-section.bk-bare { padding-top: 56px; }

.bk-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--db-sh-2, 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -24px rgb(0 0 0 / .6));
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
}
html.website-light:not(.website-black) .bk-page { background: #FFFFFF; }
.bk-page.bk-manage { max-width: 760px; }
.bk-page button,
.bk-page input { font: inherit; }
.bk-page [hidden] { display: none !important; }

/* -- who the call is with ---------------------------------------------------------------------------------------- */
.bk-who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bk-avatar {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: .02em;
}
.bk-avatar svg { width: 24px; height: 24px; }
.bk-who-text { min-width: 0; flex: 1 1 auto; }      /* the pill wraps under the name rather than squeezing it */
.bk-name { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--text-primary); letter-spacing: -.01em; }
.bk-sub { margin: 2px 0 0; font-size: 14px; color: var(--text-secondary); }
.bk-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.bk-pill svg { width: 15px; height: 15px; }

/* -- the month and the times --------------------------------------------------------------------------------------- */
.bk-cols { display: grid; grid-template-columns: minmax(250px, 400px) minmax(220px, 1fr); gap: 32px; align-items: start; }
.bk-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.bk-month { flex: 1; font-size: 16px; font-weight: 600; color: var(--text-primary); }
.bk-nav {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
}
.bk-nav svg { width: 16px; height: 16px; }
.bk-nav:hover:not([disabled]) { background: var(--bg-hover); }
.bk-nav[disabled] { opacity: .4; cursor: default; }
.bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bk-dow { text-align: center; font-size: 12px; color: var(--text-secondary); padding: 4px 0; }
.bk-d {
    aspect-ratio: 1;
    min-width: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    cursor: default;
}
.bk-d.out { visibility: hidden; }      /* another month's days: the grid keeps its shape, without faint numbers */
.bk-d.open { color: var(--text-primary); font-weight: 600; background: var(--accent-soft); cursor: pointer; }
.bk-d.open:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.bk-d.today:not(.open) { box-shadow: inset 0 0 0 1px var(--border-hover); }
.bk-d.sel,
.bk-d.sel:hover { background: var(--accent); color: var(--accent-contrast, #FFFFFF); }
.bk-d:focus-visible,
.bk-slot:focus-visible,
.bk-btn:focus-visible,
.bk-nav:focus-visible { outline: 2px solid var(--db-focus, var(--accent)); outline-offset: 2px; }

.bk-right { min-width: 0; }
.bk-pane { display: flex; flex-direction: column; gap: 10px; }
.bk-day-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.bk-hint { margin: 0; font-size: 14px; color: var(--text-secondary); }
.bk-slots { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; padding: 2px 4px 2px 2px; }
.bk-slot {
    flex: none;
    height: 40px;
    border: 1px solid var(--accent);
    border-radius: 9px;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.bk-slot:hover { background: var(--accent); color: var(--accent-contrast, #FFFFFF); }
.bk-zone { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); }

/* -- the details form ------------------------------------------------------------------------------------------------ */
.bk-form { display: flex; flex-direction: column; gap: 12px; }
.bk-when { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.bk-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.bk-field input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border-hover);
    border-radius: 9px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
}
html.website-light:not(.website-black) .bk-field input { background: #FFFFFF; }
.bk-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-field.is-wrong input { border-color: var(--color-error); }
.bk-err { font-size: 13px; color: var(--color-error); }
.bk-turnstile:empty { display: none; }
.bk-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-actions .bk-grow { flex: 1; }

.bk-btn {
    position: relative;
    overflow: hidden;
    height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.bk-btn-primary { background: var(--accent); color: var(--accent-contrast, #FFFFFF); }
.bk-btn-primary:hover:not([disabled]) { background: var(--accent-secondary); }
.bk-btn-ghost { background: transparent; border-color: var(--border-hover); color: var(--text-primary); }
.bk-btn-ghost:hover:not([disabled]) { background: var(--bg-hover); }
.bk-btn[disabled] { cursor: default; opacity: .7; }
/* A button waiting on its post: a sheen runs across it. */
.bk-btn.is-busy::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / .28) 50%, transparent 80%);
    background-size: 200% 100%;
    animation: bk-sheen 1.2s linear infinite;
}

/* -- what the visitor is told ----------------------------------------------------------------------------------------- */
.bk-msg { margin: 0; font-size: 14px; color: var(--text-primary); }
.bk-msg.is-error { color: var(--color-error); }
.bk-done { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bk-done svg { width: 30px; height: 30px; color: var(--color-success); }
.bk-done-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.bk-closed { padding: 8px 0 4px; }
.bk-closed .bk-msg { font-size: 15px; }

/* -- the change-or-cancel page ---------------------------------------------------------------------------------------- */
.bk-booking { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.bk-booking-day { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.bk-booking-time { font-size: 15px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bk-booking-where { font-size: 14px; color: var(--text-secondary); }

/* -- loading: a sheen, never a spinner ----------------------------------------------------------------------------- */
.bk-sheen {
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--bg-subtle, rgb(127 127 127 / .08)) 0%, var(--bg-hover, rgb(127 127 127 / .16)) 50%,
                var(--bg-subtle, rgb(127 127 127 / .08)) 100%);
    background-size: 200% 100%;
    animation: bk-sheen 1.4s ease-in-out infinite;
}
.bk-sheen.is-line { height: 14px; }
.bk-sheen.is-wide { width: 70%; }
.bk-sheen.is-slot { height: 40px; }
.bk-sheen.is-grid { aspect-ratio: 7 / 6; width: 100%; border-radius: 12px; }
@keyframes bk-sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
    .bk-sheen, .bk-btn.is-busy::after { animation: none; }
}

@media (max-width: 720px) {
    .bk-section { padding: 104px 16px 56px; }
    .bk-section.bk-bare { padding-top: 24px; }
    .bk-page { padding: 18px; gap: 18px; }
    .bk-cols { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .bk-slots { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}


/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   Your booking page, the staff screen (/calendar/booking/), on the CRM's tokens
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
.bk-staff { padding: 24px; display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.bk-staff-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text-main);
    font-size: var(--text-base, 14px);
    min-width: 0;
}
.bk-staff-title { margin: 0; font-size: var(--text-lg, 16px); font-weight: 600; color: var(--text-main); }
.bk-staff-note { margin: 0; font-size: var(--text-sm, 13px); color: var(--text-muted); line-height: 1.5; }
.bk-staff-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 4px 4px 4px 12px;
    border-radius: var(--radius-md, 8px);
    background: var(--bg-hover);
    font-size: var(--text-sm, 13px);
    font-weight: 500;
}
.bk-staff-link .bk-staff-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); }
.bk-staff-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
    font-size: var(--text-sm, 13px);
    font-weight: 500;
    cursor: pointer;
}
.bk-staff-btn:hover { border-color: var(--brand-primary); }
.bk-staff-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.bk-staff-row .bk-staff-label { flex: 1; min-width: 0; font-weight: 500; }
.bk-staff-row .bk-staff-label small { display: block; font-weight: 400; font-size: var(--text-sm, 13px); color: var(--text-muted); }
.bk-switch {
    flex: none;
    position: relative;
    width: 40px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: var(--border-subtle);
    cursor: pointer;
    transition: background var(--duration-fast, .15s);
}
.bk-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgb(0 0 0 / .3);
    transition: transform var(--duration-fast, .15s);
}
.bk-switch[aria-checked="true"] { background: var(--brand-primary); }
.bk-switch[aria-checked="true"]::after { transform: translateX(18px); }
.bk-switch[disabled] { opacity: .5; cursor: default; }
.bk-switch:focus-visible { outline: 2px solid var(--border-focus, var(--brand-primary)); outline-offset: 2px; }
.bk-staff-state { display: flex; align-items: flex-start; gap: 8px; font-size: var(--text-sm, 13px); }
.bk-staff-state .bk-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--text-muted); }
.bk-staff-state.is-open .bk-dot { background: #16A34A; }
.bk-staff-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--text-sm, 13px); }
.bk-staff-facts dt { color: var(--text-muted); font-weight: 400; }
.bk-staff-facts dd { margin: 0; color: var(--text-main); }
.bk-staff-frame-wrap { position: relative; min-height: 640px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg, 12px); overflow: hidden; }
.bk-staff-frame { display: block; width: 100%; height: 760px; border: 0; background: transparent; }
.bk-staff-frame-wrap .bk-sheen { position: absolute; inset: 0; border-radius: 0; }
.bk-staff-frame-wrap.is-loaded .bk-sheen { display: none; }
@media (max-width: 1100px) {
    .bk-staff { grid-template-columns: minmax(0, 1fr); }
}
