/* ==========================================================================
   Tansi Booking Pages — public /book/{Token} and /book/cancel/{Token}
   --------------------------------------------------------------------------
   A two-column "promo + booking card" page in the tansi.app voice:
   the left column tells the visitor who Tansi is, the right column is the
   scheduler. Everything is scoped under .booking-shell.

   These pages render under EmptyLayout, whose bare <MudThemeProvider /> emits
   MudBlazor's DEFAULT palette (purple primary). The scope below re-points the
   Mud palette vars the picker/buttons read at the Tansi brand tokens from
   app.css (:root --primary etc.), so this page matches the app without
   touching the other public pages.

   Motion follows the apple-design house rules: feedback on pointer-down,
   critically-damped curves (no overshoot on things that just appeared),
   transform/opacity only, and every animation has a reduced-motion twin.
   ========================================================================== */

.booking-shell {
    --mud-palette-primary: var(--primary);
    --mud-palette-primary-darken: var(--primary-hover);
    --mud-palette-primary-lighten: var(--primary-soft);
    --mud-palette-primary-text: var(--on-primary);
    --mud-palette-primary-hover: color-mix(in srgb, var(--primary) 8%, transparent);

    --bk-ink: #0f172a;
    --bk-ink-2: #334155;
    --bk-ink-3: #64748b;
    --bk-line: rgba(15, 23, 42, 0.08);
    --bk-canvas: #f6f9fb;
    --bk-card: #ffffff;
    --bk-tile: #ffffff;
    --bk-radius: 22px;
    --bk-radius-sm: 12px;

    /* critically damped — settles without overshoot */
    --bk-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --bk-fast: 160ms;
    --bk-move: 320ms;

    min-height: 100vh;
    color: var(--bk-ink);
    background:
        radial-gradient(900px 520px at 8% -6%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
        radial-gradient(700px 480px at 100% 100%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 70%),
        var(--bk-canvas);
    font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Header bar — translucent material, content scrolls beneath it
   -------------------------------------------------------------------------- */
.booking-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 0 var(--bk-line);
}

.booking-top__logo {
    display: block;
    height: 30px;
    width: auto;
}

.booking-top__links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.booking-top__link,
.booking-top__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    text-decoration: none;
    transition: transform var(--bk-fast) var(--bk-ease), background-color var(--bk-fast) var(--bk-ease);
}

.booking-top__link { color: var(--bk-ink-2); }
.booking-top__link:hover { background: rgba(15, 23, 42, 0.05); color: var(--bk-ink); }

.booking-top__cta {
    color: var(--on-primary);
    background: var(--primary);
}
.booking-top__cta:hover { background: var(--primary-hover); }
.booking-top__link:active,
.booking-top__cta:active { transform: scale(0.97); }

/* Language switcher — a row of small POST-form buttons reusing .booking-top__link's look. */
.booking-lang { display: flex; align-items: center; gap: 0; }
.booking-lang__form { display: contents; }
.booking-lang__btn {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}
.booking-lang__btn[aria-current="true"] { color: var(--primary); font-weight: 700; }

/* --------------------------------------------------------------------------
   Two-column stage
   -------------------------------------------------------------------------- */
.booking-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) clamp(48px, 7vw, 96px);
}

/* --------------------------------------------------------------------------
   Promo column (BookingPromoPanel) — the "who is Tansi" side
   -------------------------------------------------------------------------- */
.booking-promo {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 560px;
}

.booking-promo__eyebrow {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-ink);
}

.booking-promo__title {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.025em;   /* display tracking tightens as it grows */
    color: var(--bk-ink);
    text-wrap: balance;
}

.booking-promo__lead {
    margin: 16px 0 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    letter-spacing: 0;
    color: var(--bk-ink-2);
    text-wrap: pretty;
}

.booking-promo__tagline {
    margin: 14px 0 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bk-ink-3);
}

/* Module tiles — an honest product visual (no fake screenshot) */
.booking-modules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.booking-module {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--bk-radius-sm);
    background: var(--bk-tile);
    border: 1px solid var(--bk-line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bk-ink-2);
}

.booking-module__icon {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--primary-ink);
    background: var(--primary-soft);
}

.booking-module__icon .mud-icon-root { font-size: 20px; width: 20px; height: 20px; }

.booking-promo__h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--bk-ink);
}

.booking-expect {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.booking-expect__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.9875rem;
    line-height: 1.5;
    color: var(--bk-ink-2);
}

.booking-expect__item strong { color: var(--bk-ink); font-weight: 600; }

.booking-expect__check {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--teal-ink);
    background: var(--teal-soft);
    margin-top: 1px;
}
.booking-expect__check .mud-icon-root { font-size: 16px; width: 16px; height: 16px; }

.booking-promo__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding-top: 6px;
    font-size: 0.875rem;
    color: var(--bk-ink-3);
}

.booking-promo__foot a {
    color: var(--primary-ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--bk-fast) var(--bk-ease);
}
.booking-promo__foot a:hover { border-bottom-color: currentColor; }

/* --------------------------------------------------------------------------
   Booking card
   -------------------------------------------------------------------------- */
.booking-card {
    position: relative;
    border-radius: var(--bk-radius);
    background: var(--bk-card);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 40px rgba(15, 23, 42, 0.10),
        0 40px 80px -30px color-mix(in srgb, var(--primary) 30%, transparent);
    overflow: hidden;
}

.booking-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px 0;
}

.booking-card__back {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--bk-ink-2);
    cursor: pointer;
    transition: background-color var(--bk-fast) var(--bk-ease), transform var(--bk-fast) var(--bk-ease), opacity var(--bk-move) var(--bk-ease);
}
.booking-card__back:hover { background: rgba(15, 23, 42, 0.06); }
.booking-card__back:active { transform: scale(0.94); }
.booking-card__back[disabled] { opacity: 0; pointer-events: none; }
.booking-card__back:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Progress rail — a fill that eases to the current step (no overshoot) */
.booking-progress {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.booking-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--brand));
    transform-origin: left center;
    transform: scaleX(var(--bk-progress, 0.25));
    transition: transform var(--bk-move) var(--bk-ease);
}

.booking-card__body { padding: 20px 24px 24px; }

.booking-card__title {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--bk-ink);
}

.booking-card__sub {
    margin: 8px 0 0;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--bk-ink-2);
}

/* Scheduler — meta rail + calendar/slots panel, like the example's inner card */
.booking-card { container-type: inline-size; }

.booking-scheduler {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    margin-top: 20px;
    border: 1px solid var(--bk-line);
    border-radius: 16px;
    overflow: hidden;
}

.booking-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px;
    border-right: 1px solid var(--bk-line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), transparent);
}

.booking-host {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--bk-ink);
    letter-spacing: -0.005em;
}

.booking-host__avatar {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--on-primary);
    background: linear-gradient(135deg, var(--primary), var(--brand));
}

.booking-host__name { min-width: 0; overflow-wrap: anywhere; }

.booking-meta__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--bk-ink-2);
}
.booking-meta__row .mud-icon-root { font-size: 18px; width: 18px; height: 18px; color: var(--bk-ink-3); }
.booking-meta__row--muted { color: var(--bk-ink-3); font-size: 0.85rem; }

.booking-panel { padding: 14px 16px 18px; min-width: 0; }

/* MudButton inside the scope: DM Sans sentence case, app radius — EmptyLayout's bare
   theme provider would otherwise give Roboto-style UPPERCASE buttons. */
.booking-shell .mud-button-root {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    border-radius: 10px;
}
.booking-shell .mud-button-root:active { transform: scale(0.97); }
.booking-shell .mud-button-filled { box-shadow: none; }

/* MudDatePicker (static) — toolbar off (ShowToolbar=false), centred, brand primary */
.booking-panel .mud-picker,
.booking-panel .mud-picker-container,
.booking-panel .mud-picker-content,
.booking-panel .mud-picker-calendar-container,
.booking-panel .mud-picker-calendar-transition { box-shadow: none; border: 0; outline: 0; background: transparent; min-width: 0; }
.booking-panel .mud-picker-container { padding: 0; }
.booking-panel .mud-picker-calendar-container,
.booking-panel .mud-picker-calendar-content,
.booking-panel .mud-picker-month-container { width: 100%; max-width: 340px; margin: 0 auto; }
/* Mud absolutely-positions the month inside a fixed 216px box, so a 6-row month
   would spill over the slot list below. Flow it normally instead. */
.booking-panel .mud-picker-content { min-width: 0; min-height: 0; overflow: visible; }
.booking-panel .mud-picker-calendar-transition { min-height: 0; }
/* Mud always renders six weeks; the trailing placeholder days (those after the last real
   day) leave a ghost row, so drop them. Leading placeholders stay to keep the grid aligned. */
.booking-panel .mud-picker-calendar-day.mud-hidden { visibility: hidden; }
.booking-panel .mud-picker-calendar-day:not(.mud-hidden) ~ .mud-picker-calendar-day.mud-hidden { display: none; }
.booking-panel .mud-picker-slide-transition > * { position: static; }
.booking-panel .mud-picker-calendar-week { justify-content: space-around; }
.booking-panel .mud-picker-calendar .mud-day.mud-disabled { background: transparent; color: var(--mud-palette-text-disabled); }
.booking-panel .mud-picker-calendar-header { padding: 0 4px; }
.booking-panel .mud-picker-calendar .mud-day {
    border-radius: 10px;
    transition: transform var(--bk-fast) var(--bk-ease), background-color var(--bk-fast) var(--bk-ease);
}
.booking-panel .mud-picker-calendar .mud-day:not(.mud-disabled):not(.mud-selected) {
    background: rgba(15, 23, 42, 0.045);
    color: var(--bk-ink);
    font-weight: 600;
}
.booking-panel .mud-picker-calendar .mud-day:not(.mud-disabled):active { transform: scale(0.94); }
.booking-panel .mud-picker-calendar .mud-day.mud-selected { font-weight: 700; }

.booking-day {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--bk-line);
    font-size: 1rem;
    color: var(--bk-ink);
}
.booking-day strong { font-weight: 700; }
.booking-day__count { font-size: 0.8125rem; color: var(--bk-ink-3); }

/* Slot chips — native buttons so pointer-down feedback is instant */
.booking-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.booking-slot {
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #fff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    color: var(--bk-ink);
    cursor: pointer;
    transition:
        transform var(--bk-fast) var(--bk-ease),
        border-color var(--bk-fast) var(--bk-ease),
        background-color var(--bk-fast) var(--bk-ease),
        box-shadow var(--bk-fast) var(--bk-ease);
}
.booking-slot:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-ink);
}
.booking-slot:active { transform: scale(0.96); }
.booking-slot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.booking-empty { color: var(--bk-ink-3); font-size: 0.9375rem; padding: 8px 0; }
.booking-tz { margin-top: 12px; font-size: 0.8125rem; color: var(--bk-ink-3); }

/* Details / verify / booked steps */
.booking-step { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.booking-step__when {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-ink);
    font-weight: 700;
    font-size: 0.9375rem;
}
.booking-step__when .mud-icon-root { font-size: 18px; width: 18px; height: 18px; }
.booking-step__h { margin: 0; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; color: var(--bk-ink); }
.booking-step__p { margin: 0; color: var(--bk-ink-2); line-height: 1.55; }
.booking-step__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.booking-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 24px 8px 8px;
}
.booking-done__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    margin-bottom: 6px;
}
.booking-done__icon .mud-icon-root { font-size: 34px; width: 34px; height: 34px; }
.booking-done__icon--ok    { color: var(--success-ink); background: var(--success-soft); }
.booking-done__icon--warn  { color: var(--warn-ink);    background: var(--warn-soft); }
.booking-done__icon--err   { color: var(--danger-ink);  background: var(--danger-soft); }
.booking-done__h { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.booking-done__p { margin: 0; color: var(--bk-ink-2); line-height: 1.55; max-width: 36ch; }

/* Step entrance: a short fade + rise from where the previous step sat.
   Only opacity/transform, only on the step that just appeared. */
.booking-enter { animation: booking-enter var(--bk-move) var(--bk-ease) both; }
@keyframes booking-enter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Responsive — card first on phones, promo below it
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .booking-stage { grid-template-columns: minmax(0, 1fr); }
    .booking-card { order: -1; }
    .booking-promo { max-width: none; }
}

/* Stack the meta rail above the calendar whenever the CARD (not the viewport) is
   too narrow for MudBlazor's 310px calendar beside it. */
@container (max-width: 540px) {
    .booking-scheduler { grid-template-columns: minmax(0, 1fr); }
    .booking-meta { border-right: 0; border-bottom: 1px solid var(--bk-line); }
}

@media (max-width: 640px) {
    .booking-scheduler { grid-template-columns: minmax(0, 1fr); }
    .booking-meta { border-right: 0; border-bottom: 1px solid var(--bk-line); }
    .booking-card__head { padding: 16px 16px 0; }
    .booking-card__body { padding: 16px; }
    .booking-modules { grid-template-columns: minmax(0, 1fr); }
    .booking-top__link--secondary { display: none; }
}

/* --------------------------------------------------------------------------
   Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .booking-enter { animation: booking-fade 180ms ease both; }
    @keyframes booking-fade { from { opacity: 0; } to { opacity: 1; } }
    .booking-progress__fill { transition: none; }
    .booking-slot:active,
    .booking-card__back:active,
    .booking-top__link:active,
    .booking-top__cta:active,
    .booking-panel .mud-picker-calendar .mud-day:not(.mud-disabled):active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
    .booking-top { background: #ffffff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
    .booking-card, .booking-module, .booking-slot { border-color: rgba(15, 23, 42, 0.5); }
}

/* 2026-09-06: lead-style details row + reschedule banner */
.booking-step__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@container (max-width: 540px) { .booking-step__row { grid-template-columns: 1fr; } }
.booking-reschedule {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px;
  padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.4;
  background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
  color: var(--mud-palette-text-primary);
  border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 30%, transparent);
}
.booking-reschedule .mud-icon-root { flex: 0 0 auto; color: var(--mud-palette-primary); font-size: 1.25rem; margin-top: 1px; }
