/* =============================================
   BarangaySmartSystem — Landing Page Styles
   Green & White + Dark Mode
   ============================================= */

:root {
    --green: #22c55e;
    --green-dark: #16a34a;
    --green-light: #86efac;
    --green-glow: rgba(34, 197, 94, 0.15);
    --green-glow2: rgba(34, 197, 94, 0.08);

    /* Light Mode */
    --bg: #f0fdf4;
    --bg2: #ffffff;
    --bg3: #f9fafb;
    /* Range extremes: --bg-deep is the darkest band, --bg-invert flips the
       page's polarity for one section so the scroll has real chapters. */
    --bg-deep: #e6f5ec;
    --bg-invert: #0b1512;
    --invert-text: #f0fdf4;
    --invert-text2: #a7d8bf;
    --invert-border: rgba(255,255,255,0.12);
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --text: #111827;
    --text2: #374151;
    --text3: #6b7280;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --mockup-bg: #1e293b;
    --mockup-sidebar: #0f172a;
    --mockup-text: #e2e8f0;
    /* White hero in light mode, with only a trace of tint in the corners so
       the section still has depth rather than reading as flat paper. */
    --hero-gradient: linear-gradient(120deg, #ffffff 0%, #fdfefe 45%, #fbfefc 75%, #f7fdf9 100%);
    /* Darker and stronger than the dark-mode value: a light green particle
       would disappear against the white hero. */
    --hero-dot: rgba(21, 128, 61, 0.50);
    --hero-wash1: rgba(20, 184, 166, 0.07);
    --hero-wash2: rgba(34, 197, 94, 0.07);
}

[data-theme="dark"] {
    --bg: #0a0f0a;
    --bg2: #0d1117;
    --bg3: #111827;
    /* Pushed well below --bg so the deep band reads as a genuine drop, and
       --bg-invert lifts clear of every other surface. */
    --bg-deep: #040705;
    --bg-invert: #14231c;
    --invert-text: #f0fdf4;
    --invert-text2: #a7d8bf;
    --invert-border: rgba(255,255,255,0.10);
    --card-bg: #161d2b;
    --card-border: #1e2d3d;
    --text: #f0fdf4;
    --text2: #d1fae5;
    --text3: #6b7280;
    --nav-bg: rgba(10, 15, 10, 0.95);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --mockup-bg: #1e293b;
    --mockup-sidebar: #0f172a;
    --mockup-text: #e2e8f0;
    --hero-gradient: linear-gradient(120deg, #06141a 0%, #08201f 38%, #0a2420 62%, #071a12 100%);
    --hero-dot: rgba(74, 222, 128, 0.40);
    --hero-wash1: rgba(45, 212, 191, 0.13);
    --hero-wash2: rgba(34, 197, 94, 0.11);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ============ BUTTONS ============ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--green);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(34,197,94,0.4); }
.btn-primary.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 10px; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    /* Inherited so a <button> matches the <a> variants of this class */
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-ghost.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 10px; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--green);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1.5px solid var(--green);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}
.btn-outline:hover { background: var(--green); color: #fff; }

/* ============ SECTION HEADER ============ */
.section-header {
    text-align: center;
    margin-bottom: 56px;
}
.section-header h2 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.2;
}
.section-header p {
    font-size: 16px;
    color: var(--text3);
    max-width: 600px;
    margin: 0 auto;
}
.section-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--green-glow);
    color: var(--green);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    border: 1px solid rgba(34,197,94,0.2);
}
.text-green { color: var(--green); }
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    transition: gap 0.2s;
}
.read-more:hover { gap: 10px; }

/* ============ NAVBAR ============ */
/* Transparent-to-solid header: bare over the hero, then fades to the solid
   blurred bar once .scrolled is set (main.js toggles it past 20px).
   Transitions are listed explicitly rather than `all` so the backdrop filter
   does not animate, which is expensive and flickers in some browsers. */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.navbar.scrolled,
/* An open mobile menu always needs the solid bar behind it, even at scroll 0 */
.navbar:has(.nav-links.open) {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--card-border);
    box-shadow: var(--shadow);
}
.navbar .container {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 64px;
}
.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
/* Wrapping link. `display: block` stops the inline box adding descender
   space below the image, which would push the logo off centre in the bar. */
.brand-link {
    display: block;
    line-height: 0;
}
/* The logo is a wide 4.88:1 lockup, so height drives how large it reads.
   The bar is 64px tall, which leaves room for 46px without crowding. */
.nav-logo {
    height: 46px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.85; }
.footer-logo { height: 54px; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0 auto;
}
.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text3);
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--green); }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--green); color: var(--green); }
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ============ HERO ============ */
.hero {
    /* Fills the viewport on tall screens; on short ones (1366x768 and similar)
       it sizes to its content instead of cropping the stats row. */
    min-height: 100svh;
    height: auto;
    display: flex;
    flex-direction: column;
    /* Not centred: the main grid absorbs any surplus height (see .hero > .container
       below) so the stats row stays anchored to the bottom of the section
       instead of floating with dead space beneath it. */
    justify-content: flex-start;
    background: var(--hero-gradient);
    /* Padding scales with viewport height so short screens reclaim the space */
    padding: clamp(84px, 11vh, 116px) 0 clamp(28px, 5vh, 56px);
    position: relative;
    overflow: hidden;
}
/* Takes the leftover vertical space and keeps its own content centred within it */
.hero > .container {
    flex: 1 0 auto;
    align-content: center;
}
/* Teal and green corner washes. These sit on top of the flat linear gradient
   so the blend reads as light rather than as a visible band across the hero. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 8% 12%, var(--hero-wash1) 0%, transparent 62%),
        radial-gradient(ellipse 65% 65% at 95% 88%, var(--hero-wash2) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* Animated particle field, drawn by main.js. Masked radially so it dissolves
   toward the edges rather than stopping at a hard boundary. Sits under
   .hero-glow and the content. */
.hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 45%, #000 40%, transparent 92%);
    mask-image: radial-gradient(ellipse 95% 80% at 50% 45%, #000 40%, transparent 92%);
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    z-index: 3;
}
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--green-glow);
    color: var(--green);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    border: 1px solid rgba(34,197,94,0.25);
}
.hero-title {
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text);
}
.hero-desc {
    font-size: 16px;
    color: var(--text3);
    margin-bottom: clamp(20px, 3.5vh, 32px);
    max-width: 480px;
    line-height: 1.7;
}
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.hero-social-proof {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text3);
}
.avatar-stack {
    display: flex;
}
/* Sprite: assets/img/sprite_user.jpg is a 5x2 grid (1408x768) of ten
   barangay official headshots — cells are 281.6x384.
   Each face sits inside a white photo frame with a grey surround, so the
   sprite is scaled well past 500%/200% (to 690%/300%) and nudged down. That
   crops through the frame and mat, leaving only the face inside the circle. */
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    margin-left: -9px;
    flex-shrink: 0;
    display: block;
    background-image: url("../img/sprite_user.jpg");
    background-size: 820% 355%;
    background-repeat: no-repeat;
    background-color: var(--card-bg);
}
.avatar:first-child { margin-left: 0; }

/* Column steps of 25% across, row steps of 100% down, with a vertical offset
   that centres the face rather than the frame. */
/* Vertical offsets are computed, not eyeballed. Measured from the sprite:
   row 1 heads start 20.3% into their cell, row 2 heads 11.6% — so the rows
   need different offsets or row 1 is clipped at the crown.
   At background-size 820%/355% on a 34px circle the sprite renders 279x121px
   (each row 60.3px), which puts the crown ~4px below the circle top at
   9.5% for row 1 and 73.1% for row 2. */
.av-0 { background-position: 7%  9.5%; }
.av-1 { background-position: 28% 9.5%; }
.av-2 { background-position: 50% 9.5%; }
.av-3 { background-position: 72% 9.5%; }
.av-4 { background-position: 93% 9.5%; }
.av-5 { background-position: 7%  73%; }
.av-6 { background-position: 28% 73%; }
.av-7 { background-position: 50% 73%; }
.av-8 { background-position: 72% 73%; }
.av-9 { background-position: 93% 73%; }
.hero-social-proof strong { color: var(--text); }
.hero-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%);
    z-index: 2;
    pointer-events: none;
}

/* ---- Dashboard Mockup ---- */
/* The hero artwork is a cut-out photo on a transparent background, so it gets
   no card frame — a border-radius or box-shadow here would draw a rectangle
   around a subject that has no rectangular edge.
   model2.png is 1233x1080 (ratio 1.14) and the figure runs to the bottom edge,
   so the mask fades it out rather than leaving a hard horizontal cut.
   The source has ~294px of empty space on the left against ~120px on the
   right, so a negative right margin re-centres the visible figure in its
   column instead of leaving it pushed toward the copy.
   NOTE: `filter: drop-shadow` and `mask-image` must not sit on the same
   element — the filter renders before the mask and produces a visible
   rectangular haze. The mask goes on the image; no shadow is used. */
.dashboard-mockup {
    animation: float 6s ease-in-out infinite;
    line-height: 0;
    position: relative;
    /* Wider than its column so the taller figure still reads at a natural
       size once the viewport-height ceiling kicks in. */
    width: 122%;
    margin-right: -14%;
}
.dashboard-mock-img {
    width: 100%;
    height: auto;
    /* Ceiling tied to viewport height so a short screen shrinks the figure
       instead of pushing the stats row below the fold. */
    max-height: 62vh;
    object-fit: contain;
    display: block;
    margin-left: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 98%);
    mask-image: linear-gradient(to bottom, #000 82%, transparent 98%);
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
/* ============ UNIFIED ============ */
/* ============ ADVANTAGE ============ */
.advantage {
    padding: 100px 0;
    /* --bg2 keeps this distinct from the before/after section directly above */
    background: var(--bg2);
}

/* Alternating photo rows. The supplied photos are 1408x768 landscape, so each
   gets roughly half the container rather than a small card panel — cropped
   narrower they lose the detail that makes them worth showing. */
.advantage-rows {
    display: grid;
    gap: 72px;
}
.adv-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}
/* Second row mirrors the first so the eye zigzags down the section */
.adv-row.reverse .adv-media { order: 2; }

.adv-media {
    position: relative;
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
    /* Locks the frame to the source ratio so the image never letterboxes */
    aspect-ratio: 1408 / 768;
    background: var(--bg3);
}
.adv-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}
.adv-row:hover .adv-media img { transform: scale(1.03); }

/* Badge sits on the photo. A gradient scrim behind it keeps the label legible
   whatever the photo happens to be doing in that corner. */
.adv-media::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 96px;
    background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
    pointer-events: none;
}
.adv-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.95);
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #15803d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.adv-tag i { font-size: 11px; }

.adv-copy h3 {
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.25;
}
.adv-copy p {
    font-size: 15px;
    color: var(--text3);
    line-height: 1.75;
    margin-bottom: 22px;
}
.advantage-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 18px;
}
.advantage-icon.green { background: rgba(34,197,94,0.1); color: var(--green); }
.advantage-icon.blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.advantage-list { list-style: none; display: grid; gap: 11px; }
.advantage-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text2);
}
.advantage-list i {
    flex-shrink: 0;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--green-glow);
    color: var(--green);
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 860px) {
    .advantage-rows { gap: 52px; }
    .adv-row { grid-template-columns: 1fr; gap: 26px; }
    /* Photo always leads on narrow screens, whichever row it is */
    .adv-row.reverse .adv-media { order: 0; }
}

/* ============ TRUSTED ============ */
/* The logo strip now lives inside the hero, so it carries no background or
   borders of its own — it sits on the hero gradient as one continuous section,
   separated only by a hairline rule above it. */
/* Stats row closing the hero. Sits on the hero gradient with only a hairline
   rule above it, so the hero reads as one section. */
.hero-stats {
    position: relative;
    z-index: 3;
    margin-top: clamp(32px, 5vh, 64px);
    padding-top: clamp(24px, 3.5vh, 36px);
    border-top: 1px solid var(--card-border);
}
/* The hero's .container is a 2-column grid; this one is its own flex row. */
.hero-stats .container {
    display: block;
}
.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px 0;
    /* Keeps the last stat clear of the floating chat button, which sits at
       the bottom-right of the viewport and would otherwise cover it. */
    padding-right: 150px;
}
.stat {
    /* 130px basis lets five sit in one row on a laptop and wrap cleanly
       below that, rather than forcing a cramped five-across at every width. */
    flex: 1 1 130px;
    text-align: center;
    padding: 0 12px;
    position: relative;
}
/* Hairline divider between figures, drawn on the left edge of every stat
   except the first so the row reads as one grouped set. */
.stat + .stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 54px;
    background: var(--card-border);
}
.stat-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1px;
    font-size: clamp(26px, 3.2vw, 40px);
    font-weight: 900;
    line-height: 1.05;
    color: var(--text);
    /* Reserves the digits' width so the row does not jitter while counting */
    font-variant-numeric: tabular-nums;
}
.stat-suffix { color: var(--green); }
.stat-label {
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--text3);
    line-height: 1.4;
    letter-spacing: 0.2px;
}
/* ============ FEATURES ============ */
.features {
    padding: 100px 0;
    background: var(--bg);
}
/* Bento: a 6-column bed where cards claim differing widths, so the block
   reads as a composed layout rather than six identical boxes.
   Rows 1-2: hero (3 wide, 2 tall) + Blotter (3) / Budget (3).
   Row 3:    Demographics (2) + ID (2) + Inventory (2). */
.features-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}
/* Default span keeps the bottom row of three even */
.features-grid > .feature-card { grid-column: span 2; }
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(34,197,94,0.4); }

/* The featured card: spans 2 columns and both of the first two rows */
.feature-card.fc-hero {
    grid-column: span 3;
    grid-row: span 2;
    padding: 36px;
    background:
        radial-gradient(ellipse 90% 70% at 15% 0%, var(--green-glow2) 0%, transparent 60%),
        var(--card-bg);
    border-color: rgba(34,197,94,0.28);
}
/* No flex:1 here — letting the body grow leaves a dead gap above the
   preview. The preview sits directly under the copy instead. */
.fc-hero-body { flex: 0 0 auto; }
.feature-card.fc-hero .feature-icon {
    width: 52px; height: 52px;
    font-size: 21px;
    border-radius: 13px;
    margin-bottom: 20px;
}
.feature-card.fc-hero h3 { font-size: 24px; margin-bottom: 14px; }
.feature-card.fc-hero p { font-size: 14.5px; line-height: 1.75; margin-bottom: 20px; }
/* Grows to absorb the hero card's extra height, so the taller 2-row card
   does not end with dead space below its preview panel. */
.fc-hero-preview {
    margin-top: 24px;
    flex: 1;
    justify-content: center;
    gap: 10px;
}

/* Wide cards: the two that sit beside the hero, each half its height */
.feature-card.fc-wide { grid-column: span 3; }
/* Side by side on a wide card so the row keeps its height */
.feature-card.fc-wide .feature-preview {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 20px;
}
.feature-card.fc-wide .preview-row { flex: 0 0 auto; }
.feature-icon {
    width: 44px; height: 44px;
    background: var(--green-glow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 18px;
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.feature-card p { font-size: 13px; color: var(--text3); margin-bottom: 16px; line-height: 1.6; }
/* Pushes the preview panel to the card's bottom so panels line up across a
   row even when the copy above them differs in length */
.feature-card .read-more { margin-top: auto; }
.feature-preview {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.preview-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text3);
}
.dot-green { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.dot-yellow { width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; flex-shrink: 0; }
.dot-red { width: 6px; height: 6px; border-radius: 50%; background: #f87171; flex-shrink: 0; }
.dot-blue { width: 6px; height: 6px; border-radius: 50%; background: #60a5fa; flex-shrink: 0; }
.dot-blue2 { width: 6px; height: 6px; border-radius: 50%; background: #60a5fa; flex-shrink: 0; }
.feature-preview.chart-mini {
    flex-direction: row;
    align-items: flex-end;
    height: 60px;
    gap: 4px;
    padding: 8px 12px 4px;
}
.mini-bar {
    flex: 1;
    background: rgba(34,197,94,0.25);
    border-radius: 3px 3px 0 0;
}
.mini-bar.active { background: var(--green); }

/* Stock / attendance meters — used by Inventory & Events so it does not
   repeat the bar chart that Demographics Dashboard already uses. */
.feature-preview.stock-mini {
    gap: 9px;
    padding: 12px;
}
.stock-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    color: var(--text3);
}
.stock-name {
    flex: 0 0 84px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stock-meter {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    /* Theme token rather than a white overlay, so the track is visible on
       the light background too. */
    background: var(--card-border);
    overflow: hidden;
}
.stock-meter i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--green);
}
/* Amber signals a level worth restocking */
.stock-meter i.low { background: #fbbf24; }
.stock-qty {
    flex: 0 0 auto;
    min-width: 26px;
    text-align: right;
    font-weight: 700;
    color: var(--text2);
    font-variant-numeric: tabular-nums;
}

/* ============ HOW IT WORKS ============ */
/* Alternating timeline: steps zigzag above and below a horizontal rail, with
   a dashed connector dropping from each card to its marker on the line.
   Reveals 1 -> 4 in sequence via .is-shown. */
.howto {
    padding: 100px 0;
    background: var(--bg2);
}

/* Four-colour accent bar under the section heading */
.accent-bar {
    display: flex;
    width: 200px;
    height: 4px;
    margin: -28px auto 60px;
    border-radius: 2px;
    overflow: hidden;
}
.ab { flex: 1; }
/* Fades in toward full brand green, previewing the progression below */
.ab.g1 { background: var(--green); opacity: 0.3; }
.ab.g2 { background: var(--green); opacity: 0.5; }
.ab.g3 { background: var(--green); opacity: 0.75; }
.ab.g4 { background: var(--green); }

.howto-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 20px;
    position: relative;
    /* Room for a card above and below the rail */
    padding: 0;
    align-items: center;
    min-height: 420px;
}
/* The rail, running the full width behind the markers */
.howto-steps::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--card-border);
    transform: translateY(-50%);
    z-index: 0;
}
/* Terminal dots at both ends of the rail, echoing the reference.
   Drawn as two radial gradients on one pseudo-element so the rail keeps
   ::before for itself. */
.howto-steps::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -7px;
    right: -7px;
    height: 14px;
    transform: translateY(-50%);
    background:
        radial-gradient(circle 7px at 7px 50%, var(--card-border) 99%, transparent 100%),
        radial-gradient(circle 7px at calc(100% - 7px) 50%, var(--card-border) 99%, transparent 100%);
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
}

.howto-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: center;
    /* Hidden until its turn */
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.howto-steps.is-shown .howto-step { opacity: 1; transform: translateY(0); }
.howto-steps.is-shown .howto-step:nth-child(1) { transition-delay: 0s; }
.howto-steps.is-shown .howto-step:nth-child(2) { transition-delay: 0.2s; }
.howto-steps.is-shown .howto-step:nth-child(3) { transition-delay: 0.4s; }
.howto-steps.is-shown .howto-step:nth-child(4) { transition-delay: 0.6s; }

/* up = card sits above the rail, marker below it; down = the reverse */
.howto-step.up   { justify-content: flex-start; }
.howto-step.down { justify-content: flex-end; }

.step-card {
    text-align: center;
    padding: 0 6px;
}
.step-card h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
}
.step-card p {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text3);
    margin: 0;
}

/* Circular numbered marker sitting on the rail */
.step-marker {
    flex-shrink: 0;
    width: 46px; height: 46px;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ring hides the rail passing behind the circle */
    outline: 7px solid var(--bg2);
    position: relative;
}
/* Dashed connector between card and marker */
.step-marker::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 0;
    border-left: 1px dashed var(--card-border);
    transform: translateX(-50%);
}
.howto-step.up   .step-marker::before { bottom: 100%; height: 26px; }
.howto-step.down .step-marker::before { top: 100%;    height: 26px; }
/* Space between the card and the rail */
.howto-step.up   .step-card { margin-bottom: 26px; }
.howto-step.down .step-card { margin-top: 26px; }

/* Per-step colour, matching the accent bar */
/* Green progression, brightening toward the final step so the sequence reads
   as building to a result. Steps 1-3 are outlined; only the last step is a
   filled brand-green circle, which makes the payoff land.
   Headings stay in the normal text colour — the markers carry the sequence. */
.s-1 .step-marker,
.s-2 .step-marker,
.s-3 .step-marker {
    background: var(--card-bg);
    border: 2px solid var(--green);
    color: var(--green);
}
.s-1 .step-marker { opacity: 0.62; }
.s-2 .step-marker { opacity: 0.78; }
.s-3 .step-marker { opacity: 0.9; }
.s-4 .step-marker {
    background: var(--green);
    border: 2px solid var(--green);
    color: #fff;
    box-shadow: 0 6px 20px rgba(34,197,94,0.45);
}
.step-card h3 { color: var(--text); }

/* Continuous bounce on the markers.
   It sits on .step-marker rather than .howto-step because the step itself
   uses transform for its entrance reveal — animating the same property on
   the same element would fight that transition.
   The delays are staggered by the same 0.2s as the reveal, so the motion
   travels left-to-right along the rail like a wave, and only starts once
   .is-shown has been applied. */
.howto-steps.is-shown .step-marker {
    animation: step-bounce 2.4s ease-in-out infinite;
}
.howto-steps.is-shown .s-1 .step-marker { animation-delay: 0s; }
.howto-steps.is-shown .s-2 .step-marker { animation-delay: 0.2s; }
.howto-steps.is-shown .s-3 .step-marker { animation-delay: 0.4s; }
.howto-steps.is-shown .s-4 .step-marker { animation-delay: 0.6s; }

@keyframes step-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* The dashed connector is anchored to the marker, so it stretches and
   squashes with the bounce unless it compensates. */
.howto-steps.is-shown .step-marker::before {
    animation: step-tether 2.4s ease-in-out infinite;
}
/* Delays repeated explicitly — a pseudo-element does not inherit its host's
   animation-delay. */
.howto-steps.is-shown .s-1 .step-marker::before { animation-delay: 0s; }
.howto-steps.is-shown .s-2 .step-marker::before { animation-delay: 0.2s; }
.howto-steps.is-shown .s-3 .step-marker::before { animation-delay: 0.4s; }
.howto-steps.is-shown .s-4 .step-marker::before { animation-delay: 0.6s; }
@keyframes step-tether {
    0%, 100% { transform: translateX(-50%) scaleY(1); }
    50%      { transform: translateX(-50%) scaleY(1.22); }
}
.howto-step.up   .step-marker::before { transform-origin: bottom center; }
.howto-step.down .step-marker::before { transform-origin: top center; }

/* The two ways a QR can be scanned, on step 3 */
.step-branch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--card-border);
}
.step-branch span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
}
.step-branch i { font-size: 10px; color: var(--green); }
.step-branch .branch-or { color: var(--text3); font-weight: 500; font-style: italic; }

/* Reduced motion: show everything at once, and hold the markers still.
   A continuous infinite bounce is exactly the kind of motion this preference
   exists to stop, so it is switched off entirely rather than slowed. */
@media (prefers-reduced-motion: reduce) {
    .howto-step { opacity: 1; transform: none; transition: none; }
    .howto-steps.is-shown .howto-step { transition-delay: 0s; }
    .howto-steps.is-shown .step-marker,
    .howto-steps.is-shown .step-marker::before { animation: none; }
}

/* ============ INNOVATION ============ */
/* Pattern break #1: the deepest band on the page, with a left-aligned header
   instead of the centered one every other section uses. */
.innovation {
    padding: 110px 0;
    background: var(--bg-deep);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}
.innovation .section-header {
    text-align: left;
    max-width: 940px;
    margin: 0 auto 44px;
}
.innovation .section-header p { margin: 0; max-width: 560px; }
/* ---- Before / After comparison ---- */
.ba-legend {
    display: grid;
    grid-template-columns: 1fr 56px 1fr;
    gap: 16px;
    max-width: 940px;
    margin: 0 auto 20px;
}
.ba-legend-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.ba-legend-item.before {
    background: var(--bg3);
    border: 1px solid var(--card-border);
    color: var(--text3);
}
.ba-legend-item.after {
    background: var(--green-glow);
    border: 1px solid rgba(34,197,94,0.35);
    color: var(--green);
}
.ba-legend-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 13px;
    opacity: 0.5;
}

.ba-list {
    display: grid;
    gap: 14px;
    max-width: 940px;
    margin: 0 auto;
}
.ba-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 56px 1fr;
    gap: 16px;
    align-items: stretch;
    counter-increment: ba-counter;
}
.ba-list { counter-reset: ba-counter; }
/* Large ghosted index number sitting outside the left column */
.ba-row::before {
    content: "0" counter(ba-counter);
    position: absolute;
    left: -54px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 800;
    color: var(--text3);
    opacity: 0.45;
    letter-spacing: 0.5px;
}
.ba-side {
    position: relative;
    padding: 22px 24px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    transition: border-color 0.25s, transform 0.25s;
}
.ba-side p {
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}
/* The "before" side is deliberately muted — it is the state you are leaving */
.ba-side.before {
    background: var(--bg3);
}
.ba-side.before p { color: var(--text3); }
.ba-side.after {
    background: var(--card-bg);
    border-color: rgba(34,197,94,0.3);
}
.ba-side.after p { color: var(--text2); }
.ba-row:hover .ba-side.after {
    border-color: var(--green);
    transform: translateY(-2px);
}
.ba-tag {
    display: none;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.ba-mid {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 14px;
    opacity: 0.55;
}

/* ============ TESTIMONIALS ============ */
/* Two columns: heading and controls on the left, one quote card on the right
   that slides between reviews. */
.testimonials {
    padding: 100px 0;
    background: var(--bg2);
}
.testi-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 64px;
    align-items: center;
}
.testi-intro h2 {
    font-size: clamp(28px, 3.6vw, 40px);
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin: 4px 0 14px;
}
.testi-intro > p {
    font-size: 15px;
    color: var(--text3);
    line-height: 1.7;
    margin-bottom: 28px;
}

/* Prev / next */
.testi-nav { display: flex; gap: 10px; }
.testi-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.testi-btn:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    transform: translateY(-2px);
}
.testi-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* Stage clips the track; the track slides one card width at a time. */
.testi-stage { position: relative; overflow: hidden; }
.testi-track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}
.testi-card {
    flex: 0 0 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 38px 38px 30px;
    position: relative;
    /* Inactive cards fade back so the current one reads as the focus */
    opacity: 0.35;
    transition: opacity 0.45s ease;
}
.testi-card.is-active { opacity: 1; }
/* Decorative quote mark */
.testi-card::before {
    content: "\201C";
    position: absolute;
    top: 10px; right: 28px;
    font-size: 78px;
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--green);
    opacity: 0.16;
    pointer-events: none;
}
.testi-card .stars {
    color: #fbbf24;
    font-size: 15px;
    letter-spacing: 2px;
    margin-bottom: 18px;
}
.testi-card p {
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--text2);
    font-style: italic;
    margin-bottom: 26px;
}

.testi-author {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}
/* Initials rather than a photo — the hero keeps the sprite faces. */
.testi-avatar {
    flex-shrink: 0;
    width: 46px; height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
    /* The background colours are light, so dark text keeps the contrast */
    color: #0b1512;
}
.testi-author strong {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
}
.testi-role { font-size: 12.5px; color: var(--text3); }
.testi-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 100px;
    background: var(--green-glow);
    border: 1px solid rgba(34,197,94,0.3);
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}
.testi-badge i { font-size: 10px; }

/* Dots */
.testi-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
}
.testi-dot {
    width: 8px; height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--card-border);
    cursor: pointer;
    transition: width 0.3s, background 0.3s;
}
.testi-dot.is-active { width: 26px; border-radius: 4px; background: var(--green); }
.testi-dot:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

@media (max-width: 900px) {
    .testi-grid { grid-template-columns: 1fr; gap: 34px; }
    /* The <br> is preceded by a real space in the markup, so hiding it here
       lets the heading wrap naturally without joining the words. */
    .testi-intro h2 br { display: none; }
    .testi-card { padding: 30px 26px 24px; }
    /* Badge would crowd the name on a narrow card */
    .testi-badge { display: none; }
}

/* ============ FAQ ============ */
.faq {
    padding: 100px 0;
    /* --bg3 keeps this distinct from .testimonials above, which is --bg2 */
    background: var(--bg3);
}
.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: grid;
    gap: 12px;
}
.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.faq-item[open] {
    border-color: rgba(34,197,94,0.45);
    box-shadow: var(--shadow);
}
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    transition: color 0.2s;
}
/* Hide the native disclosure marker in both engines */
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary:hover { color: var(--green); }
.faq-item summary i {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--green);
    transition: transform 0.25s;
}
.faq-item[open] summary i { transform: rotate(180deg); }
.faq-answer {
    padding: 0 24px 20px;
    border-top: 1px solid var(--card-border);
    padding-top: 16px;
    margin-top: -1px;
}
.faq-answer p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text3);
}

/* ============ REQUEST DEMO ============ */
.demo {
    padding: 100px 0;
    background: var(--bg);
}
.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 64px;
    align-items: start;
}
.demo-intro h2 {
    font-size: clamp(26px, 3.2vw, 38px);
    font-weight: 800;
    color: var(--text);
    margin: 16px 0;
    line-height: 1.2;
}
.demo-intro > p {
    font-size: 15px;
    color: var(--text3);
    line-height: 1.7;
    margin-bottom: 28px;
}
.demo-points {
    list-style: none;
    display: grid;
    gap: 14px;
    margin-bottom: 28px;
}
.demo-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text2);
}
.demo-points i {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--green-glow);
    color: var(--green);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--text3);
}
.demo-contact i { color: var(--green); margin-right: 6px; }

/* ---- Form ---- */
.demo-form {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-field { margin-bottom: 16px; }
.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 7px;
}
.form-field label span { color: var(--green); }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg3);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field textarea { resize: vertical; min-height: 84px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow2);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text3); }
.form-field.invalid input,
.form-field.invalid select,
.form-field.invalid textarea { border-color: #ef4444; }
.field-error {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: #ef4444;
}
.form-field.invalid .field-error { display: block; }

/* Honeypot stays in the layout for bots but never shown to people */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

.demo-submit {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    border: none;
    font-family: inherit;
    cursor: pointer;
}
.demo-submit[disabled] { opacity: 0.65; cursor: not-allowed; }
.form-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text3);
    line-height: 1.6;
    text-align: center;
}
.form-status {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.6;
}
.form-status.show { display: block; }
.form-status.success {
    background: var(--green-glow);
    border: 1px solid rgba(34,197,94,0.4);
    color: var(--green);
}
.form-status.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.4);
    color: #ef4444;
}

/* ============ CHAT LAUNCHER & MODAL ============ */
.chat-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(34,197,94,0.4);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.chat-fab:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(34,197,94,0.5);
}
.chat-fab i { font-size: 17px; }
/* Slow attention pulse, stopped once the modal has been opened */
.chat-fab::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 100px;
    border: 2px solid var(--green);
    animation: fab-pulse 2.8s ease-out infinite;
    pointer-events: none;
}
.chat-fab.seen::after { display: none; }
@keyframes fab-pulse {
    0%   { opacity: 0.7; transform: scale(1); }
    70%  { opacity: 0;   transform: scale(1.35); }
    100% { opacity: 0;   transform: scale(1.35); }
}

/* `display: flex` here beats the UA's [hidden] { display: none }, so the
   closed overlay would otherwise sit invisibly over the page and swallow
   every click. Keep this rule directly alongside it. */
.modal-overlay[hidden] { display: none !important; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow-y: auto;
}
.modal-overlay.open { opacity: 1; }
.modal-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    transform: translateY(14px) scale(0.985);
    transition: transform 0.25s ease;
}
.modal-overlay.open .modal-panel { transform: translateY(0) scale(1); }
.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--bg3);
    color: var(--text3);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: var(--green); border-color: var(--green); }
/* ---- Video modal ---- */
/* Wider than the form modal and transparent: the video is the panel, so the
   only chrome is the close button floating above its corner. */
.video-panel {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: auto;
    transform: translateY(14px) scale(0.985);
    transition: transform 0.25s ease;
}
.modal-overlay.open .video-panel { transform: translateY(0) scale(1); }
.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.video-frame video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}
.video-close {
    top: -46px;
    right: 0;
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
}
.video-close:hover { background: rgba(255,255,255,0.2); color: #fff; border-color: #fff; }

@media (max-width: 600px) {
    .video-close { top: -42px; }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    padding-right: 40px;
}
.modal-avatar {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--green-glow);
    color: var(--green);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-head h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.modal-head p { font-size: 13.5px; color: var(--text3); line-height: 1.6; }
/* The modal supplies its own surface, so the form drops its card styling */
.demo-form.modal-form {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

@media (max-width: 600px) {
    .chat-fab { right: 16px; bottom: 16px; padding: 13px 18px; }
    .chat-fab span { display: none; }
    .chat-fab i { font-size: 19px; }
    .modal-overlay { padding: 12px; }
    .modal-panel { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .chat-fab::after { animation: none; }
    .modal-overlay, .modal-panel { transition: none; }
}

/* ============ FOOTER ============ */
.footer {
    background: var(--bg2);
    border-top: 1px solid var(--card-border);
    padding: 64px 0 0;
}
/* Two columns now that the dead Product/Company link lists are gone */
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 64px;
    padding-bottom: 48px;
}
.footer-brand p { font-size: 13px; color: var(--text3); margin-top: 12px; margin-bottom: 20px; line-height: 1.7; }
/* Labelled contact rows rather than bare icons — a lone icon gives no clue
   where it goes, and there are only two destinations to show. */
.footer-contact { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text3);
    transition: color 0.2s;
}
.contact-link i {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: border-color 0.2s, color 0.2s;
}
.contact-link:hover { color: var(--green); }
.contact-link:hover i { border-color: var(--green); color: var(--green); }
.footer-newsletter h4 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.footer-newsletter p { font-size: 13px; color: var(--text3); margin-bottom: 16px; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
.newsletter-form input:focus { border-color: var(--green); }
.newsletter-form input::placeholder { color: var(--text3); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid var(--card-border);
    font-size: 13px;
    color: var(--text3);
    flex-wrap: wrap;
    gap: 12px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text3); transition: color 0.2s; font-size: 13px; }
.footer-links a:hover { color: var(--green); }

/* ============ LEGAL PAGES ============ */
.legal {
    padding: 140px 0 100px;
    background: var(--bg);
}
.legal-head {
    max-width: 760px;
    margin: 0 auto 40px;
}
.legal-head h1 {
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 800;
    color: var(--text);
    margin: 4px 0 10px;
    line-height: 1.2;
}
.legal-head > p { font-size: 14px; color: var(--text3); }
.legal-body {
    max-width: 760px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px;
}
.legal-intro {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text2);
    padding-bottom: 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}
.legal-body h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 30px 0 12px;
}
.legal-body p {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text3);
    margin-bottom: 14px;
}
.legal-body strong { color: var(--text2); font-weight: 600; }
.legal-body a { color: var(--green); text-decoration: underline; }
.legal-body ul {
    list-style: none;
    margin: 0 0 16px;
    display: grid;
    gap: 10px;
}
.legal-body li {
    position: relative;
    padding-left: 22px;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text3);
}
.legal-body li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
}
/* Advisory note — this is guidance, not vetted legal text */
.legal-note {
    display: flex;
    gap: 14px;
    margin-top: 34px;
    padding: 18px 20px;
    background: var(--green-glow2);
    border: 1px solid rgba(34,197,94,0.28);
    border-radius: 12px;
}
.legal-note i { color: var(--green); font-size: 15px; margin-top: 2px; flex-shrink: 0; }
.legal-note p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text3); }
.legal-back {
    display: inline-flex;
    margin: 36px auto 0;
    /* The container is not flex, so auto margins alone will not centre this */
    justify-content: center;
}
.legal .container { text-align: center; }
.legal-head, .legal-body { text-align: left; }

@media (max-width: 600px) {
    .legal { padding: 110px 0 70px; }
    .legal-body { padding: 26px 22px; }
}

/* ============ SCROLL ANIMATIONS ============ */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .hero .container { grid-template-columns: 1fr; gap: 48px; }
    .hero-visual { order: -1; }
    /* Stacked layout has no adjacent column to lean into */
    .dashboard-mockup { width: 100%; margin-left: 0; margin-right: 0; }
    .footer-grid { gap: 40px; }
}

@media (max-width: 768px) {
    /* The bar's own layout. `gap: 32px` and the auto margin on .nav-links are
       sized for the desktop row; with the links hidden they leave a dead gap
       in the middle and crowd the hamburger against the screen edge. */
    .navbar .container { gap: 12px; }
    .nav-brand { margin-right: auto; }
    .nav-logo { height: 38px; }

    /* Dropdown panel. --nav-bg is 95% alpha, which is fine over an already
       solid bar but lets the hero show through when the navbar is still
       transparent at scroll 0 — so this panel carries its own opaque fill. */
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 64px; left: 0; right: 0;
        margin: 0;
        background: var(--card-bg);
        padding: 8px 20px 14px;
        gap: 0;
        border-bottom: 1px solid var(--card-border);
        box-shadow: var(--shadow-lg);
    }
    .nav-links.open { display: flex; }
    .nav-links li + li { border-top: 1px solid var(--card-border); }
    .nav-links a {
        display: block;
        padding: 13px 4px;
        font-size: 15px;
        color: var(--text2);
    }
    .hamburger { display: flex; }
    .nav-actions { gap: 6px; }
    .nav-actions .btn-primary { display: none; }

    /* ---- Touch targets ----
       Anything tappable needs roughly 44px of reachable height. Where the
       visible element is smaller, padding or a ::after overlay extends the
       hit area without changing how the control looks. */
    .hamburger {
        width: 44px; height: 44px;
        align-items: center;
        justify-content: center;
    }
    .theme-toggle { width: 44px; height: 44px; }

    /* Inline text links: vertical padding is what actually grows the hit box.
       An absolutely-positioned ::after overlay does NOT work here — these are
       inline-flex, and real taps outside the visual box still miss. Negative
       margin cancels the layout space the padding would otherwise add. */
    .read-more,
    .contact-link,
    .footer-links a {
        padding-top: 12px;
        padding-bottom: 12px;
        margin-top: -12px;
        margin-bottom: -12px;
    }

    .newsletter-form input,
    .newsletter-form button { min-height: 44px; }
    .form-field input,
    .form-field select,
    .form-field textarea { min-height: 44px; }

    .demo-grid { grid-template-columns: 1fr; gap: 40px; }
    /* Five across gets cramped here and wraps to a lopsided 4+1, so the row
       goes three-up instead: a balanced 3+2. */
    .stats-row { padding-right: 0; }
    .stat { flex: 1 1 28%; }
    .stat + .stat::before { display: none; }
    .stat:nth-child(3n+2)::before,
    .stat:nth-child(3n+3)::before { display: block; }

    /* Two-up; the rail and arrows only read as a timeline in a single row */
    /* Below this width the zigzag stops reading as a timeline: the rail is
       dropped and every step becomes a normal top-to-bottom card. */
    .howto-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px 20px;
        min-height: 0;
        align-items: start;
    }
    .howto-steps::before,
    .howto-steps::after { display: none; }
    .howto-step,
    .howto-step.up,
    .howto-step.down {
        flex-direction: column;
        justify-content: flex-start;
        height: auto;
    }
    /* Marker first, card under it, in every case */
    .howto-step.up .step-marker { order: -1; }
    .howto-step.up .step-card,
    .howto-step.down .step-card { margin: 14px 0 0; }
    .step-marker::before { display: none; }
    .step-marker { outline-width: 0; }

    /* Stacked: the legend no longer heads each column, so each side labels
       itself and the arrow turns to point down the page. */
    .ba-legend { display: none; }
    .ba-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px;
        border: 1px solid var(--card-border);
        border-radius: 16px;
    }
    .ba-side { border-radius: 10px; padding: 16px 18px; }
    .ba-tag { display: block; }
    .ba-side.before .ba-tag { color: var(--text3); }
    .ba-side.after .ba-tag { color: var(--green); }
    .ba-mid { transform: rotate(90deg); padding: 2px 0; }
    /* Bento collapses to a 2-column bed: the hero goes full width and drops
       its double row height, everything else takes one column. */
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid > .feature-card { grid-column: span 1; }
    .feature-card.fc-hero { grid-column: span 2; grid-row: auto; padding: 28px; }
    .feature-card.fc-hero h3 { font-size: 20px; }
    .feature-card.fc-wide { grid-column: span 1; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
    .features-grid > .feature-card,
    .feature-card.fc-hero,
    .feature-card.fc-wide { grid-column: span 1; }
    .feature-card.fc-wide .feature-preview { flex-direction: column; gap: 6px; }
    .hero-cta { flex-direction: column; }
    .mockup-sidebar { display: none; }
    .adv-tag { font-size: 10.5px; padding: 6px 11px; top: 12px; left: 12px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .demo-form { padding: 24px; }
    .faq-item summary { padding: 16px 18px; font-size: 14px; }
    .faq-answer { padding: 14px 18px 18px; }
    .howto-steps { grid-template-columns: 1fr; }
    /* Two-up on small screens rather than five cramped columns */
    .stat { flex: 1 1 42%; }
    .stat-value { font-size: 26px; }
    .stat-label { font-size: 11.5px; }
    /* Two-up. With five stats the last one sits alone on its own row, so it
       spans the full width rather than sitting lopsided to the left. */
    .stat + .stat::before { display: none; }
    .stat:nth-child(even)::before { display: block; height: 46px; }
    .stat:last-child:nth-child(odd) { flex-basis: 100%; }
    /* The chat button collapses to a small circle here, so the row no longer
       needs to reserve space for it. */
    .stats-row { padding-right: 0; }
}
