/* Booking flow: two-column layout, left panel steps through type/date/time,
   right panel holds the contact form and unlocks once a slot is picked. */

/* Mapped onto the funnel tokens, same reason as site.css. */
:root {
    --bk-bg: var(--fn-bg, #f4f5f7);
    --bk-surface: var(--fn-surface, #ffffff);
    --bk-border: var(--fn-border, #e2e4e9);
    --bk-text: var(--fn-text, #1a1d23);
    --bk-text-muted: var(--fn-text-muted, #6b7280);
    --bk-accent: var(--fn-accent, #d60a12);
    --bk-accent-soft: var(--fn-accent-tint, #e6f4f8);
    /* An available slot outlines and labels itself in the accent. Both of
       these were tints of the old orange. */
    --bk-accent-border: color-mix(in srgb, var(--bk-accent) 38%, transparent);
    --bk-accent-ink: var(--fn-accent-ink, #076882);
    --bk-danger: var(--fn-danger, #b3261e);
    --bk-danger-tint: var(--fn-danger-tint, #fdecea);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bk-bg);
    color: var(--bk-text);
}

.bk-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.bk-wrap-embedded {
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 100px;
    align-items: flex-start;
}

.site-schedule-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 70px 24px 0;
}

.site-schedule-intro-fill {
    min-height: 52vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 48px;
}

.site-schedule-intro h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 12px;
    color: var(--bk-text);
}

.site-schedule-intro h1::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: var(--site-accent);
    margin: 14px auto 0;
}

/* The quiz page is heading plus form and nothing else, so the section gap
   the other intros use reads as a hole here. */
.site-schedule-intro.site-apply-intro p {
    margin-bottom: 0;
}

.site-apply-intro + .bk-wrap-embedded {
    padding-top: 4px;
}

.site-schedule-intro p {
    color: var(--bk-text-muted);
    font-size: 16px;
    margin: 0 0 32px;
    /* Two even lines rather than a full one and a three-word orphan. Browsers
       without it just wrap as before. */
    text-wrap: balance;
}

.bk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 900px;
    align-items: start;
}

.bk-panel {
    background: var(--bk-surface);
    border: 1px solid var(--bk-border);
    border-radius: 12px;
    overflow: hidden;
}

.bk-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--bk-border);
}

.bk-panel-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    flex: 1;
}

.bk-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bk-accent);
    color: var(--bk-text);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.bk-panel-locked .bk-step-num {
    background: var(--bk-border);
    color: var(--bk-text-muted);
}

.bk-panel-locked .bk-panel-head h2 {
    color: var(--bk-text-muted);
}

.bk-panel-locked .bk-panel-body {
    opacity: 0.55;
    pointer-events: none;
}

.bk-panel-body {
    padding: 20px;
}

.bk-hidden {
    display: none;
}

.bk-back-link {
    background: none;
    border: none;
    color: var(--bk-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.bk-back-link:hover {
    color: var(--bk-text);
}

/* ── Step 1: appointment type ─────────────────────────────────────── */

.bk-type-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bk-type-option {
    display: flex;
    align-items: stretch;
    gap: 14px;
    text-align: left;
    padding: 14px;
    border: 1px solid var(--bk-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
}

/* The colour lives on a bar INSIDE the card, not the card's own border —
   easier to read, and the card keeps an even outline on all four sides. */
/* Always occupies its 4px so every card's text lines up; with no colour set
   it just renders transparent rather than collapsing the indent. */
.bk-type-bar {
    width: 4px;
    border-radius: 999px;
    flex-shrink: 0;
    align-self: stretch;
    background: transparent;
}

.bk-type-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.bk-type-option:hover {
    border-color: var(--bk-accent);
    background: var(--bk-accent-soft);
}

.bk-type-option strong {
    font-size: 15px;
}

.bk-type-option em {
    font-style: normal;
    color: var(--bk-text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.bk-type-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bk-text-muted);
    font-size: 13px;
}

.bk-meta-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Step 2: date ─────────────────────────────────────────────────── */

.bk-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
    background: var(--bk-bg);
    border-radius: 8px;
    padding: 8px 12px;
}

.bk-btn-plain {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--bk-text-muted);
    padding: 0 6px;
}

.bk-btn-plain:hover {
    color: var(--bk-text);
}

.bk-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.bk-cal-dow {
    text-align: center;
    font-size: 12px;
    color: var(--bk-text-muted);
    padding: 4px 0;
}

.bk-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    cursor: default;
}

.bk-cal-empty {
    visibility: hidden;
}

.bk-cal-unavailable {
    color: var(--bk-text-muted);
    background: var(--bk-bg);
    opacity: 0.6;
}

.bk-cal-available {
    background: var(--bk-accent-soft);
    border-color: var(--bk-accent-border);
    color: var(--bk-text);
    cursor: pointer;
    font-weight: 600;
}

.bk-cal-available:hover {
    background: var(--bk-accent);
    color: var(--bk-text);
}

.bk-cal-selected {
    background: var(--bk-accent);
    border-color: var(--bk-accent);
    color: var(--bk-text);
    font-weight: 700;
}

.bk-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--bk-text-muted);
}

.bk-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bk-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid var(--bk-border);
}

.bk-swatch-available {
    background: var(--bk-accent-soft);
    border-color: var(--bk-accent-border);
}

.bk-swatch-unavailable {
    background: var(--bk-bg);
}

.bk-swatch-selected {
    background: var(--bk-accent);
    border-color: var(--bk-accent);
}

/* ── Step 3: time ─────────────────────────────────────────────────── */

/* Centred date pill above the slot grid, so the chosen day stays visible
   while scanning times. */
.bk-selected-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 14px;
    background: var(--bk-bg);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.bk-selected-date svg {
    width: 16px;
    height: 16px;
    color: var(--bk-accent);
    flex-shrink: 0;
}

.bk-time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.bk-time-slot {
    padding: 10px;
    border: 1px solid var(--bk-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.bk-time-slot:hover {
    border-color: var(--bk-accent);
    background: var(--bk-accent-soft);
}

.bk-time-slot-selected {
    background: var(--bk-accent);
    border-color: var(--bk-accent);
    font-weight: 600;
}

/* ── Right panel: contact form ────────────────────────────────────── */

/* Accent-bordered recap, sits between the fields and the submit button. */
.bk-summary {
    background: var(--bk-accent-soft);
    border: 1px solid var(--bk-accent);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    margin: 0 0 16px;
}

.bk-summary h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bk-accent-ink);
}

.bk-summary dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 0;
}

.bk-summary dt {
    font-size: 13px;
    font-weight: 600;
    color: var(--bk-accent-ink);
}

/* Colon in CSS, so the row data stays plain labels. */
.bk-summary dt::after {
    content: ':';
}

.bk-summary dd {
    margin: 0;
    font-size: 13px;
    color: var(--bk-text);
}

.bk-field {
    margin-bottom: 14px;
}

.bk-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.bk-req {
    color: var(--bk-danger);
}

.bk-field input,
.bk-field textarea,
.bk-field select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--bk-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bk-surface);
    color: inherit;
}

.bk-field select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.bk-field input:focus,
.bk-field textarea:focus,
.bk-field select:focus {
    outline: none;
    border-color: var(--bk-accent);
}

.bk-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bk-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    font-size: 14px;
    margin: 0;
    cursor: pointer;
}

.bk-radio input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--bk-accent);
}

.bk-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    /* 52px: clears the 44px minimum touch target and keeps the primary
       action visually distinct from the 37px inputs above it. */
    min-height: 52px;
    padding: 14px 20px;
    border-radius: 6px;
    border: none;
    background: var(--bk-accent);
    color: var(--bk-text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.bk-btn-primary:disabled {
    background: color-mix(in srgb, var(--bk-accent) 35%, var(--bk-surface));
    color: color-mix(in srgb, var(--bk-text) 60%, transparent);
    box-shadow: none;
    cursor: not-allowed;
}

.bk-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bk-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 12px;
}

.bk-alert-error {
    background: var(--bk-danger-tint);
    color: var(--bk-danger);
}

/* ── Success ──────────────────────────────────────────────────────── */

.bk-success {
    max-width: 480px;
    margin: 0 auto;
    padding: 36px 28px;
    text-align: center;
}

.bk-success-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--bk-accent-soft);
    color: var(--bk-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bk-success h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.bk-success p {
    margin: 0;
    color: var(--bk-text-muted);
    font-size: 15px;
}

@media (max-width: 760px) {
    .bk-layout {
        grid-template-columns: minmax(0, 1fr);
        max-width: 440px;
    }
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 560px) {
    /* Reclaim horizontal space so the 7 calendar columns clear the 44px
       touch-target minimum — a mis-tap here books the wrong DAY. */
    .bk-wrap {
        padding: 16px;
    }

    .bk-panel-body {
        padding: 14px;
    }

    .bk-panel-head {
        padding: 14px;
    }

    .bk-calendar-grid {
        gap: 3px;
    }

    .site-schedule-intro {
        padding: 32px 16px 0;
    }

    .site-schedule-intro h1 {
        font-size: 26px;
    }

    .bk-legend {
        gap: 10px;
    }

    /* Two slot columns get cramped under ~360px. */
    .bk-time-slots {
        gap: 6px;
    }

    /* Same reasoning as the calendar cells: a mis-tap books the wrong TIME. */
    .bk-time-slot {
        min-height: 44px;
    }

    .bk-type-option {
        padding: 12px;
    }
}

/* Utility classes: the CSP forbids inline style attributes, so one-off layout hints live here. */
.u-cell { padding: 8px 4px; }
.u-cell--actions { padding: 8px 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.u-w-auto { width: auto; }
.u-w-full { width: 100%; }
.u-check { display: flex; align-items: center; gap: 6px; font-weight: normal; }
.u-check--tight { margin-bottom: 0; }
.u-offscreen { position: absolute; left: -9999px; }
.u-inline { display: inline; }
.u-fw-normal { font-weight: normal; }
.u-th { text-align: left; border-bottom: 1px solid var(--rq-border); }
.u-row { border-bottom: 1px solid var(--rq-border); }
.u-btn-xs { padding: 2px 8px; font-size: 13px; }
.u-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.u-table--mb { margin-bottom: 16px; }
.u-fs-13 { font-size: 13px; }
.u-fs-95 { font-size: 0.95rem; }
.u-mono { font-family: monospace; }
.u-mt-10 { margin-top: 10px; }
.u-mt-18 { margin-top: 18px; }
.u-mb-16 { margin-bottom: 16px; }
.u-mb-0 { margin-bottom: 0; }
.u-pull-up { margin: -6px 0 14px; }
.u-muted-14 { font-size: 14px; color: var(--rq-text-muted); }
.u-flex-between { display: flex; justify-content: space-between; align-items: center; }
.u-flex-6 { display: flex; gap: 6px; align-items: center; }
.u-inline-block-center { display: inline-block; text-align: center; text-decoration: none; }
.u-inline-block-mt { display: inline-block; margin-top: 12px; }

/* Name and email read as one line of who-you-are, so they share a row and stack
   again where that would squeeze them. */
.bk-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

@media (max-width: 540px) {
    .bk-field-row { grid-template-columns: 1fr; }
}
