/**
 * Revival Booking — widget styles.
 * Design tokens from the Book a Demo specification (§13).
 */
.booking-widget {
    --rb-accent:       #F5821F;
    --rb-surface:      #FFFFFF;
    --rb-bg-alt:       #F5F7FA;
    --rb-border:       #E2E8F0;
    --rb-border-light: #F0F2F5;
    --rb-text:         #1A1A2E;
    --rb-muted:        #6B7280;
    --rb-subtle:       #9CA3AF;
    --rb-success:      #059669;
    --rb-error:        #dc2626;
    --rb-error-bg:     rgba(220,38,38,.08);
    --rb-error-border: rgba(220,38,38,.2);
    --rb-radius-s:     6px;
    --rb-radius:       8px;
    --rb-radius-l:     12px;
    --rb-radius-xl:    16px;
    --rb-shadow:       0 4px 24px rgba(0,0,0,.06);
    --rb-shadow-l:     0 8px 40px rgba(0,0,0,.08);
    --rb-transition:   all 0.25s ease;

    max-width: 820px;
    margin: 2.5rem auto;
    background: var(--rb-surface);
    border-radius: var(--rb-radius-xl);
    box-shadow: 0 0 0 1px rgba(0,0,0,.04), var(--rb-shadow);
    padding: 2.5rem 2.25rem;
    color: var(--rb-text);
    font-size: 0.92rem;
    line-height: 1.6;
    transition: var(--rb-transition);
    text-align: initial;
}
.booking-widget:hover { box-shadow: 0 0 0 1px rgba(0,0,0,.04), var(--rb-shadow-l); }

/* Dark theme overrides */
[data-theme="dark"] .booking-widget {
    --rb-surface:      #1A1D24;
    --rb-bg-alt:       #14171D;
    --rb-border:       #2A2E38;
    --rb-border-light: #2A2E38;
    --rb-text:         #E5E7EB;
    --rb-muted:        #9CA3AF;
    --rb-subtle:       #6B7280;
    --rb-success:      #34d399;
    --rb-error:        #EF4444;
    --rb-error-bg:     rgba(220,38,38,.15);
    --rb-error-border: rgba(220,38,38,.3);
}

/* ── Steps ──────────────────────────────────────────────────────── */
.booking-step { animation: bookingFadeIn 0.35s ease-out; }
@keyframes bookingFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
.booking-step[hidden] { display: none; }

.booking-step-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.35rem; color: var(--rb-text); }
.booking-step-sub   { color: var(--rb-muted); margin: 0; font-size: 0.85rem; }
.booking-step-desc  { color: var(--rb-muted); max-width: 520px; margin: 0 auto 1.75rem; line-height: 1.7; }

.booking-step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 1.5rem; }

/* ── Buttons ────────────────────────────────────────────────────── */
.rb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: var(--rb-accent); color: #fff; border: none; cursor: pointer;
    font-weight: 600; font-size: 0.92rem; padding: 0.75rem 1.5rem;
    border-radius: var(--rb-radius); transition: var(--rb-transition);
}
.rb-btn:hover  { background: #e0741a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,130,31,.3); }
.rb-btn:focus-visible { outline: 3px solid rgba(245,130,31,.3); outline-offset: 2px; }
.rb-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3); box-shadow: none; transform: none; }
.rb-btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }
.rb-btn-outline {
    background: transparent; color: var(--rb-text); border: 1.5px solid var(--rb-border);
}
.rb-btn-outline:hover { border-color: var(--rb-accent); color: var(--rb-accent); background: rgba(245,130,31,.05); box-shadow: none; }

.rb-back, .rb-nav {
    width: 44px; height: 44px; flex-shrink: 0; cursor: pointer;
    background: transparent; color: var(--rb-text);
    border: 1.5px solid var(--rb-border); border-radius: var(--rb-radius-s);
    transition: var(--rb-transition);
}
.rb-back:hover, .rb-nav:hover { border-color: var(--rb-accent); color: var(--rb-accent); background: rgba(245,130,31,.06); }
.rb-back:focus-visible, .rb-nav:focus-visible { outline: 3px solid rgba(245,130,31,.3); outline-offset: 2px; }

/* ── Step 1: Intro ──────────────────────────────────────────────── */
.booking-intro { text-align: center; padding: 2rem 0.5rem; }
.booking-intro-icon {
    width: 80px; height: 80px; line-height: 80px; margin: 0 auto 1.25rem;
    font-size: 3.2rem; color: var(--rb-accent);
    background: linear-gradient(135deg, rgba(245,130,31,.10), rgba(245,130,31,.04));
    border-radius: var(--rb-radius-l);
}

/* ── Step 2: Calendar ───────────────────────────────────────────── */
.booking-cal-body { display: grid; grid-template-columns: 1fr 200px; gap: 1.5rem; }

.booking-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.booking-cal-month { font-size: 1rem; }

.booking-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.booking-cal-dow {
    text-align: center; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--rb-subtle); padding: 0.4rem 0;
}
.booking-cal-day {
    position: relative; text-align: center; padding: 0.7rem 0.2rem; font-size: 0.92rem;
    background: transparent; border: none; border-radius: var(--rb-radius-s);
    color: var(--rb-text); cursor: pointer; transition: all 0.12s ease; min-height: 44px;
}
.booking-cal-day:not(:disabled):hover { background: rgba(245,130,31,.1); transform: scale(1.05); }
.booking-cal-day:focus-visible { outline: 2px solid rgba(245,130,31,.5); outline-offset: 2px; }
.booking-cal-day:disabled { color: var(--rb-subtle); opacity: 0.45; cursor: default; }
.booking-cal-day.selected {
    background: var(--rb-accent); color: #fff; box-shadow: 0 4px 12px rgba(245,130,31,.3);
}
[data-theme="dark"] .booking-cal-day.selected { box-shadow: 0 4px 16px rgba(245,130,31,.4); }
.booking-cal-day.full::after {
    content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: var(--rb-error);
}
.booking-cal-loading { color: var(--rb-muted); text-align: center; }

.booking-cal-side { display: flex; flex-direction: column; gap: 0.75rem; }
.booking-info-card {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--rb-bg-alt); border-radius: var(--rb-radius); padding: 0.75rem;
    font-size: 0.78rem;
}
.booking-info-card i { color: var(--rb-accent); margin-top: 2px; }
.booking-info-card strong { display: block; font-size: 0.8rem; }
.booking-info-card span { color: var(--rb-muted); }
.booking-legend { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.75rem; color: var(--rb-muted); padding: 0 0.25rem; }
.rb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 4px; }
.rb-dot-ok   { background: var(--rb-success); }
.rb-dot-full { background: var(--rb-error); }

/* ── Step 3: Time + Details ─────────────────────────────────────── */
.booking-tz {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 1rem; font-size: 0.78rem; color: var(--rb-muted);
}
.booking-tz i { color: var(--rb-accent); }
.rb-tz-select {
    flex: 1; min-width: 160px; max-width: 100%;
    background: var(--rb-bg-alt); border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius-s); color: var(--rb-text);
    font-size: 0.8rem; padding: 0.45rem 0.6rem;
}
.rb-tz-select:focus { outline: none; border-color: var(--rb-accent); box-shadow: 0 0 0 3px rgba(245,130,31,.15); }

.booking-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
.booking-detail-grid h4 {
    font-size: 0.85rem; font-weight: 600; margin: 0 0 0.75rem; color: var(--rb-text);
    display: flex; align-items: center; gap: 0.5rem;
}
.booking-detail-grid h4 i { color: var(--rb-accent); font-size: 0.85rem; }
.booking-slots-col h4 + h4, .booking-durations { margin-top: 0; }
.booking-slots-col > h4:nth-of-type(2) { margin-top: 1.25rem; }

.booking-slots {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem;
    max-height: 260px; overflow-y: auto; padding: 2px;
}
.rb-slot {
    background: var(--rb-bg-alt); border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius-s); padding: 0.6rem 0.4rem; min-height: 44px;
    font-size: 0.85rem; color: var(--rb-text); cursor: pointer; transition: var(--rb-transition);
}
.rb-slot:hover { border-color: var(--rb-accent); transform: scale(1.02); }
.rb-slot:focus-visible { outline: 2px solid rgba(245,130,31,.5); outline-offset: 2px; }
.rb-slot.selected {
    border-color: var(--rb-accent); background: rgba(245,130,31,.1);
    font-weight: 700; box-shadow: 0 2px 8px rgba(245,130,31,.15);
}
.booking-slots-empty { color: var(--rb-muted); font-size: 0.85rem; }

.booking-durations { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rb-duration {
    background: var(--rb-bg-alt); border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius-s); padding: 0.6rem 1rem; min-height: 44px;
    font-size: 0.85rem; color: var(--rb-text); cursor: pointer; transition: var(--rb-transition);
}
.rb-duration:hover { border-color: var(--rb-accent); }
.rb-duration:focus-visible { outline: 2px solid rgba(245,130,31,.5); outline-offset: 2px; }
.rb-duration.active {
    border-color: var(--rb-accent); background: rgba(245,130,31,.1); font-weight: 700;
}

.rb-input {
    position: relative; display: block; margin-bottom: 0.75rem;
}
.rb-input i {
    position: absolute; top: 1rem; inset-inline-start: 0.9rem;
    font-size: 0.85rem; color: var(--rb-subtle); pointer-events: none;
}
.rb-input input, .rb-input textarea {
    width: 100%; box-sizing: border-box;
    background: var(--rb-bg-alt); border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius); color: var(--rb-text);
    font: inherit; font-size: 0.92rem;
    padding: 0.75rem 1rem; padding-inline-start: 2.4rem;
    transition: var(--rb-transition);
}
.rb-input input::placeholder, .rb-input textarea::placeholder { color: var(--rb-subtle); }
.rb-input input:focus, .rb-input textarea:focus {
    outline: none; border-color: var(--rb-accent); box-shadow: 0 0 0 3px rgba(245,130,31,.15);
}
.rb-form-row { display: flex; gap: 0.75rem; }
.rb-form-row .rb-input { flex: 1; }
.rb-textarea textarea { resize: vertical; }
.rb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.booking-submit-row { grid-column: 1 / -1; }
.rb-confirm { width: 100%; min-height: 48px; }
.booking-error {
    margin: 0.75rem 0 0; padding: 0.7rem 1rem; font-size: 0.85rem;
    color: var(--rb-error); background: var(--rb-error-bg);
    border: 1px solid var(--rb-error-border); border-radius: var(--rb-radius);
}

/* ── Step 4: Confirmation ───────────────────────────────────────── */
.booking-success { text-align: center; padding: 1.5rem 0.5rem; }
.booking-success-icon {
    font-size: 4.5rem; color: var(--rb-success); margin-bottom: 1rem;
    animation: bookingPop 0.4s cubic-bezier(.18,.89,.32,1.28);
}
@keyframes bookingPop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.booking-summary {
    max-width: 380px; margin: 1.5rem auto; padding: 1.25rem 1.5rem;
    background: var(--rb-bg-alt); border: 1px solid var(--rb-border-light);
    border-radius: var(--rb-radius-l); text-align: initial;
}
.booking-summary > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; }
.booking-summary dt { color: var(--rb-muted); font-size: 0.82rem; }
.booking-summary dd { margin: 0; font-weight: 600; font-size: 0.88rem; overflow-wrap: anywhere; }
.booking-summary-sep { border-top: 1px solid var(--rb-border); margin: 0.4rem 0; padding: 0 !important; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .booking-widget { padding: 1.5rem 1.25rem; margin: 1.5rem 0; border-radius: var(--rb-radius); font-size: 0.88rem; }
    .booking-cal-body { grid-template-columns: 1fr; }
    .booking-detail-grid { grid-template-columns: 1fr; }
    .booking-slots { grid-template-columns: repeat(3, 1fr); }
    .rb-form-row { flex-direction: column; gap: 0; }
    .booking-cal-day { padding: 0.5rem 0.1rem; font-size: 0.85rem; }
    .booking-intro-icon { width: 64px; height: 64px; line-height: 64px; font-size: 2.5rem; }
    .booking-step-title { font-size: 1.15rem; }
}
@media (max-width: 480px) {
    .booking-widget { padding: 1.25rem 1rem; }
    .booking-slots { grid-template-columns: repeat(2, 1fr); }
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .booking-step,
    .booking-success-icon,
    .booking-widget * {
        animation: none !important;
        transition: none !important;
    }
}
