/* ================================================================
   BOOKING WIDGET - self-contained styles
   Everything ~/Controls/BookingWidget.ascx and booking.js draw, plus the
   WeeklyTimetable overview. Needs no site stylesheet, so any client site
   can use it. Re-brand with the custom properties below (the Booking
   master page sets --bk-accent from web.config "BookingAccentColour").
   Defaults sit in :where(:root) (zero specificity), so a site or the
   master page can override them in any order.
   ================================================================ */

:where(:root) {
    --bk-accent: #1f6feb; /* buttons, selected day, links */
    --bk-accent-ink: #ffffff; /* text on the accent colour */
    --bk-ink: #1d2433; /* main text */
    --bk-muted: #5f6b7a; /* secondary text */
    --bk-line: #dfe3ea; /* borders */
    --bk-surface: #ffffff; /* panels */
    --bk-soft: #f3f5f8; /* subtle fills */
    --bk-ok: #1f9d55;
    --bk-warn: #e8a317;
    --bk-bad: #d93025;
    --bk-radius: 12px;
    --bk-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hidden {
    display: none !important;
}

.reveal { /* hook for site animations - no effect on its own */
}

/* ---------- Panels, text ---------- */
.panel {
    background: var(--bk-surface);
    border: 1px solid var(--bk-line);
    border-radius: var(--bk-radius);
    padding: 24px;
    color: var(--bk-ink);
    font-family: var(--bk-font);
}

    .panel h2, .panel h3, .panel h4 {
        margin: 0;
        color: var(--bk-ink);
        line-height: 1.25;
    }

    .panel h2 {
        font-size: 20px;
    }

    .panel h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .panel h4 {
        font-size: 16px;
    }

.eyebrow {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bk-accent);
}

.field-note {
    margin: 0;
    font-size: 13px;
    color: var(--bk-muted);
}

/* ---------- Notices ---------- */
.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bk-soft);
    border: 1px solid var(--bk-line);
    font-size: 14px;
    line-height: 1.45;
    color: var(--bk-ink);
}

    .notice.warn {
        background: rgba(232, 163, 23, 0.10);
        border-color: rgba(232, 163, 23, 0.45);
    }

.notice-icon {
    flex: 0 0 auto;
    margin-top: 3px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    border: 2px solid var(--bk-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--bk-accent);
    font: 700 15px/1.2 var(--bk-font);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s, opacity .15s;
}

    .btn:hover {
        background: var(--bk-soft);
    }

    .btn:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

.btn-primary {
    background: var(--bk-accent);
    color: var(--bk-accent-ink);
}

    .btn-primary:hover {
        background: var(--bk-accent);
        opacity: .9;
    }

.btn-outline {
    background: transparent;
    color: var(--bk-accent);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-block {
    display: flex;
    width: 100%;
    margin-top: 16px;
}

/* ---------- Calendar + results layout ---------- */
.timetable-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .timetable-layout {
        grid-template-columns: 1fr;
    }
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cal-head-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--bk-accent);
}

    .cal-head-label svg {
        width: 22px;
        height: 22px;
    }

.cal-nav {
    display: flex;
    gap: 8px;
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bk-line);
    border-radius: 50%;
    background: var(--bk-surface);
    color: var(--bk-ink);
    cursor: pointer;
}

    .cal-nav-btn svg {
        width: 16px;
        height: 16px;
    }

    .cal-nav-btn:hover:not(:disabled) {
        border-color: var(--bk-accent);
        color: var(--bk-accent);
    }

    .cal-nav-btn:disabled {
        opacity: .35;
        cursor: default;
    }

.cal-weekdays, .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.cal-weekdays {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    color: var(--bk-muted);
}

.cal-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(31, 157, 85, 0.45);
    border-radius: 10px;
    background: rgba(31, 157, 85, 0.10);
    color: var(--bk-ink);
    font: 700 15px var(--bk-font);
    cursor: pointer;
    transition: transform .1s, background .15s;
}

    .cal-day:hover {
        transform: translateY(-1px);
        background: rgba(31, 157, 85, 0.18);
    }

    .cal-day.disabled {
        background: var(--bk-soft);
        border-color: transparent;
        color: #b3bac5;
        cursor: default;
        transform: none;
    }

    .cal-day.full {
        background: rgba(232, 163, 23, 0.12);
        border-color: rgba(232, 163, 23, 0.5);
    }

    .cal-day.selected {
        background: var(--bk-accent);
        border-color: var(--bk-accent);
        color: var(--bk-accent-ink);
    }

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--bk-muted);
}

.swatch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

    .dot.closed {
        background: var(--bk-soft);
        border: 1px solid var(--bk-line);
    }

    .dot.ok {
        background: rgba(31, 157, 85, 0.35);
    }

    .dot.full {
        background: rgba(232, 163, 23, 0.45);
    }

    .dot.sel {
        background: var(--bk-accent);
    }

/* ---------- Results ---------- */
.cal-prompt {
    text-align: center;
    padding: 40px 24px;
}

    .cal-prompt p {
        margin: 6px 0 0;
        color: var(--bk-muted);
    }

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

    .cal-prompt-icon svg {
        width: 24px;
        height: 24px;
    }

.slot-grid {
    display: grid;
    gap: 12px;
}

.slot-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--bk-line);
    border-left: 4px solid var(--bk-accent);
    border-radius: 10px;
    background: var(--bk-surface);
}

    .slot-card.is-full {
        border-left-color: var(--bk-warn);
    }

    .slot-card h4 {
        margin-bottom: 6px;
    }

.slot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--bk-muted);
}

    .slot-meta span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

/* ---------- Booking form ---------- */
.form-block {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid var(--bk-line);
    border-radius: 10px;
    background: var(--bk-soft);
}

.form-block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--bk-ink);
}

    .form-block-title svg {
        width: 20px;
        height: 20px;
        color: var(--bk-accent);
    }

.field {
    margin-bottom: 14px;
}

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

    .field input,
    .field select,
    .field textarea {
        width: 100%;
        box-sizing: border-box;
        padding: 11px 12px;
        border: 1px solid var(--bk-line);
        border-radius: 8px;
        background: var(--bk-surface);
        color: var(--bk-ink);
        font: 15px var(--bk-font);
    }

        .field input:focus,
        .field select:focus,
        .field textarea:focus {
            outline: none;
            border-color: var(--bk-accent);
            box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
        }

    .field.readonly input {
        background: var(--bk-soft);
        font-weight: 600;
    }

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

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

.field-error {
    padding: 10px 12px;
    border: 1px solid rgba(217, 48, 37, 0.4);
    border-radius: 8px;
    background: rgba(217, 48, 37, 0.08);
    color: #a3221a;
    font-size: 14px;
}

.field-success {
    padding: 10px 12px;
    border: 1px solid #a6e9c5;
    border-radius: 8px;
    background: #ecfdf3;
    color: #0a5c36;
    font-size: 14px;
}

/* Dependant cards (added by booking.js) */
.child-card {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--bk-line);
    border-radius: 10px;
    background: var(--bk-surface);
}

.child-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 700;
}

    .child-card-title svg {
        width: 18px;
        height: 18px;
        color: var(--bk-accent);
    }

.child-card-remove {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--bk-soft);
    color: var(--bk-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

    .child-card-remove:hover {
        color: var(--bk-bad);
    }

/* ---------- "Who is coming?" ---------- */
.who-block {
    border: 1px solid var(--bk-line);
    margin: 20px 0;
}

.who-legend {
    padding: 0 6px;
    font-weight: 700;
    font-size: 16px;
    color: var(--bk-ink);
}

.who-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 6px;
}

@media (max-width: 700px) {
    .who-options {
        grid-template-columns: 1fr;
    }
}

.who-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--bk-line);
    border-radius: 10px;
    background: var(--bk-surface);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

    .who-option:hover {
        border-color: var(--bk-accent);
    }

    .who-option input[type="radio"] {
        flex: 0 0 auto;
        width: 22px;
        height: 22px;
        margin: 1px 0 0;
        accent-color: var(--bk-accent);
        cursor: pointer;
    }

    .who-option:has(input:checked) {
        border-color: var(--bk-accent);
        background: rgba(31, 111, 235, 0.06);
    }

    .who-option:has(input:focus-visible) {
        box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25);
    }

.who-option-text strong {
    display: block;
    font-size: 16px;
    line-height: 1.3;
    color: var(--bk-ink);
}

.who-option-text small {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--bk-muted);
}

/* A lone child card can't be removed - change the answer above instead. */
.child-card:only-child .child-card-remove {
    display: none;
}

/* ---------- Non-member confirmation ---------- */
.confirm-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 6px 0 4px;
    padding: 14px 16px;
    border: 2px solid var(--bk-warn);
    border-radius: 10px;
    background: rgba(232, 163, 23, 0.10);
    font-size: 15px;
    font-weight: 600;
    color: var(--bk-ink);
    cursor: pointer;
}

    .confirm-box input[type="checkbox"] {
        flex: 0 0 auto;
        width: 22px;
        height: 22px;
        margin: 1px 0 0;
        accent-color: var(--bk-ok);
        cursor: pointer;
    }

    .confirm-box:has(input:checked) {
        border-color: var(--bk-ok);
        background: rgba(31, 157, 85, 0.10);
    }

/* ---------- Confirmation ---------- */
.booking-confirm {
    text-align: center;
}

.booking-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bk-ok);
    color: #fff;
}

    .booking-confirm-icon svg {
        width: 28px;
        height: 28px;
    }

/* ---------- Enquiry modals ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 15, 20, 0.55);
}

    .modal-overlay.hidden {
        display: none;
    }

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    border-radius: var(--bk-radius);
    background: var(--bk-surface);
    color: var(--bk-ink);
    font-family: var(--bk-font);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--bk-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

    .modal-close:hover {
        color: var(--bk-ink);
    }

/* ---------- Weekly overview (~/Controls/WeeklyTimetable.ascx) ---------- */
.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.week-day {
    padding: 14px;
    border: 1px solid var(--bk-line);
    border-radius: 10px;
}

    .week-day h4 {
        margin: 0 0 10px;
        font-size: 14px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--bk-accent);
    }

.week-lesson {
    padding: 8px 0;
    border-top: 1px solid var(--bk-line);
}

    .week-lesson:first-of-type {
        border-top: none;
        padding-top: 0;
    }

.week-lesson-time {
    font-size: 13px;
    font-weight: 700;
}

.week-lesson-name {
    font-size: 14px;
    font-weight: 700;
}

.week-lesson-tag {
    margin-top: 2px;
    font-size: 12px;
    color: var(--bk-muted);
}

.week-lesson-book {
    margin-top: 8px;
    display: inline-flex;
}
