/* TrainTrack web — dark, premium, enterprise look inspired by exxas.net:
   deep navy canvas, white top nav bar, bright cyan accent, glowing cards,
   big white price numbers. */

:root {
    --navy-0: #0a1826;      /* darkest — topbar, footer */
    --navy-1: #112a42;      /* main page background */
    --navy-2: #16324e;      /* raised */
    --panel: rgba(255, 255, 255, .045);
    --panel-2: rgba(255, 255, 255, .07);
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .18);

    --ink: #eef4fb;
    --ink-soft: #a9b8ca;
    --ink-faint: #7688a0;

    --brand: #1892c9;         /* accent: logo, links, glow, focus */
    --brand-ink: #12658f;     /* accent, darker */
    --brand-btn: #146f9c;     /* CTA button — deeper & darker */
    --brand-btn-ink: #10597e; /* CTA button hover */
    --brand-soft: rgba(24, 146, 201, .15);
    --glow: rgba(24, 146, 201, .36);

    --danger: #ff6b6b;
    --radius: 18px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-brand: 0 12px 34px rgba(16, 89, 126, .45);
    --maxw: 1180px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Make the `hidden` attribute authoritative — otherwise .btn / .auth-slot set
   display:inline-flex and the auth toggle (Sign in ↔ Sign out) never hides. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--navy-1);
    color: var(--ink-soft);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Ambient glow behind the whole page, brightest at the top. */
body {
    display: flex; flex-direction: column; min-height: 100vh;
    background:
        radial-gradient(1200px 500px at 50% -8%, rgba(27, 163, 226, .18), transparent 60%),
        linear-gradient(180deg, #123048 0%, var(--navy-1) 38%, #0e2338 100%);
    background-attachment: fixed;
}
main { flex: 1; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: #46b7ea; }

h1, h2, h3 { margin: 0 0 .4em; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
h1 { font-size: clamp(2.35rem, 4.6vw, 3.6rem); line-height: 1.07; }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.14; }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 440px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.small { font-size: .9rem; }
.fine { color: var(--ink-faint); font-size: .82rem; margin-top: 18px; }
.eyebrow {
    display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--brand); margin-bottom: 16px;
}

/* Thin utility top bar */
.topbar { background: var(--navy-0); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.topbar-tag { font-size: .8rem; color: var(--ink-faint); }
.topbar-links { display: flex; gap: 20px; }
.topbar-links a { font-size: .8rem; color: var(--ink-soft); font-weight: 500; }
.topbar-links a:hover { color: #fff; }

/* Dark main nav bar — unified with the utility strip above it. */
.site-header { background: var(--navy-0); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-weight: 800; font-size: 1.55rem; color: var(--brand); letter-spacing: -.04em; }
.brand span { color: var(--brand); }
.brand:hover { color: #46b7ea; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav > a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.nav > a:hover { color: #fff; }
.auth-slot { display: inline-flex; align-items: center; gap: 12px; }
.auth-email { color: var(--ink-soft); font-size: .9rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 11px 20px; font-family: var(--font); font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: all .16s ease; white-space: nowrap; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn .arw { transition: transform .16s ease; }
.btn:hover .arw { transform: translateX(3px); }
.btn-primary { background: var(--brand-btn); color: #fff; box-shadow: 0 4px 14px rgba(16, 89, 126, .5); }
.btn-primary:hover { background: var(--brand-btn-ink); color: #fff; box-shadow: var(--shadow-brand); }
/* Ghost adapts: light border on dark sections, but readable on the white header too. */
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--brand); color: #fff; background: var(--brand-soft); }
.btn-sm { padding: 8px 15px; font-size: .88rem; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }

/* Cards (dark glass) */
.card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 26px; color: var(--ink-soft);
}

/* Hero */
.hero { padding: 96px 0 60px; text-align: center; }
.hero h1 { max-width: 920px; margin: 0 auto; }
.hero .accent { color: var(--brand); }
.lede { max-width: 640px; margin: 22px auto 32px; font-size: 1.17rem; color: var(--ink-soft); }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Trust strip */
.trust { padding: 6px 0 70px; text-align: center; }
.trust-label { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 16px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 12px; justify-content: center; }
.trust-chip {
    font-size: .9rem; font-weight: 600; color: var(--ink-soft);
    background: var(--panel); border: 1px solid var(--line);
    padding: 8px 16px; border-radius: 999px;
}

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: rgba(0, 0, 0, .16); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-sub { color: var(--ink-soft); font-size: 1.06rem; margin: 0; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
    box-shadow: var(--shadow); transition: border-color .18s ease, transform .18s ease;
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.feature-ico {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    color: var(--brand); margin-bottom: 18px;
    background: radial-gradient(circle at 50% 40%, var(--glow), var(--brand-soft) 65%, transparent 72%);
    border: 1px solid var(--line);
}
.feature-ico svg { width: 26px; height: 26px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--ink-soft); margin: 0; }

/* Pricing / bundles — glowing dark cards, big white price */
.bundle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; text-align: left; align-items: stretch; }
.bundle {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 26px; transition: border-color .18s ease, transform .18s ease;
}
.bundle:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.bundle > * { position: relative; z-index: 1; }
/* Top glow behind the card graphic. */
.bundle::after {
    content: ''; position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
    width: 78%; height: 220px; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse 62% 70% at 50% 0%, var(--glow), transparent 68%);
}
/* Highlight the middle bundle as "most popular". */
.bundle-grid .bundle:nth-child(2) { border-color: rgba(24, 146, 201, .55); box-shadow: 0 0 0 1px rgba(24, 146, 201, .35), var(--shadow-brand); }
.bundle-grid .bundle:nth-child(2)::before {
    content: 'Most popular'; position: absolute; top: 16px; right: 16px; z-index: 2;
    background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
}
.bundle-name { font-weight: 700; font-size: 1.15rem; color: #fff; }
.bundle-desc { color: var(--ink-soft); margin: 12px 0 0; flex: 1; }
.bundle-price { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; color: #fff; margin: 22px 0 0; line-height: 1; }
.bundle-seats { color: var(--ink-faint); font-size: .9rem; margin-top: 6px; }
.bundle .btn { margin-top: 20px; }

/* Auth page */
.auth-page { padding: 80px 0; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.field { display: block; margin: 18px 0; }
.field span { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; color: var(--ink); }
.field input {
    width: 100%; padding: 12px 14px; font-family: var(--font); font-size: 1rem;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .25); color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(27, 163, 226, .18); }
.form-error { color: var(--danger); font-size: .9rem; margin: 12px 0 0; }

/* Portal */
.portal { padding: 60px 0 90px; }
.portal-head { margin-bottom: 26px; }
.portal-head h1 { font-size: 2.1rem; }
.portal-subhead { margin: 42px 0 18px; }
.balance-card { display: flex; gap: 12px; justify-content: space-around; text-align: center; padding: 32px 26px; }
.balance-metric { display: flex; flex-direction: column; gap: 4px; padding: 4px 14px; }
.metric-num { font-size: 2.8rem; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.metric-label { color: var(--ink-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.pay-note { margin-top: 24px; color: var(--ink-soft); font-size: .9rem; }
.notice { text-align: center; color: var(--ink-soft); }

/* Loading */
.loading { color: var(--ink-faint); padding: 20px; text-align: center; }
.loading.big { padding: 72px 0; font-size: 1.05rem; }

/* Toast */
.toast {
    position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(12px);
    background: #0a1826; color: #fff; border: 1px solid var(--line-strong);
    padding: 13px 20px; border-radius: var(--radius-sm);
    font-size: .92rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
    transition: .22s ease; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-err { border-color: var(--danger); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--navy-0); padding: 28px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-faint); font-size: .88rem; }

@media (max-width: 780px) {
    .features-grid, .bundle-grid { grid-template-columns: 1fr; }
    .hero { padding: 66px 0 40px; }
    .section { padding: 56px 0; }
    .topbar-tag { display: none; }
    .site-footer .wrap { flex-direction: column; }
}
