/* ==========================================================================
   DriveSooner — Modern Design Enhancement Layer
   --------------------------------------------------------------------------
   Loaded LAST (via user_footer.php) so it gently refines the existing design
   without touching any markup, copy or application logic.

   Everything here is intentionally additive: depth, motion, focus states and
   tactile feedback. No colours, prices, text or behaviour are changed — only
   the polish that makes the existing premium theme feel a touch more modern
   and more conversion friendly. Safe to delete to revert all enhancements.
   ========================================================================== */

:root {
    /* Premium easing curves shared across interactions */
    --ds-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ds-ease-soft: cubic-bezier(0.16, 1, 0.3, 1);

    /* Layered, soft elevation scale (calmer than a single hard shadow) */
    --ds-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 8px rgba(15, 23, 42, 0.05);
    --ds-shadow-md: 0 6px 16px rgba(15, 23, 42, 0.07), 0 14px 36px rgba(15, 23, 42, 0.10);
    --ds-shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12), 0 28px 60px rgba(15, 23, 42, 0.16);

    /* Brand-blue focus ring */
    --ds-ring: 0 0 0 4px rgba(37, 99, 235, 0.20);
}

/* --------------------------------------------------------------------------
   0. Foundations — crisper type, friendly selection, smooth anchored scroll
   -------------------------------------------------------------------------- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
    color: inherit;
}

/* Smooth in-page jumps and keep section headings clear of the sticky bar */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

/* --------------------------------------------------------------------------
   1. Accessible focus — a clear ring for keyboard users, nothing for mouse
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--ds-ring);
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   2. Navbar — sticky, lightly frosted, with an animated link underline
   Keeps the primary call to action within reach as the page scrolls.
   -------------------------------------------------------------------------- */
.navbar.bg-white {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.3s var(--ds-ease), background 0.3s var(--ds-ease);
}

.navbar.bg-white:hover {
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
}

/* Solid fallback where backdrop-filter is unsupported */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .navbar.bg-white {
        background: #ffffff !important;
    }
}

.navbar .nav-link {
    position: relative;
    transition: color 0.2s var(--ds-ease);
}

.navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.28s var(--ds-ease);
}

.navbar .nav-link:hover::after,
.navbar .nav-link:focus::after {
    transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   3. Buttons — consistent brand blue, soft depth and a tactile press
   We tune Bootstrap's button tokens (not the markup) so every state stays
   on-brand, and add a gentle press/hover feel to the bespoke gradient CTAs.
   -------------------------------------------------------------------------- */
.btn {
    transition: transform 0.18s var(--ds-ease), box-shadow 0.25s var(--ds-ease),
        filter 0.2s var(--ds-ease), background-color 0.2s var(--ds-ease);
}

.btn-primary {
    --bs-btn-bg: #2563eb;
    --bs-btn-border-color: #2563eb;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: #2563eb;
    --bs-btn-disabled-border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.38);
    transform: translateY(-1px);
}

.btn-success {
    --bs-btn-bg: #16a34a;
    --bs-btn-border-color: #16a34a;
    --bs-btn-hover-bg: #15803d;
    --bs-btn-hover-border-color: #15803d;
    --bs-btn-active-bg: #166534;
    --bs-btn-active-border-color: #166534;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.26);
}

.btn-success:hover {
    box-shadow: 0 8px 22px rgba(22, 163, 74, 0.36);
    transform: translateY(-1px);
}

/* Shared tactile press + smoother easing for the bespoke gradient CTAs */
.card-cta,
.plan-btn,
.btn-flow,
.summary-cta {
    transition: transform 0.2s var(--ds-ease), box-shadow 0.28s var(--ds-ease),
        filter 0.2s var(--ds-ease);
}

.btn:active,
.card-cta:active,
.plan-btn:active,
.btn-flow:active {
    transform: translateY(1px) scale(0.992);
}

/* Gradient CTAs come alive on hover without altering their palette */
.card-cta:hover,
.plan-btn:hover,
.btn-flow-primary:hover,
.btn-flow-success:hover {
    filter: saturate(1.06) brightness(1.03);
}

/* --------------------------------------------------------------------------
   4. Cards — deeper, softer elevation and a refined hover
   -------------------------------------------------------------------------- */

/* Generic Bootstrap cards (login, dashboard, account, payment pages) */
.card {
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: var(--ds-shadow-sm);
    transition: transform 0.3s var(--ds-ease), box-shadow 0.3s var(--ds-ease);
}

.card:hover {
    box-shadow: var(--ds-shadow-md);
}

/* Homepage hero pricing cards — keep their lift, deepen the shadow */
.hero-price-card {
    transition: transform 0.35s var(--ds-ease), box-shadow 0.35s var(--ds-ease),
        border-color 0.35s var(--ds-ease);
}

.hero-price-card:hover {
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

/* Booking-page plan cards — add elevation on hover (shadow only, so the
   featured card's scale transform is preserved) */
.plan-card {
    transition: transform 0.3s var(--ds-ease), box-shadow 0.3s var(--ds-ease),
        border-color 0.3s var(--ds-ease);
}

.plan-card:hover {
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.16);
}

/* Booking flow shell — a slightly richer, layered shadow */
.flow-card {
    box-shadow: var(--ds-shadow-md);
}

/* Stat + review cards lacked a hover; give them a calm one (no transform,
   so it never clashes with the scroll-reveal below) */
.stat-card,
.review-card {
    transition: box-shadow 0.3s var(--ds-ease), border-color 0.3s var(--ds-ease);
}

.stat-card:hover,
.review-card:hover {
    box-shadow: var(--ds-shadow-md);
}

/* --------------------------------------------------------------------------
   5. Forms — modern, on-brand focus and a subtle hover affordance
   -------------------------------------------------------------------------- */
.form-control,
.form-select {
    transition: border-color 0.2s var(--ds-ease), box-shadow 0.2s var(--ds-ease),
        background-color 0.2s var(--ds-ease);
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: #cbd5e1;
}

/* Refresh the legacy purple focus ring to the current brand blue */
.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Bespoke search fields (hero checker + booking centre search) get a gentle
   hover that matches their existing green focus accent */
.centre-search-input:hover:not(:focus),
.mini-checker-search input:hover:not(:focus) {
    border-color: rgba(34, 197, 94, 0.45);
}

/* --------------------------------------------------------------------------
   6. Footer — smoother link transitions
   -------------------------------------------------------------------------- */
footer a {
    transition: color 0.2s var(--ds-ease), opacity 0.2s var(--ds-ease),
        border-color 0.2s var(--ds-ease);
}

/* --------------------------------------------------------------------------
   7. Scroll-reveal — progressive enhancement only
   Uses native scroll-driven animations where supported (Chromium). Other
   browsers and reduced-motion users simply see the content normally. Cards
   already in view on load resolve to their final, fully-visible state.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        /* Slide-up only on the simple, static stats grid */
        .stat-card {
            animation: ds-reveal-up linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
        }

        /* Opacity-only fade everywhere else, so existing transform-based
           hovers, the reviews carousel and the FAQ accordion are untouched */
        .step-card,
        .review-card,
        .faq-item {
            animation: ds-reveal-fade linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
        }
    }
}

@keyframes ds-reveal-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ds-reveal-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   8. Reduced motion — respect the user's system preference everywhere
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn,
    .card,
    .card-cta,
    .plan-btn,
    .plan-card,
    .hero-price-card,
    .btn-flow,
    .navbar .nav-link::after {
        transition-duration: 0.01ms;
    }
}

/* ==========================================================================
   BOLD REDESIGN v2 — Premium "ink + emerald" checkout system
   --------------------------------------------------------------------------
   A confident, modern visual pass over the booking flow (the conversion page)
   and the homepage hero. Data led: ~83% of visitors are on small phones, so
   everything below is tuned mobile-first. Still zero copy or logic changes,
   only colour, depth, type and motion. Loaded last, so it wins the cascade.

   Palette:
     ink        #0a1424   deep navy-black base
     ink-2      #0c1f33   raised dark surface
     emerald    #10b981 / mint #34d399 / bright #6ee7b7
     cyan       #22d3ee   cool accent
     gold       #fbbf24 / amber #f59e0b   (deals / urgency)
   ========================================================================== */

/* ---- Booking header: out with the flat municipal green ----------------- */
.flow-header {
    background:
        radial-gradient(135% 120% at 6% -12%, rgba(16, 185, 129, 0.30), transparent 46%),
        radial-gradient(120% 130% at 102% -8%, rgba(34, 211, 238, 0.20), transparent 44%),
        radial-gradient(150% 130% at 50% 132%, rgba(52, 211, 153, 0.22), transparent 56%),
        linear-gradient(168deg, #0a1626 0%, #0c1f33 52%, #091420 100%) !important;
    padding: 52px 32px 42px !important;
    position: relative;
    overflow: hidden;
}

/* Fine emerald hairline of light along the very top edge */
.flow-header::before {
    content: "" !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(110, 231, 183, 0.7), transparent);
    z-index: 2;
}

/* Soft moving sheen so the header reads "alive", not static */
.flow-header::after {
    content: "" !important;
    position: absolute;
    top: -60%;
    left: -30%;
    width: 60%;
    height: 220%;
    background: linear-gradient(105deg, transparent, rgba(110, 231, 183, 0.10), transparent);
    transform: rotate(8deg);
    animation: ds-header-sheen 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ds-header-sheen {
    0%, 100% { transform: translateX(0) rotate(8deg); opacity: 0; }
    45% { opacity: 1; }
    60% { transform: translateX(320%) rotate(8deg); opacity: 0; }
}

.flow-header-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(34, 211, 238, 0.14)) !important;
    border: 1px solid rgba(110, 231, 183, 0.45) !important;
    border-radius: 18px !important;
    color: #6ee7b7 !important;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08), 0 14px 34px rgba(2, 12, 22, 0.45) !important;
    width: 60px !important;
    height: 60px !important;
}

.flow-header h1 {
    font-size: clamp(1.7rem, 6vw, 2.2rem) !important;
    letter-spacing: -0.03em !important;
}

/* Mint-to-cyan gradient on the emphasised word */
.flow-header h1 .highlight {
    background: linear-gradient(120deg, #34d399 0%, #6ee7b7 55%, #22d3ee 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.flow-header p {
    color: rgba(226, 240, 235, 0.86) !important;
}

/* Trust line becomes a row of subtle glass pills */
.flow-header-trust {
    gap: 10px !important;
}

.flow-header-trust-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 13px;
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.88) !important;
}

.flow-header-trust-item i {
    color: #6ee7b7 !important;
}

/* ---- The flow shell ---------------------------------------------------- */
.flow-card {
    border: 1px solid #e8edf4 !important;
    border-radius: 24px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 60px rgba(13, 30, 51, 0.12) !important;
}

/* ---- Checkout "Stop waiting" panel ------------------------------------- */
.checkout-trust-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%) !important;
    border: 1px solid #e3ece6 !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 34px rgba(13, 30, 51, 0.07) !important;
    padding: 22px 24px !important;
}

.checkout-trust-kicker {
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.22);
    padding: 4px 11px;
    border-radius: 999px;
    color: #0f766e !important;
}

.checkout-price-pill__amount {
    font-size: 2.55rem !important;
    background: linear-gradient(135deg, #0b1220 0%, #0f5132 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #0b1220;
}

/* ---- The deal / flash badge: premium gold, never muddy green ----------- */
.fomo-save-badge.super-flash-badge,
.fomo-save-badge {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 52%, #f59e0b 100%) !important;
    color: #43320a !important;
    border: 1px solid rgba(180, 120, 8, 0.30) !important;
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.32) !important;
    border-radius: 11px !important;
    letter-spacing: -0.005em;
}

/* Red urgency dot pops against the gold */
.fomo-save-badge .fomo-ends-dot {
    background: #dc2626 !important;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    animation: ds-deal-dot 1.2s ease-out infinite;
}

@keyframes ds-deal-dot {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
    70% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Mirror the gold treatment on the small inline "save" pill */
#priceSaveBadge {
    background: linear-gradient(135deg, #fde68a, #f59e0b) !important;
    color: #43320a !important;
}

/* ---- Inputs: taller, softer, emerald focus ----------------------------- */
.form-input,
.centre-search-input {
    border: 1.5px solid #e4ebf3 !important;
    border-radius: 13px !important;
    padding: 15px 16px !important;
    background: #ffffff !important;
}

.centre-search-input {
    padding-left: 48px !important;
}

.form-input:focus,
.centre-search-input:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15) !important;
}

/* ---- Primary CTA: confident emerald, depth, a passing shine ----------- */
#bookingCtaBtn,
.btn-flow-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em !important;
    transition: transform 0.18s var(--ds-ease), box-shadow 0.25s var(--ds-ease),
        filter 0.2s var(--ds-ease) !important;
}

#bookingCtaBtn {
    font-size: 1.12rem !important;
    padding: 18px 22px !important;
}

#bookingCtaBtn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg);
    animation: ds-cta-shine 4.5s ease-in-out infinite;
}

@keyframes ds-cta-shine {
    0%, 100% { left: -75%; }
    55%, 100% { left: 130%; }
}

#bookingCtaBtn:hover,
.btn-flow-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 44px rgba(16, 185, 129, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    filter: saturate(1.05) brightness(1.02);
}

#bookingCtaBtn:active {
    transform: translateY(0) scale(0.995) !important;
}

/* ---- Booking plan badges: align to gold "popular" treatment ----------- */
.plan-card.premium {
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.16) !important;
}

/* ==========================================================================
   HOMEPAGE — cohesive premium upgrades to the hero pricing + CTAs
   ========================================================================== */

/* Hero pricing cards: cleaner radius + richer, layered elevation */
.hero-price-card {
    border-radius: 20px !important;
    border-width: 1.5px !important;
}

.hero-price-card:hover {
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5) !important;
}

/* Featured (premium) hero card earns a soft on-brand halo */
.hero-price-card.premium,
.hero-price-card.premium-plus.single-plan-hero {
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 18px 50px rgba(37, 99, 235, 0.30) !important;
}

/* Card CTAs: crisper corners + a passing shine on hover */
.card-cta {
    border-radius: 13px !important;
    position: relative;
    overflow: hidden;
}

.card-cta::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    transition: left 0.6s var(--ds-ease);
}

.hero-price-card:hover .card-cta::after {
    left: 130%;
}

/* Mini checker (lead capture) gets a touch more presence */
.hero-mini-checker {
    border-radius: 22px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(110, 231, 183, 0.12) !important;
}

/* ---- Mobile-first sizing (≈83% of visitors are on small phones) -------
   Keep the new look, but never override the page's responsive sizes on
   small screens. The checkout panel stays a row on mobile by design, so the
   price must stay compact or it squeezes the title and overflows. --------- */
@media (max-width: 576px) {
    .flow-header {
        padding: 34px 18px 26px !important;
    }

    .flow-header-icon {
        width: 50px !important;
        height: 50px !important;
    }

    .flow-header-trust {
        gap: 8px !important;
    }

    .flow-header-trust-item {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    .checkout-trust-panel {
        padding: 16px !important;
    }

    .checkout-price-pill__amount {
        font-size: 1.9rem !important;
    }

    #bookingCtaBtn {
        font-size: 1.05rem !important;
        padding: 16px 18px !important;
    }
}

/* ---- Honour reduced-motion for every new animation -------------------- */
@media (prefers-reduced-motion: reduce) {
    .flow-header::after,
    #bookingCtaBtn::after,
    .fomo-save-badge .fomo-ends-dot {
        animation: none !important;
    }
}
