/* theme-dark.css — base / dark-mode stylesheet.
 *
 * This file is ALWAYS loaded and provides:
 *   1. Default (dark) CSS variables on :root.  These are the colours the
 *      page shows when no [data-theme] attribute is set on <html>.
 *   2. Theme-agnostic rules that apply in both light AND dark modes —
 *      the theme-toggle button, the #continue-btn green commit action,
 *      the navy journeys-row-select-btn, the navigation red-dot pulse,
 *      and the @keyframes for the dot animation.
 *
 * The companion file theme-light.css is also loaded on every page; its
 * rules all start with :root[data-theme="light"] so they only engage
 * when light mode is active (the toggle button or system preference
 * sets the data-theme attribute).
 *
 * When you want to change a DARK colour, look here.
 * When you want to change a LIGHT colour, look in theme-light.css.
 */


/***************************************************************************
 * Default (dark) theme variables
 *
 * Pages that already define :root in an inline <style> (index.html,
 * jit-calendar.html) override these with identical values; the duplicate
 * definition is harmless and keeps every page paint-correct on its own.
 *
 * Pages that don't define their own (privacy, terms, tickets, etc.)
 * inherit from here so that var() references in styles.css resolve.
 ***************************************************************************/

:root {
    --bg:            #0f172a;
    --panel:         #1e293b;
    --panel-border:  #334155;
    --text:          #e2e8f0;
    --text-dim:      #94a3b8;
    --text-bright:   #f1f5f9;
    --track:         #334155;
    --endpoint:      #1a73e8;
    --best-border:   #10b981;

    /* Per-leg accent colours used by the split-ticket display on the home
     * page (.continue-bar .mini-leg.leg-N) and anywhere else that needs to
     * differentiate up to five legs visually. */
    --leg-1:         #10b981;
    --leg-2:         #f59e0b;
    --leg-3:         #ef4444;
    --leg-4:         #06b6d4;
    --leg-5:         #a855f7;
}


/***************************************************************************
 * Light-theme variable overrides
 ***************************************************************************/


/***************************************************************************
 * Component overrides for hardcoded hex values
 *
 * Most pages route through CSS variables and pick up the right colours
 * for free.  These rules patch the few that don't.
 ***************************************************************************/

/* itinerary.html — disclaimer + pro-lner verification cards */


/* itinerary.html — legs blocks (per-leg coloured cards) */

/* styles.css — journey list / split-ticket cards / summary panels.
 * Most of these are already white-card-on-dark-page; in light mode we
 * keep cards white but lift the page to a soft grey so the cards still
 * read as elevated surfaces.  Text colours that were hardcoded to the
 * dark-mode bright value (#f1f5f9) need flipping to the slate scale. */


/* Stripe-style layered elevation.
 *
 * Stripe's dashboard cards lift with a 3-layer shadow stack instead of
 * a border.  Top layer = micro-shadow that gives a sub-pixel separation;
 * middle layer = soft drop; bottom = a near-invisible 1px ring to keep
 * the edge crisp on retina displays.  The result reads as crisp and
 * elevated without any visible outline. */

/* Hover lift uses Stripe's stronger second-state shadow — keeps the
 * micro-shadow + ring identical, just enlarges the soft drop. */

/* Anchor / selected card — a clear blue ring instead of a near-invisible
 * border tint.  Reuses the brand blue. */

/* Page sections that were dark gradients — replace with a soft warm
 * gradient so the hero has visual weight without dominating. */

/* Hero headline gains a navy-to-blue gradient and bigger weight so the
 * value proposition has presence on the page.  Light mode otherwise
 * lacks the contrast the dark mode gets for free. */

/* Primary buttons use the brand-warm Google-style blue (#1a73e8 / hover
 * #155ab9).  Studies on CTA click-through (Google, Trainline) consistently
 * favour this warmer, slightly cyan blue over the colder indigo end of
 * the spectrum.  Header/branding navy (#1a1a3b) is preserved separately
 * so the brand identity stays distinct from the click-action.
 *
 * Note: the search-form Plan button is `<button id="go">` with no
 * class, so it needs an explicit #go selector. */


/* Card titles ("OUR OPTIMISED JOURNEY", section headers) get a navy
 * (brand) tint instead of generic uppercase grey — makes the page feel
 * like a designed product rather than a Bootstrap demo. */

/* Stripe-conservative corner radii.  Stripe's own dashboard sits at
 * ~8px on cards and 6px on inputs/buttons — the bouncy 18px we tried
 * earlier reads as marketing-page rather than serious-business. */


/* Pills and badges go full-rounded.  These are small enough that 999px
 * gives the nicest stadium shape without affecting box dimensions. */


/***************************************************************************
 * Action-colour swap (applies to both themes)
 *
 * The primary commit action (Continue → checkout) is green so users can
 * see the "go ahead" semantics at a glance.  Per-row Select buttons are
 * blue — they're navigational, not commit actions, so a less attention-
 * grabbing colour suits them better.  This pattern matches the convention
 * users already know from booking flows (green = safe to proceed).
 ***************************************************************************/

/* Continue button — deeper forest-green gradient that pairs with the
 * navy Plan button as a richer, more saturated palette than the
 * earlier mint green.  Matches the visual weight of the brand-navy
 * primary buttons. */
#continue-btn {
    background: linear-gradient(180deg, #0c8155 0%, #054e35 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: 0 0 0 1px rgba(15, 50, 35, 0.14),
                0 1px 1px 0 rgba(0, 0, 0, 0.06),
                0 4px 10px 0 rgba(5, 78, 53, 0.32);
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

#continue-btn:hover {
    background: linear-gradient(180deg, #119968 0%, #086241 100%);
    box-shadow: 0 0 0 1px rgba(15, 50, 35, 0.16),
                0 2px 5px 0 rgba(0, 0, 0, 0.10),
                0 7px 18px 0 rgba(5, 78, 53, 0.40);
    transform: translateY(-1px);
}

/* button.<class> beats .<class> in specificity — needed because the
 * inline <style> in index.html sets the original green via var(--accent)
 * and is loaded after theme.css.
 *
 * Select buttons share the brand-navy gradient with Plan so the action
 * palette is two-tone (navy = browse/select, green = commit). */
button.journeys-row-select-btn {
    background: linear-gradient(180deg, #2b2b66 0%, #1a1a3b 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(15, 15, 35, 0.12),
                0 1px 1px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

button.journeys-row-select-btn:hover {
    background: linear-gradient(180deg, #36367a 0%, #232352 100%);
    box-shadow: 0 0 0 1px rgba(15, 15, 35, 0.14),
                0 2px 4px 0 rgba(26, 26, 59, 0.30);
    transform: translateY(-1px);
}

/* The selected-row variant in index.html
 * (.journeys-panel-table tr.journey-row.selected .journeys-row-select-btn)
 * hardcodes the green at spec (0,4,1).  Match its specificity exactly
 * by replicating the chain + adding `button` to bump us higher. */
.journeys-panel-table tr.journey-row.selected button.journeys-row-select-btn {
    background: #1a1a3b;
}

/* Strengthen accent colours that lose punch on white.  In dark mode the
 * pale-green savings text reads fine against the dark slate; on white it
 * looks washed out. */


/* The "saves £9.50" element carries BOTH .option-price and .savings, so
 * the .option-price rule above (defined later) wins on equal specificity.
 * Re-assert .savings green using a compound selector that beats it. */

/* Selected option-card already gets the blue border ring; add a left
 * accent stripe for extra visual weight without overwhelming. */

/* Section labels (FROM/TO/TICKET/CLASS/...) — bump from light slate to
 * the same deep-navy used by the JOURNEYS tab and the bold £xx.xx price
 * column.  The previous #475569 read as washed-out against a white
 * card; #1a1a3b matches the brand identity and pulls the labels up to
 * the same contrast level as the other "definitive" text on the page. */


/* Body and helper text — also bump up.  --text was #425466 (Stripe body
 * grey); next to a deep-navy header this reads as too faded.  A darker
 * slate gets us closer to the JOURNEYS tab contrast across the board. */

/* Inputs and selects inside a white card need a visible outline of their
 * own — without it they read as solid white blocks with no field affordance. */


/***************************************************************************
 * Theme-toggle button — sits in the header next to the menu kebab.
 *
 * Renders both icons in the DOM; CSS hides the inactive one based on the
 * current data-theme.  This avoids any JS-side icon-swapping work and
 * makes the SSR-rendered initial paint correct on both themes.
 ***************************************************************************/

/* Top-nav red dot — small saturated dot next to "Today's deals" so the
 * nav item carries an at-a-glance freshness signal.  Sized small enough
 * not to compete with the link text but bright enough to draw the eye on
 * first scan. */
.top-nav .nav-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: 1px;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
    animation: nav-dot-pulse 2.4s ease-in-out infinite;
}

@keyframes nav-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18); }
    50%      { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10); }
}

/* Segmented Light / Dark pill, anchored to the right side of the header
 * just before the 3-dot kebab menu.  margin-left: auto absorbs the
 * remaining horizontal space so the switch hugs the right edge while
 * the wordmark stays anchored to the left.
 *
 * Both options are always visible — a "click selector" rather than a
 * single hidden-state icon button.  The aria-pressed=true child is
 * highlighted; the other is ghosted but immediately visible as the
 * other choice.  Sizing is deliberately small so the switch reads as
 * a setting, not a CTA. */
.theme-switch {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    margin-right: 8px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.theme-switch__opt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 0;
    padding: 3px 9px;
    color: rgba(255, 255, 255, 0.62);
    cursor: pointer;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}

.theme-switch__opt[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.theme-switch__opt:hover:not([aria-pressed="true"]),
.theme-switch__opt:focus:not([aria-pressed="true"]) {
    color: #ffffff;
    outline: none;
}

.theme-switch__opt svg {
    display: block;
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* On very narrow screens, drop the text labels but keep the segmented
 * shape — the switch is still self-evident as a two-way control. */
@media (max-width: 480px) {
    .theme-switch__opt span { display: none; }
    .theme-switch__opt      { padding: 4px 7px; }
}


/***************************************************************************
 * Summary panel (results-summary > .sum-card--primary)
 *
 * The sticky right-hand summary card hardcodes navy bg + white text in
 * styles.css.  In light mode that reads as a heavy dark slab against
 * the otherwise crisp white-card layout.  Flip it to a white card with
 * a coloured top border (so it still reads as "the primary summary",
 * not "just another card") and re-colour the text + secondary CTA. */


/* The "secondary" outline CTA inside the summary uses semi-transparent
 * white borders/text — invisible on a white card.  Re-skin to slate. */


/***************************************************************************
 * Site-wide navy lift in light mode.
 *
 * The brand navy #1a1a3b reads quite heavy on a near-white page.  Shift
 * to a slightly lighter midnight tone (#272754) for the header, footer
 * accents, and the segmented selector bars on /special-offers — keeps
 * the brand identity but feels less oppressive against the rest of the
 * light surface. */


/* Secondary "Select" buttons keep the lighter midnight gradient so the
 * action palette is two-tone in light mode: Google blue = primary CTA
 * (Plan / Continue), navy = secondary action (Select).  Primary CTAs
 * are styled by the earlier #1a73e8 / #155ab9 rule and intentionally
 * not overridden here. */


.journeys-panel-table tr.journey-row.selected button.journeys-row-select-btn {
    background: #272754;
}


/***************************************************************************
 * Outlined controls — give the Check Nearby Stations checkbox and the
 * Reset button visible borders.  Their hairline #e6ebf1 borders were
 * disappearing against the cool light-grey page bg. */


/* Placeholder text — the global rule fades to 0.55 opacity which on
 * light mode reads almost invisibly.  Use the brand navy at full
 * opacity; italic differentiates it from a real typed value. */

/* Inline checkbox / toggle labels (e.g. "Check Nearby Stations") — same
 * navy contrast as the placeholders so the form reads at a uniform
 * weight. */

/* Optimised-lanes vertical track — non-call stations.  In dark mode the
 * default grey-on-dark dot reads as a subtle "passes through" marker.
 * In light mode that grey vanishes against the white card.  Flip to a
 * white centre with a navy ring so non-call stops are visible but
 * clearly differentiated from the coloured endpoint/boundary dots.
 *
 * The :not(...) chain keeps the override targeted to the base dot
 * style — endpoints, boundaries, and leg-N dots all keep their colour. */

/* LNER journey-check accent text — on the dark card these used pale
 * mint / pale gold for the "fastest", "price-ok", and "warn / price-
 * diff" badges.  On a white card those pale tones become unreadable.
 * Swap to the darker equivalents that hit AA contrast. */


/* Print itinerary button — was a transparent outlined pill; bump to the
 * same navy gradient as Plan and Select so it reads as a primary
 * action in the page. */


/***************************************************************************
 * /jit-calendar (Cheapest days)
 *
 * Cells use the same Stripe-style elevation as the journey cards on /
 * so they read as proper cards instead of flat squares blending with
 * the page bg.  The hover/error/scanning states use dark bg colours
 * baked into the inline <style>; flip those to light in light mode. */


/* Tier colour text on the cells.  Pale tones (mint #34d399, cyan
 * #22d3ee, amber #fbbf24, pink #f472b6) read fine on dark cards, are
 * unreadable on white.  Swap to the darker equivalents.  The pill
 * backgrounds keep a hint of tier colour via low-opacity rgba(). */

/* Inline-style colour hacks in jit-calendar.html (style="color:#34d399")
 * win on specificity unless we use !important.  Re-anchor the standout
 * green/red used for cheapest/dearest call-outs in the legend. */


