/* =============================================================
   AltDeliver – Glass Theme (alt-glass.css)
   Bootstrap 5 overrides + reusable glass component variables
   Default: dark. Light mode activated via [data-theme="light"]
   on <html>, set by landing.js (persisted in localStorage).
   ============================================================= */

/* ── Dark mode (default) ─────────────────────────────────────── */
:root {
    color-scheme: dark;

    /* Background */
    --bg-primary: #060d1c;
    --bg-secondary: #09121f;

    /* Glass surfaces */
    --glass-bg: rgba(255, 255, 255, 0.030);
    --glass-bg-hover: rgba(255, 255, 255, 0.055);
    --glass-border: rgba(255, 255, 255, 0.110);
    --glass-border-hi: rgba(255, 255, 255, 0.220);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.40),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px) saturate(180%);

    /* Named surfaces (used by landing.css) */
    --surface-subtle: rgba(255, 255, 255, 0.030);
    --surface-hover: rgba(255, 255, 255, 0.055);
    --border-subtle: rgba(255, 255, 255, 0.090);

    /* Opaque stand-in for the blurred glass-panel tone, used to blot out native autofill colors */
    --autofill-base: #141d31;

    /* Text */
    --text-primary: rgba(220, 230, 245, 0.92);
    --text-muted-glass: rgba(180, 195, 220, 0.70);

    /* Accent colours */
    --cyan: #069fd6;
    --cyan-dim: rgba(6, 159, 214, 0.14);
    --violet: #9b51e0;
    --violet-dim: rgba(155, 81, 224, 0.12);
    --green: #00d4aa;
    --green-dim: rgba(0, 212, 170, 0.15);

    /* Chrome headline gradient */
    --chrome-gradient: linear-gradient(to bottom, #ffffff 20%, #94a3b8 65%, #e2e8f0 100%);

    /* Nav */
    --nav-pill-bg: rgba(255, 255, 255, 0.040);
    --nav-scrolled-bg: rgba(7, 12, 22, 0.72);
    --nav-scrolled-border: rgba(255, 255, 255, 0.120);
    --nav-scrolled-shadow: 0 8px 32px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --nav-link-color: rgba(200, 215, 235, 0.75);
    --nav-link-active-bg: rgba(6, 159, 214, 0.10);
    --nav-link-active-color: var(--cyan);

    /* Logo */
    --logo-wordmark-color: #ffffff;

    /* Background blobs — vivid neon by default */
    --blob-1-bg: rgba(6, 159, 214, 0.52);
    --blob-2-bg: rgba(120, 40, 220, 0.46);
    --blob-3-bg: rgba(0, 210, 185, 0.40);

    /* Grid overlay */
    --grid-line: rgba(255, 255, 255, 0.028);

    /* Pipeline connectors */
    --connector-start: rgba(155, 81, 224, 0.30);
    --connector-end: rgba(6, 159, 214, 0.30);
    --connector-arrow-color: rgba(6, 159, 214, 0.45);

    /* Footer */
    --footer-border: rgba(255, 255, 255, 0.070);
    --footer-section-border: rgba(255, 255, 255, 0.060);
    --footer-link-color: rgba(180, 195, 220, 0.70);
    --footer-copy-color: rgba(140, 155, 180, 0.55);

    /* Toggle button */
    --toggle-bg: rgba(255, 255, 255, 0.06);
    --toggle-border: rgba(255, 255, 255, 0.12);
    --toggle-color: rgba(200, 215, 235, 0.75);
    --toggle-hover-bg: rgba(255, 255, 255, 0.10);

    /* Misc */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-pill: 50px;
    --radius-card: 16px;
    --radius-lg: 24px;
    --transition-smooth: 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-btn: 10px;

    /* Shared width for any block-level section content (feature grids, CTA
       bands, glass content panels, footer, contact layout) — one place to
       change if the site-wide content width ever needs to move. */
    --content-max-width: 1100px;
}

/* ── Light mode overrides ────────────────────────────────────── */
:root[data-theme="light"] {
    color-scheme: light;

    /* Background */
    --bg-primary: #eef1f8;
    --bg-secondary: #e4e9f4;

    /* Glass surfaces */
    --glass-bg: rgba(255, 255, 255, 0.60);
    --glass-bg-hover: rgba(255, 255, 255, 0.80);
    --glass-border: rgba(0, 20, 60, 0.10);
    --glass-border-hi: rgba(0, 20, 60, 0.20);
    --glass-shadow: 0 8px 32px rgba(0, 30, 80, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);

    /* Named surfaces */
    --surface-subtle: rgba(255, 255, 255, 0.60);
    --surface-hover: rgba(255, 255, 255, 0.80);
    --border-subtle: rgba(0, 20, 60, 0.09);

    /* Opaque stand-in for the blurred glass-panel tone, used to blot out native autofill colors */
    --autofill-base: #f7f8fc;

    /* Text */
    --text-primary: rgba(13, 21, 37, 0.92);
    --text-muted-glass: rgba(60, 80, 115, 0.68);

    /* Accent colours remain vivid on light bg */
    --cyan: #069fd6;
    --cyan-dim: rgba(6, 159, 214, 0.12);
    --violet: #7c3aed;
    --violet-dim: rgba(124, 58, 237, 0.10);
    --green: #059669;
    --green-dim: rgba(5, 150, 105, 0.12);

    /* Chrome headline gradient – dark on light */
    --chrome-gradient: linear-gradient(to bottom, #0d1525 15%, #334155 60%, #1e293b 100%);

    /* Nav */
    --nav-pill-bg: rgba(255, 255, 255, 0.62);
    --nav-scrolled-bg: rgba(238, 241, 250, 0.90);
    --nav-scrolled-border: rgba(0, 20, 60, 0.12);
    --nav-scrolled-shadow: 0 8px 32px rgba(0, 30, 80, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.80);
    --nav-link-color: rgba(40, 55, 85, 0.78);
    --nav-link-active-bg: rgba(6, 159, 214, 0.10);
    --nav-link-active-color: var(--cyan);

    /* Logo */
    --logo-wordmark-color: #0d1525;

    /* Background blobs — softer on light */
    --blob-1-bg: rgba(6, 159, 214, 0.28);
    --blob-2-bg: rgba(120, 50, 190, 0.22);
    --blob-3-bg: rgba(0, 165, 130, 0.18);

    /* Grid overlay */
    --grid-line: rgba(0, 20, 60, 0.042);

    /* Pipeline connectors */
    --connector-start: rgba(120, 50, 190, 0.35);
    --connector-end: rgba(6, 159, 214, 0.35);
    --connector-arrow-color: rgba(6, 159, 214, 0.55);

    /* Footer */
    --footer-border: rgba(0, 20, 60, 0.08);
    --footer-section-border: rgba(0, 20, 60, 0.07);
    --footer-link-color: rgba(60, 80, 115, 0.68);
    --footer-copy-color: rgba(100, 120, 155, 0.60);

    /* Toggle */
    --toggle-bg: rgba(0, 20, 60, 0.06);
    --toggle-border: rgba(0, 20, 60, 0.12);
    --toggle-color: rgba(40, 55, 85, 0.78);
    --toggle-hover-bg: rgba(0, 20, 60, 0.10);
}

/* ── Base resets ─────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

/* Applied by JS when mobile nav is open — locks page scroll on all browsers/devices */
html.nav-open {
    overflow: hidden;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    width: 100%;
    transition: background-color 0.35s ease, color 0.35s ease;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* Prevent flex children from expanding body beyond viewport */
body>* {
    max-width: 100%;
}

a {
    text-decoration: none;
}

/* Bootstrap .text-muted override — Bootstrap's default #6c757d is too dark on dark surfaces */
.text-muted {
    color: var(--text-muted-glass) !important;
}

/* ── Glass panel utility ─────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--glass-shadow);
    transition:
        border-color var(--transition-smooth),
        background var(--transition-smooth),
        box-shadow var(--transition-smooth);
}

.glass:hover,
.card.glass:hover {
    background: var(--glass-bg-hover) !important;
    border-color: var(--glass-border-hi) !important;
    box-shadow: var(--glass-shadow), 0 0 24px rgba(6, 159, 214, 0.28) !important;
}

/* backdrop-filter creates a stacking context; glass panels used as filter/control bars
   (direct .row child) must sit above table panels below them. DataTables injects its
   own <select> into table panels so :has(select) alone would match both and tie. */
.glass:has(> .row),
.glass:has(> .d-flex) {
    position: relative;
    z-index: 2;
}

/* Bootstrap-select menus render in place (this build doesn't actually escape
   to a container — see altdeliver.css), so an open menu is trapped inside
   its own .glass panel's backdrop-filter stacking context. Its z-index only
   ranks it among its own panel's contents, not against sibling .glass panels
   (form panels, table panels, the fixed save bar, etc.) painted afterward.
   Lift the whole panel above all of that — but only while a menu is open.
   The "show"/"open" class lands on the .dropdown-toggle button itself, not
   on the .bootstrap-select wrapper — confirmed via devtools. */
.glass:has(.dropdown-toggle.show),
.glass:has(.dropdown-toggle.open) {
    position: relative;
    z-index: 300;
}

/* ── Chrome text ─────────────────────────────────────────────── */
.chrome-text {
    background: var(--chrome-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Display headings ────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6,
.display-1,
.display-2,
.display-3,
.display-4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-glow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-width: fit-content;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 45%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn-glow:hover::after {
    left: 130%;
}

.btn-glow-cyan {
    background: rgba(6, 159, 214, 0.14);
    border-color: rgba(6, 159, 214, 0.50);
    color: #ffffff;
    box-shadow:
        0 0 22px rgba(6, 159, 214, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-glow-cyan:hover {
    background: rgba(6, 159, 214, 0.26);
    border-color: rgba(6, 159, 214, 0.75);
    box-shadow:
        0 0 42px rgba(6, 159, 214, 0.45),
        0 4px 18px rgba(6, 159, 214, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
    color: #ffffff;
}

:root[data-theme="light"] .btn-glow-cyan {
    background: rgba(6, 159, 214, 0.88);
    border-color: rgba(6, 159, 214, 0.60);
    box-shadow: 0 0 22px rgba(6, 159, 214, 0.28);
    color: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

:root[data-theme="light"] .btn-glow-cyan:hover {
    background: rgba(6, 159, 214, 1);
    box-shadow: 0 0 38px rgba(6, 159, 214, 0.45);
}

.btn-glow-ghost {
    background: var(--surface-subtle);
    border-color: var(--glass-border-hi);
    color: var(--text-muted-glass);
    backdrop-filter: blur(8px);
}

.btn-glow-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.btn-glow:disabled,
.btn-glow.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-glow:disabled:hover,
.btn-glow.disabled:hover {
    background: rgba(6, 159, 214, 0.14);
    border-color: rgba(6, 159, 214, 0.50);
    box-shadow: none;
    transform: none;
}

.btn-glow:disabled::after,
.btn-glow.disabled::after {
    display: none;
}

/* ── Password toggle icon button ─────────────────────────────── */
.pword-btn {
    position: absolute;
    /* Anchor from the bottom, not centered on the whole positioned parent —
       some markup wraps a label + input in that parent, so top:50% would
       center on the combined box instead of the input itself. The input is
       always the last element, so its bottom edge always matches the
       parent's bottom edge. */
    bottom: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted-glass);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    transition: color 0.18s;
    text-decoration: none;
    overflow: hidden;
}

.pword-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 45%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.pword-btn:hover {
    color: var(--text-primary);
}

.pword-btn:hover::after {
    left: 130%;
}

/* ── Badge / pill ────────────────────────────────────────────── */
.badge-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-display);
    background: var(--surface-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-muted-glass);
}

.badge-glass .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-cyan {
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
}

.dot-green {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.dot-violet {
    background: var(--violet);
    box-shadow: 0 0 6px var(--violet);
}

.dot-amber {
    background: #fbbf24;
    box-shadow: 0 0 6px #fbbf24;
}

.dot-red {
    background: #f87171;
    box-shadow: 0 0 6px #f87171;
}

/* ── Theme toggle button ─────────────────────────────────────── */
.btn-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--toggle-border);
    background: var(--toggle-bg);
    color: var(--toggle-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.25s, color 0.25s, transform 0.20s;
    flex-shrink: 0;
}

.btn-theme-toggle:hover {
    background: var(--toggle-hover-bg);
    color: var(--text-primary);
    transform: rotate(15deg);
}

/* ── Offcanvas overrides ─────────────────────────────────────── */
.offcanvas {
    background: var(--nav-scrolled-bg) !important;
    backdrop-filter: blur(28px) saturate(200%);
    border-left: 1px solid var(--glass-border) !important;
    color: var(--text-primary);
    width: 440px !important;
    transition: background 0.35s ease !important;
}

.offcanvas-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 24px 28px;
}

.offcanvas-body {
    padding: 28px;
}

.offcanvas-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
}

.btn-close {
    filter: invert(1) brightness(0.6);
}

:root[data-theme="light"] .btn-close {
    filter: none;
    opacity: 0.55;
}

.offcanvas .form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted-glass);
    margin-bottom: 6px;
}

.offcanvas .form-control,
.offcanvas .form-select {
    background: var(--surface-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.offcanvas .form-control:focus,
.offcanvas .form-select:focus {
    background: var(--surface-hover);
    border-color: rgba(6, 159, 214, 0.45);
    box-shadow: 0 0 0 3px rgba(6, 159, 214, 0.10);
    color: var(--text-primary);
    outline: none;
}


.offcanvas .form-control::placeholder {
    color: var(--text-muted-glass);
    opacity: 0.6;
}

.offcanvas .form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.offcanvas .form-check-input {
    background-color: var(--surface-subtle);
    border-color: var(--glass-border);
}

.offcanvas .form-check-input:checked {
    background-color: var(--cyan);
    border-color: var(--cyan);
}

.offcanvas .form-check-label {
    font-size: 13px;
    color: var(--text-primary);
}

/* ── Section text utilities ──────────────────────────────────── */
.section-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    display: block;
    margin-bottom: 12px;
}

.section-headline {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 14px;
}

.section-sub {
    font-size: 1rem;
    color: var(--text-muted-glass);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Entrance animation utility ──────────────────────────────── */
.fade-up {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.60s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.60s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-up-delay-1 {
    transition-delay: 0.10s;
}

.fade-up-delay-2 {
    transition-delay: 0.20s;
}

.fade-up-delay-3 {
    transition-delay: 0.30s;
}

.fade-up-delay-4 {
    transition-delay: 0.40s;
}

/* ── Global form controls ────────────────────────────────────── */
.form-control,
.form-select {
    background: var(--surface-subtle);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-control:focus,
.form-select:focus {
    background: var(--surface-hover);
    border-color: rgba(6, 159, 214, 0.50);
    box-shadow: 0 0 0 3px rgba(6, 159, 214, 0.10);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted-glass);
    opacity: 0.6;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background: var(--surface-subtle);
    color: var(--text-muted-glass);
    opacity: 0.65;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
input:-internal-autofill-selected {
    -webkit-box-shadow: 0 0 0 1000px var(--surface-subtle) inset, 0 0 0 1000px var(--autofill-base) inset !important;
    box-shadow: 0 0 0 1000px var(--surface-subtle) inset, 0 0 0 1000px var(--autofill-base) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    caret-color: var(--text-primary);
    transition: background-color 0s 600000s, color 0s 600000s;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted-glass);
    margin-bottom: 7px;
}

.form-check-input {
    background-color: var(--surface-subtle);
    border-color: var(--glass-border);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--cyan);
    border-color: var(--cyan);
}


/* ══════════════════════════════════════════════════════════════
   HEADER / NAV
   ══════════════════════════════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 18px 40px 0;
    transition: padding var(--transition-smooth);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 1px solid transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition:
        max-width var(--transition-smooth),
        padding var(--transition-smooth),
        border-radius var(--transition-smooth),
        border-color var(--transition-smooth),
        background var(--transition-smooth),
        box-shadow var(--transition-smooth),
        backdrop-filter var(--transition-smooth),
        -webkit-backdrop-filter var(--transition-smooth);
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-self: start;
    flex-shrink: 0;
    /* background: var(--nav-pill-bg);
    border: 1px solid var(--glass-border); 
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);*/
    /* TODO(logo-pill): border-radius: var(--radius-pill); */
    padding: 5px 16px 5px 12px;
    transition:
        background var(--transition-smooth),
        /* TODO(logo-pill): border-color var(--transition-smooth), */
        /* TODO(logo-pill): backdrop-filter var(--transition-smooth), */
        padding var(--transition-smooth);
}

/* TODO(logo-pill): .header-logo:hover { border-color: var(--glass-border-hi); } */

.header-logo:focus-visible {
    outline: none;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 8px;
    background: var(--nav-pill-bg);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    transition:
        background var(--transition-smooth),
        border-color var(--transition-smooth),
        padding var(--transition-smooth);
}

.header-nav .nav-link {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--nav-link-color);
    padding: 5px 13px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: color 0.20s, background 0.20s;
    white-space: nowrap;
}

.header-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--surface-subtle);
}

.header-nav .nav-link.active {
    color: var(--nav-link-active-color);
    background: var(--nav-link-active-bg);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Nav buttons ─────────────────────────────────────────────── */
.btn-nav-login {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--nav-link-color);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    position: relative;
    overflow: hidden;
    transition: color 0.20s, background 0.20s;
}

.btn-nav-login::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 45%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn-nav-login:hover::after {
    left: 130%;
}

.btn-nav-login:hover {
    color: var(--text-primary);
    background: var(--surface-subtle);
}

.btn-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    background: rgba(6, 159, 214, 0.14);
    border: 1px solid rgba(6, 159, 214, 0.50);
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 16px rgba(6, 159, 214, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-smooth);
}

.btn-header-cta::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 45%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn-header-cta:hover::after {
    left: 130%;
}

.btn-header-cta:hover {
    background: rgba(6, 159, 214, 0.26);
    border-color: rgba(6, 159, 214, 0.75);
    box-shadow: 0 0 30px rgba(6, 159, 214, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.20);
    transform: translateY(-1px);
    color: #ffffff;
}

:root[data-theme="light"] .btn-header-cta {
    background: rgba(6, 159, 214, 0.88);
    border-color: rgba(6, 159, 214, 0.60);
    box-shadow: 0 0 16px rgba(6, 159, 214, 0.25);
    color: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

:root[data-theme="light"] .btn-header-cta:hover {
    background: rgba(6, 159, 214, 1);
    box-shadow: 0 0 28px rgba(6, 159, 214, 0.42);
}

.frontend-nav {
    visibility: visible;
}

/* Desktop dropdown (Solutions) — Bootstrap handles toggle/positioning;
   this just matches the pill's glass styling. Mobile override below
   (.header-nav .dropdown-menu) turns this back into a static stacked list. */
.header-nav .nav-dropdown .dropdown-menu {
    background: var(--nav-scrolled-bg);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    padding: 6px;
    min-width: 200px;
}

.header-nav .nav-dropdown .dropdown-item {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--nav-link-color);
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.20s, background 0.20s;
}

.header-nav .nav-dropdown .dropdown-item:hover,
.header-nav .nav-dropdown .dropdown-item:focus,
.header-nav .nav-dropdown .dropdown-item.active {
    color: var(--nav-link-active-color);
    background: var(--nav-link-active-bg);
}

/* ── Theme switch (in profile dropdown) ─────────────────────── */
.header-profile-theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
}

.header-profile-theme-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    pointer-events: none;
}

.theme-switch {
    flex-shrink: 0;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--surface-subtle);
    border: 1px solid var(--glass-border);
    position: relative;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
}

.theme-switch[aria-checked="true"] {
    background: rgba(6, 159, 214, 0.30);
    border-color: rgba(6, 159, 214, 0.50);
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted-glass);
    transition: transform 0.2s, background 0.2s;
    pointer-events: none;
}

.theme-switch[aria-checked="true"] .theme-switch-thumb {
    transform: translateX(16px);
    background: var(--cyan);
}

.site-header.scrolled .header-inner {
    max-width: min-content;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    background: var(--nav-scrolled-bg);
    border-color: var(--nav-scrolled-border);
    box-shadow: var(--nav-scrolled-shadow);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
}

/* Scrolled nav/logo tweaks apply on desktop only — mobile flyout has its own styles */
@media (min-width: 768px) {
    .site-header.scrolled .header-nav {
        background: transparent;
        border-color: transparent;
        padding: 0 2px;
        backdrop-filter: none;
    }

    .site-header.scrolled .header-nav .nav-link {
        font-size: 12.5px;
        padding: 4px 11px;
    }

    .site-header.scrolled .header-logo {
        /* background: transparent;
        border-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none; */
        padding: 4px 14px 4px 4px;
    }

    /* TODO(logo-pill): .site-header.scrolled .header-logo:hover { border-color: transparent; } */
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
    position: relative;
    padding: 56px 40px 28px;
    border-top: 1px solid var(--footer-border);
    transition: border-color 0.35s;
    background: var(--nav-scrolled-bg);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    max-width: var(--content-max-width);
    margin: 0 auto 40px;
}

.footer-brand {
    max-width: 260px;
}

.footer-brand img {
    max-width: 100%;
    height: auto;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-muted-glass);
    margin-top: 12px;
    line-height: 1.65;
}

.footer-links-group {
    min-width: 120px;
}

.footer-links-group h6 {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--footer-link-color);
    opacity: 0.60;
    margin-bottom: 14px;
}

.footer-links-group a {
    display: block;
    font-size: 13px;
    color: var(--footer-link-color);
    text-decoration: none;
    margin-bottom: 9px;
    transition: color 0.20s;
}

.footer-links-group a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--footer-section-border);
}

.footer-copy {
    font-size: 12.5px;
    color: var(--footer-copy-color);
}

.footer-legal {
    display: flex;
    gap: 18px;
}

.footer-legal a {
    font-size: 12.5px;
    color: var(--footer-copy-color);
    text-decoration: none;
    transition: color 0.20s;
}

.footer-legal a:hover {
    color: var(--text-muted-glass);
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border-hi);
}


/* ══════════════════════════════════════════════════════════════
   GLOBAL BACKGROUND — blobs, swirl trails, grid
   Used by landing, login, and portal pages.
   ══════════════════════════════════════════════════════════════ */

/* ── Background blobs ────────────────────────────────────────── */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    will-change: transform;
    transition: background 0.45s ease;
}

.blob-1 {
    width: 540px;
    height: 540px;
    background: var(--blob-1-bg);
    top: -180px;
    left: -140px;
    opacity: 0.30;
    animation: blobDrift1 14s ease-in-out infinite;
}

.blob-2 {
    width: 480px;
    height: 480px;
    background: var(--blob-2-bg);
    top: 40px;
    right: -160px;
    opacity: 0.20;
    animation: blobDrift2 17s ease-in-out infinite;
}

.blob-3 {
    width: 360px;
    height: 360px;
    background: var(--blob-3-bg);
    bottom: 8%;
    left: 28%;
    opacity: 0.25;
    animation: blobDrift3 20s ease-in-out infinite;
}

@keyframes blobDrift1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1.00);
    }

    40% {
        transform: translate(50px, -35px) scale(1.07);
    }

    70% {
        transform: translate(-25px, 45px) scale(0.93);
    }
}

@keyframes blobDrift2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1.00);
    }

    35% {
        transform: translate(-40px, 30px) scale(1.08);
    }

    68% {
        transform: translate(30px, -40px) scale(0.92);
    }
}

@keyframes blobDrift3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1.00);
    }

    50% {
        transform: translate(35px, 35px) scale(1.10);
    }
}

/* ── Swirling light trails ───────────────────────────────────── */
.bg-swirl-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bsp {
    fill: none;
    opacity: 0;
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
}

.bsp-1 {
    animation: bsDraw 2.0s cubic-bezier(0.4, 0, 0.2, 1) 0.0s 1 forwards;
}

.bsp-2 {
    animation: bsDraw 2.0s cubic-bezier(0.4, 0, 0.2, 1) 0.6s 1 forwards;
}

.bsp-3 {
    animation: bsDraw 2.2s cubic-bezier(0.4, 0, 0.2, 1) 1.2s 1 forwards;
}

.bsp-4 {
    animation: bsDraw 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s 1 forwards;
}

.bsp-5 {
    animation: bsDraw 2.0s cubic-bezier(0.4, 0, 0.2, 1) 0.9s 1 forwards;
}

@keyframes bsDraw {
    from {
        stroke-dashoffset: 4000;
        opacity: 0;
    }

    to {
        stroke-dashoffset: 0;
        opacity: 0.35;
    }
}




/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — header & nav (global, public + portal)
   ══════════════════════════════════════════════════════════════ */

/* ── Mobile menu toggle (hidden on desktop) ──────────────────── */
.btn-mobile-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border-hi);
    background: var(--surface-subtle);
    color: var(--text-muted-glass);
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.20s, color 0.20s, border-color 0.20s;
    flex-shrink: 0;
}

.btn-mobile-menu:hover,
.btn-mobile-menu[aria-expanded="true"] {
    background: var(--surface-hover);
    border-color: var(--glass-border-hi);
    color: var(--text-primary);
}

/* ── Bottom action bar — JS populates and shows/hides ────────── */
.header-bottom-actions {
    display: none;
}

/* ── 1024px ──────────────────────────────────────────────────── */
@media (max-width: 1023.98px) {
    .site-header {
        padding: 10px;
    }

    .offcanvas {
        width: min(440px, 92vw) !important;
    }
}

/* ── 768px ──────────────────────────────────────────────────── */
@media (max-width: 767.98px) {

    /* hide portal header controls until JS moves them to the bottom bar */
    .header-action-pending {
        display: none !important;
    }

    /* scale down neon orbs on mobile — ambient glow without flooding the screen */
    .blob-1 {
        width: 220px;
        height: 220px;
        opacity: 0.35;
        animation: none;
        transition: none;
    }

    .blob-2 {
        width: 190px;
        height: 190px;
        opacity: 0.30;
        animation: none;
        transition: none;
    }

    .blob-3 {
        width: 160px;
        height: 160px;
        opacity: 0.25;
        animation: none;
        transition: none;
    }

    /* disable swirl-line draw-in flash on mobile — show them settled, no animation */
    .bsp {
        animation: none;
        opacity: 0.35;
        stroke-dashoffset: 0;
    }

    /* switch from 3-col grid to flex so hamburger hits the true right edge */
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        /* backdrop-filter: blur(0px) on the base state creates a stacking context
           that traps the position:fixed flyout nav — must be none on mobile */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-actions {
        gap: 6px;
    }

    .btn-header-cta {
        padding: 7px 14px;
        font-size: 12px;
    }

    /* hide theme toggle on mobile */
    .btn-theme-toggle {
        display: none;
    }

    /* show hamburger */
    .btn-mobile-menu {
        display: flex;
    }

    /* flat background on scroll — NO backdrop-filter on .site-header:
       backdrop-filter creates a stacking context that makes position:fixed
       children (the flyout nav) use .site-header as their containing block,
       giving bottom:56px a wrong reference and collapsing the nav to 0 height. */
    .site-header.scrolled {
        background: var(--nav-scrolled-bg);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.30);
        border-bottom: 1px solid var(--glass-border);
    }

    .site-header.scrolled .header-inner {
        max-width: none;
        padding: 0;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-color: transparent;
        box-shadow: none;
    }

    /* .site-header.scrolled .header-logo {
        background: transparent;
        border-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    } */

    /* TODO(logo-pill): .site-header.scrolled .header-logo:hover { border-color: transparent; } */

    /* frontend nav: make visible so flyout works when .mobile-open is applied */
    .frontend-nav {
        visibility: visible;
    }

    /* search + profile drop to a fixed bottom bar */
    .header-bottom-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 950;
        justify-content: space-between;
        padding: 8px 24px;
        height: 56px;
        background: var(--nav-scrolled-bg);
        backdrop-filter: blur(24px) saturate(200%);
        -webkit-backdrop-filter: blur(24px) saturate(200%);
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    }

    /* profile dropdown opens upward above the bar */
    .header-bottom-actions .dropdown-menu {
        bottom: calc(100% + 6px) !important;
        top: auto !important;
        transform: none !important;
    }

    /* notification menu: centered and full-width, ignoring the trigger's position.
       position:fixed (not absolute) so it's placed relative to the viewport, not the
       narrow .dropdown wrapper Bootstrap makes the positioning context for */
    #notifMenu {
        position: fixed !important;
        top: auto !important;
        bottom: 66px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100vw - 32px) !important;
    }

    /* nav panel: sit above bottom bar */
    .header-nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 57px;
        left: 0;
        right: 0;
        bottom: 56px;
        z-index: 890;
        gap: 2px;
        padding: 12px 16px 16px;
        overflow-y: auto;
        background: var(--nav-scrolled-bg);
        backdrop-filter: blur(24px) saturate(200%);
        -webkit-backdrop-filter: blur(24px) saturate(200%);
        border-bottom: 1px solid var(--glass-border);
        border-radius: 0 0 var(--radius-pill) var(--radius-pill);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
        /* drop-in animation: clipped to nothing, invisible, no interaction */
        clip-path: inset(0 0 100% 0);
        visibility: hidden;
        pointer-events: none;
        transition:
            clip-path 0.32s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.32s step-end;
    }

    .header-nav.mobile-open {
        clip-path: inset(0 0 0% 0);
        visibility: visible;
        pointer-events: auto;
        transition:
            clip-path 0.32s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.32s step-start;
    }

    .header-nav .nav-link {
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 14px;
        width: 100%;
    }

    /* dropdown submenus — stacked inline */
    .header-nav .nav-dropdown {
        width: 100%;
    }

    .header-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 0 16px;
    }

    /* offcanvas full-width */
    .offcanvas {
        width: 100vw !important;
    }

    .offcanvas-header {
        padding: 18px 20px;
    }

    .offcanvas-body {
        padding: 20px;
    }
}

/* ── Footer responsive ───────────────────────────────────────── */
@media (max-width: 767.98px) {
    .site-footer {
        padding: 40px 20px 80px;
    }

    /* Switch to grid — immune to the gap: 28px override from landing.css */
    .footer-top {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px 20px;
    }

    .footer-brand {
        grid-column: 1 / -1;
        max-width: 100%;
    }

    .footer-links-group {
        min-width: 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ── 480px ──────────────────────────────────────────────────── */
@media (max-width: 479.98px) {
    .logo-img {
        height: 28px;
    }

    .btn-header-cta {
        padding: 6px 10px;
        font-size: 11px;
    }

    .header-nav {
        top: 50px;
    }
}

/* ── Grid overlay ────────────────────────────────────────────── */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    pointer-events: none;
}

/* ── Modals ───────────────────────────────────────────────────── */
.modal-backdrop {
    background-color: rgba(0, 8, 20, 0.72) !important;
}

.modal.fade .modal-dialog {
    transform: scale(0.88) translateY(10px);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.34, 1.38, 0.64, 1),
        opacity 0.20s ease;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal .modal-content {
    background: rgba(8, 14, 28, 0.78);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(6, 159, 214, 0.30);
    border-radius: 16px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 40px 80px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(6, 159, 214, 0.10);
    color: var(--text-primary);
    position: relative;
}

.modal .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 159, 214, 0.45), rgba(255, 255, 255, 0.18), transparent);
    pointer-events: none;
    z-index: 1;
}

.modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(6, 159, 214, 0.05);
    padding: 18px 24px;
    position: relative;
    z-index: 1;
}

.modal .modal-title {
    font-family: var(--font-display, inherit);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.modal .modal-body {
    padding: 20px 24px;
    position: relative;
    z-index: 2;
}

.tos-agreement {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted-glass);
}

.tos-agreement h4,
.tos-agreement h5 {
    color: var(--text-primary);
}

.tos-agreement b {
    color: var(--text-primary);
}

.modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 14px 24px;
    position: relative;
    z-index: 1;
}

.modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
    opacity: 0.55;
    transition: opacity 0.15s;
}

.modal .btn-close:hover {
    opacity: 1;
}

.modal {
    --bs-body-bg: transparent;
}

:root[data-theme="light"] .modal-backdrop {
    background-color: rgba(0, 20, 60, 0.40) !important;
}

:root[data-theme="light"] .modal .modal-content {
    background: rgba(240, 244, 252, 0.82);
    border-color: rgba(6, 159, 214, 0.20);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.80) inset,
        0 40px 80px rgba(0, 20, 60, 0.18),
        0 0 40px rgba(6, 159, 214, 0.06);
}

:root[data-theme="light"] .modal .modal-header {
    border-bottom-color: rgba(0, 20, 60, 0.08);
    background: rgba(6, 159, 214, 0.04);
}

:root[data-theme="light"] .modal .modal-footer {
    border-top-color: rgba(0, 20, 60, 0.08);
}

:root[data-theme="light"] .modal .btn-close {
    filter: none;
}