/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #12152a;
    --bg-secondary: #171b33;
    --bg-tertiary: #1f2547;
    --bg-card: #1a1f3b;
    --bg-hover: #232a52;
    --text-primary: #e9e4d3;
    --text-secondary: #9ba0b4;
    /* ≥ 4.5:1 on every dark surface up to --bg-hover (axe gate, .plans/038). */
    --text-muted: #8e93aa;
    --accent: #ff5c39;
    --accent-hover: #ff7b5c;
    --accent-bg: rgba(255, 92, 57, 0.08);
    --accent-border: rgba(255, 92, 57, 0.25);
    --success: #2fbf71;
    --success-bright: #4fd68a;
    --success-bg: rgba(47, 191, 113, 0.12);
    --success-border: rgba(47, 191, 113, 0.3);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.3);
    --danger: #e5484d;
    --danger-bright: #f0666b;
    --danger-bg: rgba(229, 72, 77, 0.12);
    --danger-border: rgba(229, 72, 77, 0.3);
    --info: #3b82f6;
    --info-bright: #60a5fa;
    --info-bg: rgba(59, 130, 246, 0.12);
    --info-border: rgba(59, 130, 246, 0.3);
    --success-hover: #26a35f;
    --success-btn: #1f7a4d;
    --success-btn-hover: #196541;
    --danger-hover: #c93a3f;
    --danger-btn: #a82e32;
    --danger-btn-hover: #8f2529;
    --text-primary-inverse: #1a1a1a;
    --bg-google-hover: #f5f5f5;
    --solana: #9945ff;
    --border: #2a3052;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --font-mono: "SF Mono", "Fira Code", ui-monospace, monospace;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --text-heading: #f4f0e4;
    --bg-void: #0b0d1c;
    --border-hover: #343b63;
    /* Type (F2, "the keepsake ticket"): a display face for headings, with a
       Thai display face behind it (Bricolage has no Thai glyphs, so Thai text
       falls through to Anuphan and TH/EN stay one brand), and a mono for
       codes and asset IDs. Inter stays the body face. Google Fonts serves
       unicode-range subsets, so a face is only fetched when a glyph needs it. */
    --font-display: "Bricolage Grotesque", "Anuphan", "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Night Edition paper tokens — tickets, badges, stamped receipts */
    --paper: #ede7d6;
    --paper-ink: #1e2447;
    --paper-dim: #ddd7c2;
    --accent-purple: #ffab4d;
    --accent-light: #ffa184;
    --warning-bright: #eab308;
    --warning-dark: #d97706;
    --code-bg: #0d1117;
    --code-text: #c9d1d9;
    --color-x-brand: #1da1f2;
    --solana-green: #14f195;
    --header-height: 80px;
    /* Typography scale tokens */
    --text-xs: 0.7rem;
    --text-sm: 0.8rem;
    /* Fluid type + space scale (.plans/038 P3-d), Utopia-style: linear from
       a 320px to a 1440px viewport. Type: 16px ratio 1.2 -> 18px ratio 1.25.
       Space: multiples of the step-1 size. Migrate one page at a time;
       these do not replace --text-* in bulk. */
    --font-size-0: clamp(0.8333rem, 0.8143rem + 0.0952vw, 0.9rem); /* 13.3 -> 14.4px */
    --font-size-1: clamp(1rem, 0.9643rem + 0.1786vw, 1.125rem); /* 16 -> 18px */
    --font-size-2: clamp(1.2rem, 1.141rem + 0.2946vw, 1.406rem); /* 19.2 -> 22.5px */
    --font-size-3: clamp(1.44rem, 1.349rem + 0.454vw, 1.758rem); /* 23 -> 28.1px */
    --font-size-4: clamp(1.728rem, 1.594rem + 0.6704vw, 2.197rem); /* 27.6 -> 35.2px */
    --font-size-5: clamp(2.074rem, 1.881rem + 0.9614vw, 2.747rem); /* 33.2 -> 43.9px */
    --size-1: clamp(0.25rem, 0.2411rem + 0.0446vw, 0.2812rem); /* 4 -> 4.5px */
    --size-2: clamp(0.5rem, 0.4821rem + 0.0893vw, 0.5625rem); /* 8 -> 9px */
    --size-3: clamp(0.75rem, 0.7232rem + 0.1339vw, 0.8438rem); /* 12 -> 13.5px */
    --size-4: clamp(1rem, 0.9643rem + 0.1786vw, 1.125rem); /* 16 -> 18px */
    --size-5: clamp(1.5rem, 1.446rem + 0.2679vw, 1.688rem); /* 24 -> 27px */
    --size-6: clamp(2rem, 1.929rem + 0.3571vw, 2.25rem); /* 32 -> 36px */
    --size-7: clamp(3rem, 2.893rem + 0.5357vw, 3.375rem); /* 48 -> 54px */
}

/* Document-level scroll only (F1-e). Sideways overflow is clipped on html
   alone: with html not `visible`, an overflow rule on body is no longer
   propagated to the viewport, and body's overflow-y computes to `auto`,
   which WebKit can turn into an inner scroller (no momentum, no URL-bar
   hide, no pull-to-refresh). `clip` never creates a scroll container;
   `hidden` is the fallback for engines without it. */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-x: clip;
}

/* Scroll-margin for anchored sections so sticky nav doesn't cover them */
#features,
#how-it-works,
#organizers {
    scroll-margin-top: var(--header-height);
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    background:
        radial-gradient(rgba(233, 228, 211, 0.035) 1px, transparent 1px),
        linear-gradient(170deg, #12152a 0%, #131834 40%, #101326 100%);
    background-size:
        5px 5px,
        auto;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.center-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-x: clip;
    padding: 1.5rem;
    position: relative;
}

/* Subtle ambient glow behind the center content */
.center-page::before {
    content: "";
    position: absolute;
    /* vh, not %: a % top follows the page height, so the glow moved (a
       layout shift) whenever loaded content grew the page (.issues/175). */
    top: -10vh;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 100vw;
    height: 600px;
    background: radial-gradient(
        circle,
        rgba(255, 92, 57, 0.06) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

.center-page > * {
    position: relative;
    z-index: 1;
}

/* Accessibility: respect reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ===== Typography ===== */
h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: center;
}

/* ===== SVG Icon System ===== */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    flex-shrink: 0;
}
.icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.icon-xs {
    width: 0.75em;
    height: 0.75em;
}
.icon-sm {
    width: 0.875em;
    height: 0.875em;
}
.icon-md {
    width: 1.25em;
    height: 1.25em;
}
.icon-lg {
    width: 1.5em;
    height: 1.5em;
}
.icon-xl {
    width: 2em;
    height: 2em;
}
.icon-2xl {
    width: 2.5em;
    height: 2.5em;
}
.icon-success {
    color: var(--success);
}
.icon-warning {
    color: var(--warning);
}
.icon-danger {
    color: var(--danger);
}
.icon-info {
    color: var(--info);
}
.icon-muted {
    color: var(--text-muted);
}

/* ===== Logo ===== */
.logo {
    margin-bottom: 0.5rem;
    text-align: center;
}

/* The logo (A2, owner 8 Oct 2026; bethere-ux/brand/logo): the wordmark, then
   a chair with a person on its seat, as tall as an x, 0.06em after the "e".
   The chair is the site's CHAIR path. The person is #e04a22 on light grounds
   (3.57:1 on paper) and #ff5c39 on dark (6.10:1). */
:root {
    --bt-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 30'%3E%3Cpath d='M2 0h4v14h14v4H8v12H4V18H2z M18 18h4v12h-4z' fill='%236b63f0'/%3E%3Ccircle cx='13.5' cy='9' r='4.6' fill='%23e04a22'/%3E%3C/svg%3E");
    --bt-mark-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 30'%3E%3Cpath d='M2 0h4v14h14v4H8v12H4V18H2z M18 18h4v12h-4z' fill='%236b63f0'/%3E%3Ccircle cx='13.5' cy='9' r='4.6' fill='%23ff5c39'/%3E%3C/svg%3E");
}
.lp-logo::after,
.lp-flogo::after {
    content: "";
    display: inline-block;
    width: 0.437em;
    height: 0.546em;
    margin-left: 0.06em;
    background: var(--bt-mark-dark) center / contain no-repeat;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.15s,
        box-shadow 0.2s,
        opacity 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.97) translateY(0);
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.75rem;
    background: var(--text-heading);
    color: var(--text-primary-inverse);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    position: relative;
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition:
        background 0.2s,
        transform 0.15s,
        box-shadow 0.2s;
}

.btn-google:hover {
    background: var(--bg-google-hover);
    transform: translateY(-1px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

.btn-google:active {
    transform: scale(0.98) translateY(0);
    box-shadow:
        0 1px 8px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff5c39 0%, #ff7b5c 100%);
    color: var(--text-heading);
    box-shadow: 0 2px 12px rgba(255, 92, 57, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff7b5c 0%, #ffa184 100%);
    box-shadow: 0 4px 20px rgba(255, 92, 57, 0.35);
}

.btn-success {
    background: var(--success-btn);
    color: var(--text-heading);
}

.btn-success:hover {
    background: var(--success-btn-hover);
}

.btn-danger {
    background: var(--danger-btn);
    color: var(--text-heading);
}

.btn-danger:hover {
    background: var(--danger-btn-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1;
}

.btn-block {
    width: 100%;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        transform 0.15s;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Finance icon accents (kept for admin/status SVG icons) */

/* ===== Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(
        135deg,
        rgba(30, 30, 30, 0.95) 0%,
        rgba(26, 26, 26, 0.98) 100%
    );
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    transition:
        border-color 0.3s,
        box-shadow 0.3s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stat-card.success {
    border-color: rgba(34, 197, 94, 0.25);
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.06) 0%,
        rgba(30, 30, 30, 0.95) 100%
    );
}

.stat-card.warning {
    border-color: rgba(245, 158, 11, 0.25);
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.06) 0%,
        rgba(30, 30, 30, 0.95) 100%
    );
}

.stat-card.info {
    border-color: rgba(59, 130, 246, 0.25);
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.06) 0%,
        rgba(30, 30, 30, 0.95) 100%
    );
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card.success .stat-value {
    color: var(--success);
}

.stat-card.warning .stat-value {
    color: var(--warning);
}

.stat-card.info .stat-value {
    color: var(--info);
}

/* ===== Progress Bar ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* ===== Header / Nav ===== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.header-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #ff7b5c 0%, #ff5c39 40%, #ffab4d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.header-page-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
}

.header-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s ease;
}

.header-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.header-nav-label {
    font-size: 0.8rem;
}

.header-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5c39 0%, #ff7b5c 100%);
    color: var(--text-heading);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    flex-shrink: 0;
}

.header-sign-out {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.header-sign-out-icon {
    font-size: 0.9rem;
}

.header-sign-out-label {
    font-size: 0.8rem;
}

/* Active nav link in header. Dark text: the label is small, and light text
   on --accent is 2.69:1; --bg-primary is 5.87:1 (.issues/171). */
nav a[aria-current="page"],
nav a.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition:
        color 0.2s,
        border-color 0.2s;
}

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

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

