/* /connect/evenergy — self-contained B2C styles. NO dependency on eve.css
 * (the B2B platform stylesheet). Layout comes from Tailwind utilities in
 * the templates; this file holds:
 *
 *   1. Body background override + the soft brand-glow radial.
 *   2. Heading reset (in case eve.css ever sneaks back in via shared head
 *      partials, we still beat its h1/h2/h3 uppercase + Trade Gothic Next).
 *   3. App-badge hover treatment so the white badges don't look flat.
 *   4. QR card subtle elevation.
 *
 * Brand colours sampled from docs/internal/brand/eve-intro.png:
 *   #0e2b2e   page bg
 *   #11353a   surface
 *   #163e44   elevated
 *   #50FB60   primary lime
 *
 * Note: body intentionally does NOT set overflow:hidden — the landing
 * scrolls naturally on viewports too short to fit the column. Trapping
 * scroll clips content on phones.
 */

body.connect-body {
    background: #0e2b2e;
}
body.connect-body .background-gradient {
    background: #0e2b2e;
    background-image: none;
}

.connect-glow {
    background-image:
        radial-gradient(ellipse 60% 45% at 50% 35%, rgba(80, 251, 96, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(80, 251, 96, 0.05) 0%, transparent 55%);
}

/* Fixed-header scrim. The header is transparent by default, so scrolled content
   passed *under* a bare bar and the wordmark/account chip sat on live text. The
   scrim lives on ::before (not the header itself) so those stay crisp while the
   backdrop blurs and the page colour fades to nothing at the bottom edge —
   content slides *behind* the header rather than under it. */
.connect-header::before {
    content: "";
    position: absolute;
    /* Extend past the header box so the fade finishes below it, not at the edge. */
    inset: 0 0 -1.5rem 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(14, 43, 46, 0.92) 0%,
        rgba(14, 43, 46, 0.72) 55%,
        rgba(14, 43, 46, 0) 100%
    );
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    /* Fade the blur out with the colour so the transition to unblurred content
       is gradual rather than a hard line at the header edge. */
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

/* Defensive: if eve.css ever gets pulled in via a partial, force Inter
 * sentence-case on the connect surface so it still reads on-brand.
 * 'Inter Fallback' (size-adjusted) sits between Inter and system-ui so
 * that pre-swap and post-swap layouts agree. */
/* Body / UI — Source Sans 3 (brand body face), sentence case. Inter is the
   metric-near fallback until the webfont loads (invisible swap). */
body.connect-body,
body.connect-body * {
    font-family: 'Source Sans 3', Inter, system-ui, -apple-system, sans-serif;
    text-transform: none;
    letter-spacing: 0;
}
/* Headings — Barlow Condensed 800, ALWAYS uppercase (brand headline face).
   The descendant ` *` selectors carry the face onto inline accent <span>s
   (e.g. the lime "GET PAID") that `body.connect-body *` would otherwise reset
   back to the body font. */
body.connect-body h1, body.connect-body h2, body.connect-body h3,
body.connect-body h1 *, body.connect-body h2 *, body.connect-body h3 * {
    font-family: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
    text-transform: uppercase;
}
body.connect-body h1 { font-weight: 800; letter-spacing: 0.02em; line-height: 0.95; }
body.connect-body h2 { font-weight: 800; letter-spacing: 0.02em; line-height: 0.95; }
body.connect-body h3 { font-weight: 800; letter-spacing: 0.03em; line-height: 1.0; }

/* App store badges — quiet elevation, subtle motion on hover. */
.connect-app-badge {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* ----------------------------------------------------------------------
 * "Eve on the go" block — shared between /connect, /connect/r/<code>,
 * and /connect/chat (via views/connect/_get_app.html).
 *
 * Layout: heading at top, QR card on the left, app store buttons
 * stacked on the right. On mobile the QR is hidden (driver is
 * already on a phone — tap the badge) and the store buttons go
 * full width.
 *
 * Visual language deliberately mirrors the chat-evenergy-everywhere
 * footer (small heading dot, restrained palette) so the two blocks
 * read as siblings on /connect/chat where they're stacked.
 * ---------------------------------------------------------------------- */

.connect-getapp {
    margin-top: 0.75rem;
    padding: 1rem 1.125rem 1.125rem;
    border: 1px solid hsla(0, 0%, 100%, 0.06);
    border-radius: 1.25rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(80, 251, 96, 0.04) 0%, transparent 70%),
        rgba(17, 53, 58, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.connect-getapp__heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.875rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(167, 180, 184, 0.7);
}

.connect-getapp__heading-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #50FB60;
    box-shadow: 0 0 6px rgba(80, 251, 96, 0.6);
}

/* QR card sits to the left of the stores on >= md viewports, hidden
 * on phones (the badges below are the right interaction). */
.connect-getapp__qr-wrap {
    display: none;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

@media (min-width: 768px) {
    .connect-getapp__qr-wrap { display: flex; }
}

.connect-getapp__qr-card {
    flex-shrink: 0;
    padding: 0.5rem;
    border-radius: 0.875rem;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.connect-getapp__qr-img {
    display: block;
    width: 130px;
    height: 130px;
    image-rendering: pixelated;
    user-select: none;
}

.connect-getapp__qr-hint {
    margin: 0;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.4;
}

.connect-getapp__qr-hint small {
    display: block;
    margin-top: 0.2rem;
    color: rgba(167, 180, 184, 0.7);
    font-size: 0.74rem;
}

/* Store buttons. Stacked vertically by default — compact, not the
 * giant white cards the landing used to have. White background +
 * brand glyph still readable as App Store / Google Play badges. */
.connect-getapp__stores {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

@media (min-width: 480px) {
    .connect-getapp__stores {
        grid-template-columns: 1fr 1fr;
    }
}

.connect-getapp__store {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.875rem;
    background: #ffffff;
    color: #0a0f14;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.connect-getapp__store:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.connect-getapp__store svg {
    flex-shrink: 0;
}

.connect-getapp__store-label {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-align: left;
}

.connect-getapp__store-pre {
    font-size: 0.64rem;
    font-weight: 500;
    opacity: 0.7;
}

.connect-getapp__store-name {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

/* No page-load animation. The page is server-baked HTML — render it,
 * don't reveal it piece-by-piece. (Previous fade-up looked like a JS
 * load to drivers; pulled.) Only the chat-starter spinner remains. */

/* Chat-starter spinner state — applied by landing.js on submit so the
 * driver gets immediate feedback that the round trip is starting. The
 * arrow SVG inside the button is hidden; a CSS-only spinner takes its
 * place. No JS DOM mutation needed for the icon swap. */
@keyframes connectSpin {
    to { transform: rotate(360deg); }
}

#chatStarterForm[data-state="loading"] #chatStarterSubmit svg {
    opacity: 0;
}
#chatStarterForm[data-state="loading"] #chatStarterSubmit::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(10, 15, 20, 0.25);
    border-top-color: rgba(10, 15, 20, 0.9);
    animation: connectSpin 0.7s linear infinite;
}
#chatStarterSubmit {
    position: relative;
    overflow: hidden;
}

/* Form-row pre-handoff state — fade + shimmer the input field so the
 * driver registers "something's happening" while the OAuth round-trip
 * boots. Pairs with the spinner above. */
#chatStarterForm[data-state="loading"] #chatStarterInput {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* QR card — keep the PNG crisp on Retina + a hairline tinted frame so
 * the white-on-dark stays grounded rather than floating. */
.connect-qr__card {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.connect-qr__card img {
    image-rendering: pixelated;
}

/* Site footer — small, muted, single line. Lives here (not in
 * chat.css) because landing.html only loads landing.css; chat.html
 * loads BOTH landing.css and chat.css, so this single declaration
 * styles the footer on every connect surface consistently. */
.connect-site-footer {
    margin-top: 1.25rem;
    padding-top: 0.875rem;
    border-top: 1px solid hsla(0, 0%, 100%, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* Bumped from 0.65rem → 0.7rem (WCAG comfortable-read floor) and
       opacity from 0.5 → 0.7 so the colour-on-bg contrast clears AA
       4.5:1 against #0e2b2e (was ~3.2:1). 2026-05-26 accessibility pass. */
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: rgba(167, 180, 184, 0.7);
    text-align: center;
}

.connect-site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}
.connect-site-footer a:hover {
    color: #50FB60;
}

.connect-site-footer__sep {
    opacity: 0.4;
}

/* Compact app-icon strip — used on landing + chat (replaces the
 * old bulky white-tile badges). Single inline row: 'Get the app'
 * label + two icon buttons. Neat, compact, doesn't compete with
 * the chat-starter above. */
/* Wrapper around the shared icon block (set in _layout.html). Centered by
   default for the narrow task pages (chat/account/share); the wide two-column
   entry pages left-align it (see surfaces.css `connect-hero-wide`). */
.connect-app-icons-wrap {
    display: flex;
    justify-content: center;
    padding-top: 0.25rem;
}

.connect-app-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    /* Cap to the column so the scrollable row below resolves its 100% against a
       real width instead of overflowing the page on a narrow phone. */
    max-width: 100%;
    min-width: 0;
}

.connect-app-icons__label {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(167, 180, 184, 0.7);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.connect-app-icons__row {
    display: flex;
    align-items: center;
    /* `safe center` centres the eight icons when they fit and falls back to
       start-alignment when they don't, so the row scrolls from the first icon
       instead of clipping it off the left edge on a narrow phone. Engines before
       Safari 15.4 / older Firefox drop the `safe` keyword and land on plain
       `flex-start`, a benign degradation for this row. */
    justify-content: safe center;
    gap: 0.5rem;
    max-width: 100%;
    overflow-x: auto;
    /* Hide the scrollbar — the row is a compact nav, not a document. */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Room for the buttons' drop shadow so it isn't clipped by overflow:auto. */
    padding: 2px 0;
}

.connect-app-icons__row::-webkit-scrollbar {
    display: none;
}

.connect-app-icons__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 44px = WCAG / Apple HIG minimum tap target. Was 38px (below the
       floor for accessibility + thumb accuracy on mobile). Bumped
       2026-05-26. */
    width: 44px;
    height: 44px;
    /* Never shrink inside the scrollable row — a squashed icon is worse than a
       scroll. */
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #0a0f14;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.connect-app-icons__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Subtle :active state for mobile — tap-highlight-color is suppressed
   globally; this restores the "I tapped that" feedback drivers expect. */
.connect-app-icons__btn:active,
#connectStatus:active {
    transform: scale(0.97);
}

/* Avatar chevron rotates when the dropdown is open. The aria-expanded
   attribute toggles between true/false; CSS handles the rotation so
   no JS-side class flipping is needed. */
#connectStatus[aria-expanded="true"] .connect-account-chevron {
    transform: rotate(180deg);
}

/* The account dropdown's menu items: a leading icon, and a dot marking which
   one is the current page (set via aria-current, never a JS-toggled class). */
#accountMenu [role="menuitem"] svg {
    flex-shrink: 0;
}

#accountMenu [role="menuitem"][aria-current="page"] {
    position: relative;
}

#accountMenu [role="menuitem"][aria-current="page"]::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #50fb60;
}
