/* ============================================================
   features/booking/booking.css — the booking widget (redesign · P6)
   ------------------------------------------------------------
   Visual reskin only — the markup hooks (ids, data-*, the classes the
   JS toggles: .booking-step/.hidden, .booking-progress-dot.done/.current,
   .booking-goal.active, .booking-tier.recommended/.active, .booking-cal-day
   .open/.selected, .booking-slot.selected) are unchanged.

   Token-only: no raw hex / ad-hoc shadows / magic radii. Squircle goal
   cards, selectable duration tiers, a branded calendar (coral dot on open
   days), slot chips, a sticky summary bar, and a celebratory confirmation.
   All motion gated behind prefers-reduced-motion.
   ============================================================ */

.booking-widget {
    max-width: 920px;
    margin: 0 auto;
}

.booking-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
}

.booking-pick-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: var(--space-9);
    align-items: start;
}

.booking-field-label {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-3);
    text-align: left;
}

/* ---- progress dots — short, contained, the brand dot device --------- */
.booking-progress {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0 0 var(--space-8);
    padding: 0;
}

.booking-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--coral-200);
    transition: width var(--dur-base) var(--ease-dreamy),
                background-color var(--dur-base) var(--ease-soft);
}

.booking-progress-dot.done {
    background: var(--accent);
}

.booking-progress-dot.current {
    width: 28px;
    background: var(--accent-strong);
}

/* ---- step heading — one decision per screen ------------------------- */
.booking-step-title {
    font-family: var(--font-display);
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--text);
    text-align: left;
    margin-bottom: var(--space-2);
}

.booking-step-hint {
    font-size: var(--fs-small);
    color: var(--text-muted);
    text-align: left;
    margin-bottom: var(--space-7);
}

/* Each step fades + lifts in as it becomes the active panel. Display is
   toggled by .hidden, so removing it replays this animation. */
.booking-step:not(.hidden) {
    animation: bookingStepIn var(--dur-slow) var(--ease-dreamy) both;
}

@keyframes bookingStepIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ---- step 1: goal cards (squircles) --------------------------------- */
.booking-goals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.booking-goal {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-height: 112px;
    padding: var(--space-6);
    border-radius: var(--radius-organic);
    border: 2px solid var(--coral-200);
    background: var(--surface);
    color: var(--text);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--dur-base) var(--ease-soft),
                box-shadow var(--dur-base) var(--ease-dreamy),
                transform var(--dur-base) var(--ease-dreamy);
}

.booking-goal:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.booking-goal:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.booking-goal.active {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 2px var(--accent-strong) inset;
}

.booking-goal-title {
    font-size: var(--fs-lead);
    font-weight: 700;
}

.booking-goal-sub {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

/* ---- step 2: duration tiers (price + outcome live on the cards) ----- */
.booking-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    align-items: stretch;
    margin-bottom: var(--space-5);
}

.booking-tier {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
    border: 2px solid var(--coral-200);
    background: var(--surface);
    color: var(--text-muted);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--dur-base) var(--ease-soft),
                box-shadow var(--dur-base) var(--ease-dreamy),
                transform var(--dur-base) var(--ease-dreamy);
}

.booking-tier:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.booking-tier:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

/* Recommended: visually dominant, so the eye lands here first. */
.booking-tier.recommended {
    padding: var(--space-7) var(--space-6);
    border-color: var(--accent-strong);
    box-shadow: var(--shadow-glow);
    color: var(--text);
}

/* Selected: a clear inset ring, distinct from the recommended emphasis. */
.booking-tier.active {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 2px var(--accent-strong) inset;
    color: var(--text);
}

.booking-tier-tag {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: lowercase;
    color: var(--text-on-coral);
    background: var(--grad-coral);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
}

.booking-tier-dur {
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--text);
}

.booking-tier-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.booking-tier-rate {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.booking-tier-total {
    font-size: var(--fs-lead);
    font-weight: 700;
    color: var(--text);
}

/* Savings: one of the few places the accent is spent. */
.booking-tier-save {
    font-size: var(--fs-small);
    font-weight: 700;
    color: var(--accent-strong);
}

.booking-tier-outcome {
    font-size: var(--fs-small);
    line-height: var(--lh-snug);
    color: var(--text-muted);
}

.booking-tier-note {
    font-size: var(--fs-small);
    line-height: var(--lh-body);
    color: var(--text-muted);
    text-align: left;
    margin-bottom: var(--space-6);
}

.booking-continue {
    margin-top: var(--space-1);
}

/* ---- step 3: calendar ----------------------------------------------- */
.booking-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.booking-cal-title {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--text);
    text-transform: capitalize;
}

.booking-cal-nav {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--coral-200);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--dur-base) var(--ease-soft),
                color var(--dur-base) var(--ease-soft),
                background-color var(--dur-base) var(--ease-soft);
}

.booking-cal-nav:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent-strong);
    background: var(--coral-50);
}

.booking-cal-nav:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.booking-cal-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.booking-cal-weekdays,
.booking-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-1);
}

.booking-cal-weekdays span {
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-2) 0;
    text-transform: uppercase;
}

.booking-cal-day {
    position: relative;
    aspect-ratio: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text);
    font-size: var(--fs-small);
    font-family: inherit;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-soft),
                color var(--dur-fast) var(--ease-soft);
}

/* Open days read as available — a soft wash plus the coral dot marker. */
.booking-cal-day.open {
    background: var(--tint-soft);
    font-weight: 600;
}

.booking-cal-day.open::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: var(--accent);
}

.booking-cal-day.open:hover {
    background: var(--tint-20);
}

.booking-cal-day.selected {
    background: var(--grad-coral);
    color: var(--text-on-coral);
}

.booking-cal-day.selected::after {
    background: var(--text-on-coral);
}

.booking-cal-day:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.booking-cal-day:disabled {
    color: var(--text-muted);
    opacity: 0.4;
    cursor: default;
    background: transparent;
}

.booking-tz-note {
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    letter-spacing: var(--tracking-label);
    color: var(--text-muted);
    text-align: left;
    margin-top: var(--space-4);
}

/* ---- step 3: slot list ---------------------------------------------- */
.booking-slots-hint {
    font-size: var(--fs-small);
    color: var(--text-muted);
    text-align: left;
}

.booking-slot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: var(--space-3);
    max-height: 420px;
    overflow-y: auto;
    padding-right: var(--space-1);
}

.booking-slot {
    min-height: 44px;
    padding: var(--space-3) 0;
    border-radius: var(--radius-md);
    border: 2px solid var(--coral-200);
    background: var(--surface);
    color: var(--text);
    font-size: var(--fs-small);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-soft),
                background-color var(--dur-fast) var(--ease-soft),
                transform var(--dur-fast) var(--ease-dreamy);
}

.booking-slot:hover {
    border-color: var(--accent);
    background: var(--coral-50);
    transform: translateY(-1px);
}

.booking-slot:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.booking-slot.selected {
    border-color: var(--accent-strong);
    background: var(--grad-coral);
    color: var(--text-on-coral);
}

/* ---- step 4: back affordance ---------------------------------------- */
.booking-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
    margin-bottom: var(--space-2);
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--fs-small);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--dur-base) var(--ease-soft),
                background-color var(--dur-base) var(--ease-soft);
}

.booking-back svg {
    transition: transform var(--dur-base) var(--ease-dreamy);
}

.booking-back:hover {
    color: var(--accent-strong);
    background: var(--tint-soft);
}

.booking-back:hover svg {
    transform: translateX(-3px);
}

.booking-back:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ---- live summary bar — calm, persistent, updates with each choice -- */
.booking-summary-bar {
    position: sticky;
    bottom: var(--space-3);
    z-index: var(--z-base);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-8);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(var(--blur-glass));
    backdrop-filter: blur(var(--blur-glass));
    box-shadow: var(--shadow-md);
}

.booking-summary-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    min-width: 0;
}

.booking-summary-line {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.booking-summary-total {
    font-size: var(--fs-lead);
    font-weight: 700;
    color: var(--text);
}

/* Extending is frictionless; there is deliberately no shrink button. */
.booking-add-hour {
    flex-shrink: 0;
    min-height: 44px;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    border: 2px solid var(--accent);
    background: var(--surface);
    color: var(--accent-strong);
    font-size: var(--fs-small);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background-color var(--dur-base) var(--ease-soft),
                color var(--dur-base) var(--ease-soft),
                transform var(--dur-base) var(--ease-dreamy);
}

.booking-add-hour:hover {
    background: var(--grad-coral);
    color: var(--text-on-coral);
    border-color: transparent;
    transform: translateY(-2px);
}

.booking-add-hour:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ---- step 5: confirmation celebration ------------------------------- */
/* The success panel reuses the global .form-state styling; give its icon a
   gentle one-shot pop when the booking lands. */
.booking-step[data-step="done"]:not(.hidden) .form-state__icon {
    animation: bookingPop var(--dur-slow) var(--ease-dreamy) both;
}

@keyframes bookingPop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 1024px) {
    .booking-pick-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .booking-slot-list {
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .booking-card {
        padding: var(--space-8) var(--space-6);
    }

    /* Mobile-first: one tappable card per row, no dense grids. */
    .booking-tiers {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .booking-goals {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .booking-card {
        padding: var(--space-7) var(--space-4);
        border-radius: var(--radius-lg);
    }

    .booking-slot-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .booking-summary-bar {
        flex-wrap: wrap;
    }

    .booking-add-hour {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .booking-step:not(.hidden),
    .booking-step[data-step="done"]:not(.hidden) .form-state__icon {
        animation: none;
    }

    .booking-goal:hover,
    .booking-tier:hover,
    .booking-slot:hover,
    .booking-add-hour:hover {
        transform: none;
    }

    .booking-back:hover svg {
        transform: none;
    }
}
