/* ═══════════════════════════════════════════════════════════════════════════
   AQUA Pay design system
   ───────────────────────────────────────────────────────────────────────────
   The single stylesheet for every AQUA Pay surface: marketing pages, the
   merchant dashboard, buyer-facing checkout pages and admin.

   Before this file existed, all 19 HTML pages carried their own duplicated
   <style> block — token names differed page to page, several pages had no
   tokens at all, and the dashboard used a completely separate visual language
   (system font, nine ad-hoc radii, 455 hardcoded colors in inline styles).

   ── THEMING ───────────────────────────────────────────────────────────────
   Three states: system (default) · light · dark. `theme-init.js` stamps
   `data-theme` on <html> before first paint; the toggle writes
   localStorage['aqua_pay_theme'].

   AQUA Pay is DARK-FIRST, so the polarity is inverted from the usual pattern:
   the dark palette is defined on bare :root and is therefore both the default
   AND the fallback. If theme-init.js is blocked or fails, the page renders
   exactly as it does today rather than flashing white.

   ── BRAND ─────────────────────────────────────────────────────────────────
   The palette is AQUA Wallet's navy #022173 and the logo's cyan #00C7F9 (the
   "Pay" box of the AQUA Pay logo, since 2026-11-16; #5ADBFB before). It supersedes
   the inherited pale gold (#D4C5A9 / #B07D2E) this file used to carry — that is
   legacy, not a starting point. Inter survives the rebrand unchanged, because
   AQUA Wallet uses it too. The full specification, including every measured
   contrast ratio, is docs/DESIGN-SYSTEM.md; read it before changing a value
   here. The guard below is structural and will happily pass an unreadable
   palette.

   Every color is defined on :root first. Nothing gets its ONLY definition
   inside a media query or a [data-theme] block — `scripts/theme-token-guard.sh`
   fails the build if that rule is broken, or if the two light blocks drift.

   ── SHAPE ─────────────────────────────────────────────────────────────────
   Three radii, no more: --radius (cards, panels), --radius-sm (buttons,
   inputs, small chips), --radius-pill (badges, tags).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Fonts ─────────────────────────────────────────────────────────────────
   Variable faces: one file covers weights 100–900. Provenance, licence and
   update steps in web/fonts/README.md. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens: DARK (default + fallback) ───────────────────────────────────
   Generated from scripts/gen-theme-tokens.py — edit the table there and rerun.
   Palette: the 2026-11-24 redesign (JAN3, "AQUA Pay demo v2"): chart paper and
   ink, cyan water for money and brand, ink primary buttons. DESIGN-SYSTEM.md §3. */

:root {
  /* shape (demo: 8 panels, 6 controls) */
  --radius:        8px;
  --radius-sm:     6px;
  --radius-lg:    12px;
  --radius-pill: 999px;

  /* layout */
  --measure:     1120px;   /* marketing content width */
  --content-max: 1240px;   /* app content width (dashboard shell) */
  --sidebar-w:    248px;
  --topbar-h:      60px;
  --panel-pad:     24px;

  /* spacing, 4px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* type scale (Inter) */
  --fs-display: 1.875rem; --fs-h1: 1.625rem; --fs-h2: 1.125rem; --fs-h3: 1rem;
  --fs-body: 0.875rem; --fs-body-lg: 1rem; --fs-small: 0.8125rem; --fs-caption: 0.75rem;
  --fs-amount: 1.75rem;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* motion */
  --dur-fast: 150ms; --dur-base: 180ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* surfaces */
  --bg: #080D11;
  --surface: #111A20;
  --surface-2: #18232A;
  --surface-3: #05090C;  /* recessed ground: the footer */
  --overlay: rgba(0,0,0,0.60);
  --nav-bg: rgba(17,26,32,0.92);

  /* text (ink) */
  --text: #F2F6F7;
  --text-soft: #C3D0D7;  /* ink-2 */
  --muted: #8FA1AC;  /* ink-3: 5.5:1 on white, 6.6:1 on the dark surface */
  --text-2: #C3D0D7;
  --text-3: #8FA1AC;

  /* water: brand cyan and the accent */
  --brand: #00C7F9;  /* the logo cyan: active-nav marker, count badge, never text on light */
  --accent: #6FD8F7;  /* accent AS TEXT (links, highlights): 6.2:1 on white, 11:1 on dark */
  --accent-lt: #B4EBFB;
  --accent-line: #00C7F9;  /* focus ring, selected strokes */
  --accent-wash: rgba(0,199,249,0.12);
  --accent-rgb: 0,199,249;
  --accent-border: #0B5A78;
  --paid-ink: #7FE0F9;

  /* action: primary buttons are ink, inverted on dark */
  --fill: #F2F6F7;
  --fill-h: #D6E1E6;
  --fill-press: #C3D0D7;
  --fill-fg: #080D11;  /* 19.5:1 light, 17.9:1 dark */
  --brand-navy: #0C394C;
  --on-navy: #FFFFFF;  /* white on navy #0C394C: 12.3:1 */

  /* lines and inputs */
  --border: #24323B;
  --border-2: #364751;  /* rule-strong: inputs, secondary buttons */
  --input-bg: #111A20;
  --input-focus: rgba(0,199,249,0.50);

  /* states: -ink is text, -wash its ground; every -ink passes 4.5:1 on its wash and the page */
  --ok: #5FD6A5;
  --ok-wash: rgba(52,196,139,0.14);
  --ok-dot: #34C48B;
  --warn: #FFD25C;
  --warn-wash: rgba(255,194,10,0.13);
  --warn-dot: #FFC20A;
  --warn-icon: #FFC20A;  /* demo #A06A00 was 4.2:1 on its wash; #8A5B00 is 5.3:1 */
  --danger: #FF8A80;
  --danger-wash: rgba(255,90,79,0.14);
  --danger-dot: #FF5A4F;
  --danger-fill: #D92D20;  /* solid destructive button, white label */
  --info: #7FE0F9;
  --info-wash: rgba(0,199,249,0.14);
  --land: #2A2720;  /* dry land = not paid, expired, voided */
  --land-ink: #D8CDB6;

  /* elevation */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-pop: 0 12px 32px -8px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-nav: 0 2px 16px rgba(0,0,0,0.3);

  /* API reference (docs) and code */
  --http-get: #60A5FA;
  --http-get-bg: rgba(29,78,216,0.15);
  --http-post: #FB923C;
  --http-post-bg: rgba(194,65,12,0.15);
  --http-delete: #F87171;
  --http-delete-bg: rgba(153,27,27,0.15);
  --http-patch: #C084FC;
  --http-patch-bg: rgba(91,33,182,0.15);
  --code-bg: #05090C;
  --code-inline: #18232A;
  --code-text: #D6E6EE;

  /* which logo artwork shows (.brand-logo) */
  --logo-on-light: none;
  --logo-on-dark: block;

  color-scheme: dark;
}

/* ── Tokens: LIGHT ─────────────────────────────────────────────────────────
   TWO BLOCKS, IDENTICAL BODIES, DELIBERATELY ADJACENT (theme-token-guard.js).
   The media query serves `system`; the attribute an explicit choice.

   TEXT ACCENT VS BRAND: the logo cyan #00C7F9 is 2.0:1 on white, so it is
   never text on light — --accent (text) is #00668F there (6.2:1), #6FD8F7 on
   dark. Primary buttons (--fill) are ink: #080D11 with white on light,
   #F2F6F7 with ink on dark. */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    /* surfaces */
    --bg: #F6F8F8;
    --surface: #FFFFFF;
    --surface-2: #EEF2F3;
    --surface-3: #E4EAEC;  /* recessed ground: the footer */
    --overlay: rgba(8,13,17,0.32);
    --nav-bg: rgba(255,255,255,0.92);

    /* text (ink) */
    --text: #080D11;
    --text-soft: #3B4A55;  /* ink-2 */
    --muted: #5B6B76;  /* ink-3: 5.5:1 on white, 6.6:1 on the dark surface */
    --text-2: #3B4A55;
    --text-3: #5B6B76;

    /* water: brand cyan and the accent */
    --brand: #00C7F9;  /* the logo cyan: active-nav marker, count badge, never text on light */
    --accent: #00668F;  /* accent AS TEXT (links, highlights): 6.2:1 on white, 11:1 on dark */
    --accent-lt: #00597C;
    --accent-line: #009AD6;  /* focus ring, selected strokes */
    --accent-wash: #E3F7FD;
    --accent-rgb: 0,154,214;
    --accent-border: #B4EBFB;
    --paid-ink: #00597C;

    /* action: primary buttons are ink, inverted on dark */
    --fill: #080D11;
    --fill-h: #1C2A34;
    --fill-press: #2A3A45;
    --fill-fg: #FFFFFF;  /* 19.5:1 light, 17.9:1 dark */
    --brand-navy: #0C394C;
    --on-navy: #FFFFFF;  /* white on navy #0C394C: 12.3:1 */

    /* lines and inputs */
    --border: #D9E1E5;
    --border-2: #B9C6CD;  /* rule-strong: inputs, secondary buttons */
    --input-bg: #FFFFFF;
    --input-focus: rgba(0,154,214,0.45);

    /* states: -ink is text, -wash its ground; every -ink passes 4.5:1 on its wash and the page */
    --ok: #0B6E4F;
    --ok-wash: #E3F5EC;
    --ok-dot: #12A46F;
    --warn: #6B4A00;
    --warn-wash: #FFF4D6;
    --warn-dot: #E0A800;
    --warn-icon: #8A5B00;  /* demo #A06A00 was 4.2:1 on its wash; #8A5B00 is 5.3:1 */
    --danger: #B42318;
    --danger-wash: #FDECEA;
    --danger-dot: #D92D20;
    --danger-fill: #B42318;  /* solid destructive button, white label */
    --info: #00597C;
    --info-wash: #E3F7FD;
    --land: #EFE9DC;  /* dry land = not paid, expired, voided */
    --land-ink: #5E5443;

    /* elevation */
    --shadow-card: 0 1px 2px rgba(8,13,17,0.06);
    --shadow-pop: 0 12px 32px -8px rgba(8,13,17,0.18), 0 2px 6px rgba(8,13,17,0.08);
    --shadow-nav: 0 2px 16px rgba(8,13,17,0.06);

    /* API reference (docs) and code */
    --http-get: #1D4ED8;
    --http-get-bg: rgba(29,78,216,0.10);
    --http-post: #C2410C;
    --http-post-bg: rgba(194,65,12,0.10);
    --http-delete: #B91C1C;
    --http-delete-bg: rgba(153,27,27,0.10);
    --http-patch: #6D28D9;
    --http-patch-bg: rgba(109,40,217,0.10);
    --code-bg: #EEF2F3;
    --code-inline: #EEF2F3;
    --code-text: #1F2A33;

    /* which logo artwork shows (.brand-logo) */
    --logo-on-light: block;
    --logo-on-dark: none;

    color-scheme: light;
  }
}

:root[data-theme="light"] {
  /* surfaces */
  --bg: #F6F8F8;
  --surface: #FFFFFF;
  --surface-2: #EEF2F3;
  --surface-3: #E4EAEC;  /* recessed ground: the footer */
  --overlay: rgba(8,13,17,0.32);
  --nav-bg: rgba(255,255,255,0.92);

  /* text (ink) */
  --text: #080D11;
  --text-soft: #3B4A55;  /* ink-2 */
  --muted: #5B6B76;  /* ink-3: 5.5:1 on white, 6.6:1 on the dark surface */
  --text-2: #3B4A55;
  --text-3: #5B6B76;

  /* water: brand cyan and the accent */
  --brand: #00C7F9;  /* the logo cyan: active-nav marker, count badge, never text on light */
  --accent: #00668F;  /* accent AS TEXT (links, highlights): 6.2:1 on white, 11:1 on dark */
  --accent-lt: #00597C;
  --accent-line: #009AD6;  /* focus ring, selected strokes */
  --accent-wash: #E3F7FD;
  --accent-rgb: 0,154,214;
  --accent-border: #B4EBFB;
  --paid-ink: #00597C;

  /* action: primary buttons are ink, inverted on dark */
  --fill: #080D11;
  --fill-h: #1C2A34;
  --fill-press: #2A3A45;
  --fill-fg: #FFFFFF;  /* 19.5:1 light, 17.9:1 dark */
  --brand-navy: #0C394C;
  --on-navy: #FFFFFF;  /* white on navy #0C394C: 12.3:1 */

  /* lines and inputs */
  --border: #D9E1E5;
  --border-2: #B9C6CD;  /* rule-strong: inputs, secondary buttons */
  --input-bg: #FFFFFF;
  --input-focus: rgba(0,154,214,0.45);

  /* states: -ink is text, -wash its ground; every -ink passes 4.5:1 on its wash and the page */
  --ok: #0B6E4F;
  --ok-wash: #E3F5EC;
  --ok-dot: #12A46F;
  --warn: #6B4A00;
  --warn-wash: #FFF4D6;
  --warn-dot: #E0A800;
  --warn-icon: #8A5B00;  /* demo #A06A00 was 4.2:1 on its wash; #8A5B00 is 5.3:1 */
  --danger: #B42318;
  --danger-wash: #FDECEA;
  --danger-dot: #D92D20;
  --danger-fill: #B42318;  /* solid destructive button, white label */
  --info: #00597C;
  --info-wash: #E3F7FD;
  --land: #EFE9DC;  /* dry land = not paid, expired, voided */
  --land-ink: #5E5443;

  /* elevation */
  --shadow-card: 0 1px 2px rgba(8,13,17,0.06);
  --shadow-pop: 0 12px 32px -8px rgba(8,13,17,0.18), 0 2px 6px rgba(8,13,17,0.08);
  --shadow-nav: 0 2px 16px rgba(8,13,17,0.06);

  /* API reference (docs) and code */
  --http-get: #1D4ED8;
  --http-get-bg: rgba(29,78,216,0.10);
  --http-post: #C2410C;
  --http-post-bg: rgba(194,65,12,0.10);
  --http-delete: #B91C1C;
  --http-delete-bg: rgba(153,27,27,0.10);
  --http-patch: #6D28D9;
  --http-patch-bg: rgba(109,40,217,0.10);
  --code-bg: #EEF2F3;
  --code-inline: #EEF2F3;
  --code-text: #1F2A33;

  /* which logo artwork shows (.brand-logo) */
  --logo-on-light: block;
  --logo-on-dark: none;

  color-scheme: light;
}

/* Explicit dark must beat a light OS setting. Values match :root exactly. */
:root[data-theme="dark"] {
  /* surfaces */
  --bg: #080D11;
  --surface: #111A20;
  --surface-2: #18232A;
  --surface-3: #05090C;  /* recessed ground: the footer */
  --overlay: rgba(0,0,0,0.60);
  --nav-bg: rgba(17,26,32,0.92);

  /* text (ink) */
  --text: #F2F6F7;
  --text-soft: #C3D0D7;  /* ink-2 */
  --muted: #8FA1AC;  /* ink-3: 5.5:1 on white, 6.6:1 on the dark surface */
  --text-2: #C3D0D7;
  --text-3: #8FA1AC;

  /* water: brand cyan and the accent */
  --brand: #00C7F9;  /* the logo cyan: active-nav marker, count badge, never text on light */
  --accent: #6FD8F7;  /* accent AS TEXT (links, highlights): 6.2:1 on white, 11:1 on dark */
  --accent-lt: #B4EBFB;
  --accent-line: #00C7F9;  /* focus ring, selected strokes */
  --accent-wash: rgba(0,199,249,0.12);
  --accent-rgb: 0,199,249;
  --accent-border: #0B5A78;
  --paid-ink: #7FE0F9;

  /* action: primary buttons are ink, inverted on dark */
  --fill: #F2F6F7;
  --fill-h: #D6E1E6;
  --fill-press: #C3D0D7;
  --fill-fg: #080D11;  /* 19.5:1 light, 17.9:1 dark */
  --brand-navy: #0C394C;
  --on-navy: #FFFFFF;  /* white on navy #0C394C: 12.3:1 */

  /* lines and inputs */
  --border: #24323B;
  --border-2: #364751;  /* rule-strong: inputs, secondary buttons */
  --input-bg: #111A20;
  --input-focus: rgba(0,199,249,0.50);

  /* states: -ink is text, -wash its ground; every -ink passes 4.5:1 on its wash and the page */
  --ok: #5FD6A5;
  --ok-wash: rgba(52,196,139,0.14);
  --ok-dot: #34C48B;
  --warn: #FFD25C;
  --warn-wash: rgba(255,194,10,0.13);
  --warn-dot: #FFC20A;
  --warn-icon: #FFC20A;  /* demo #A06A00 was 4.2:1 on its wash; #8A5B00 is 5.3:1 */
  --danger: #FF8A80;
  --danger-wash: rgba(255,90,79,0.14);
  --danger-dot: #FF5A4F;
  --danger-fill: #D92D20;  /* solid destructive button, white label */
  --info: #7FE0F9;
  --info-wash: rgba(0,199,249,0.14);
  --land: #2A2720;  /* dry land = not paid, expired, voided */
  --land-ink: #D8CDB6;

  /* elevation */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-pop: 0 12px 32px -8px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-nav: 0 2px 16px rgba(0,0,0,0.3);

  /* API reference (docs) and code */
  --http-get: #60A5FA;
  --http-get-bg: rgba(29,78,216,0.15);
  --http-post: #FB923C;
  --http-post-bg: rgba(194,65,12,0.15);
  --http-delete: #F87171;
  --http-delete-bg: rgba(153,27,27,0.15);
  --http-patch: #C084FC;
  --http-patch-bg: rgba(91,33,182,0.15);
  --code-bg: #05090C;
  --code-inline: #18232A;
  --code-text: #D6E6EE;

  /* which logo artwork shows (.brand-logo) */
  --logo-on-light: none;
  --logo-on-dark: block;

  color-scheme: dark;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

section { width: 100%; }

/* Visible keyboard focus everywhere — the old per-page styles had none. */
:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Layout ────────────────────────────────────────────────────────────── */

.container { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }

/* Noise texture — the marketing site's signature ground. */
.noise-bg { position: relative; }
.noise-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 0;
}
.noise-bg > * { position: relative; z-index: 1; }

/* ── Typography ────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5 { letter-spacing: -0.02em; line-height: 1.25; }

/* The eyebrow: small, uppercase, wide-tracked. One treatment across the
   marketing sections and the dashboard's card titles, which had drifted to
   0.07em. */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.eyebrow-accent { color: var(--accent); }

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}
.section-sub { font-size: 1.1rem; color: var(--muted); max-width: 580px; }
.section-header { margin-bottom: 56px; }
.section-header.center { text-align: center; }
.section-header.center .section-sub { margin: 0 auto; }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  /* A .btn with no variant is the redesign's secondary button. */
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-sm { padding: 9px 18px; font-size: 0.88rem; }

.btn-primary { background: var(--fill); color: var(--fill-fg); border-color: var(--fill); }
.btn-primary:hover { background: var(--fill-h); color: var(--fill-fg); border-color: var(--fill-h); }
.btn-primary:active { background: var(--fill-press); border-color: var(--fill-press); }

/* Secondary: the redesign's default button — the surface, a strong rule. */
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--muted); background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-wash); }
.btn-danger-solid { background: var(--danger-fill); color: #FFFFFF; border-color: var(--danger-fill); }
.btn-danger-solid:hover { background: var(--danger); border-color: var(--danger); }

.btn-block { width: 100%; justify-content: center; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px 28px;
}

/* ── Badges ────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-ok     { background: var(--ok-wash);     color: var(--ok); }
.badge-warn   { background: var(--warn-wash);   color: var(--warn); }
.badge-danger { background: var(--danger-wash); color: var(--danger); }
.badge-muted  { background: var(--surface-2);   color: var(--muted); }
.badge-info   { background: var(--info-wash);   color: var(--info); }
.badge-paid   { background: var(--accent-wash); color: var(--paid-ink); }
.badge-land   { background: var(--land);        color: var(--land-ink); }

/* ── Inputs ────────────────────────────────────────────────────────────── */

.inp {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.inp::placeholder { color: var(--muted); }
.inp:hover { border-color: var(--muted); }
.inp:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--input-focus); }
.inp[readonly], .inp[disabled] { background: var(--surface-2); }

/* ── Icons ─────────────────────────────────────────────────────────────── */
/* The AQUA DS set, one static sprite (web/img/icons.svg, same origin, so the
   CSP allows it and no markup is injected): <svg class="icon" aria-hidden="true">
   <use href="/img/icons.svg#i-copy"/></svg>. They take currentColor. */
.icon { width: 20px; height: 20px; flex: none; fill: currentColor; vertical-align: middle; }
.icon-16 { width: 16px; height: 16px; }
.icon-24 { width: 24px; height: 24px; }

/* ── Stat row ──────────────────────────────────────────────────────────── */

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.stat:last-child { border-bottom: none; }
.stat-key { color: var(--muted); }
.stat-val { font-weight: 600; color: var(--text); }

/* ── Navigation ────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav.scrolled { border-color: var(--border); box-shadow: var(--shadow-nav); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.nav-logo { display: flex; align-items: center; line-height: 1; flex-shrink: 0; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 0.9rem; font-weight: 500; }
/* Labels must never break mid-phrase: "Payment Links" wrapping to two lines
   doubles the nav height and shoves the whole bar out of alignment. */
.nav-links > a { color: var(--muted); transition: color 0.15s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-login { color: var(--muted) !important; }
.nav-login:hover { color: var(--text) !important; text-decoration: none !important; }
.nav-cta {
  background: var(--fill);
  color: var(--fill-fg) !important;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--fill-h) !important; color: var(--fill-fg) !important; text-decoration: none !important; }
.nav-mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: var(--text); }

/* ── Logo ───────────────────────────────────────────────────────────────────
   The AQUA Pay artwork, web/img/brand/ (docs/DESIGN-SYSTEM.md §5). It replaced
   the text wordmark that stood in until the artwork existed.

   TWO FILES, ONE SHOWN. The "AQUA" letters are drawn black in
   aquapay-logo-default.svg and white in aquapay-logo-on-dark.svg — an <img>
   cannot inherit --text, so each ground gets the file drawn for it. Which one
   shows is the --logo-on-light / --logo-on-dark token pair, defined in all
   four theme blocks above, so the switch follows system · light · dark exactly
   as every colour does and the token guard covers it. The hidden image is
   display:none, so a screen reader hears "AQUA Pay" once.

   MARKUP — always both images, both with alt text and the same box:
     <span class="brand-logo">
       <img class="brand-logo-light" src="/img/brand/aquapay-logo-default.svg" alt="AQUA Pay" width="116" height="28">
       <img class="brand-logo-dark" src="/img/brand/aquapay-logo-on-dark.svg" alt="AQUA Pay" width="116" height="28">
     </span>

   SIZE IS SET BY HEIGHT ONLY; the width follows the artwork (626 × 151). The
   artwork has no padding: its height is the cyan box's height.
     .brand-logo      28px  (116px wide) — nav bars, top bars, page headers
     .brand-logo-sm   24px  ( 99px wide) — footers, the admin bar
     .brand-logo-lg   40px  (166px wide) — centred sign-in and account screens
   Never below 20px: the "AQUA" letters then lose their counters. */
.brand-logo { display: inline-flex; align-items: center; flex-shrink: 0; line-height: 0; vertical-align: middle; }
.brand-logo img { height: 28px; width: auto; max-width: none; }
.brand-logo-light { display: var(--logo-on-light); }
.brand-logo-dark  { display: var(--logo-on-dark); }
.brand-logo-sm img { height: 24px; }
.brand-logo-lg img { height: 40px; }

/* ── A store's own logo on the buyer pages (Enterprise; web/js/buyer-brand.js) ──
   Replaces .brand-logo in the header of pay (and POS), fund and refund when the
   store's plan shows its logo (services/storeLogo.ts). The merchant's artwork is
   drawn for an unknown ground, so it always sits on a white tile — the same in
   both themes, like a QR plate — never on our themed background. At most 40px
   high and 240px wide (and the header's width), aspect kept.

   The header and footer wait for the decision ([data-brand="pending"]) so
   AQUA Pay's logo never flashes before the store's; if no script answers,
   the animation shows AQUA Pay's after 3 s. */
[data-brand="pending"] { visibility: hidden; animation: brand-reveal 0s linear 3s forwards; }
@keyframes brand-reveal { to { visibility: visible; } }
.store-logo { display: inline-flex; align-items: center; justify-content: center; max-width: 100%;
  background: #ffffff; border-radius: var(--radius-sm); padding: 6px 10px; line-height: 0; }
.store-logo img { display: block; width: auto; height: auto; max-height: 40px; max-width: min(240px, 100%); object-fit: contain; }
.buyer-legal a { color: var(--muted); text-decoration: underline; }

/* ── Theme toggle ──────────────────────────────────────────────────────── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.theme-btn:hover { color: var(--text); }
.theme-btn[aria-pressed="true"] { background: var(--fill); color: var(--fill-fg); }
.theme-btn svg { width: 14px; height: 14px; display: block; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer { background: var(--surface-3); color: var(--text); padding: 56px 24px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-logo { margin-bottom: 8px; }
.footer-tagline { font-size: 0.85rem; color: var(--muted); line-height: 1.8; margin-bottom: 20px; }
.footer-col h5 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0; }
.footer-links a { font-size: 0.85rem; line-height: 1.8; color: var(--text); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.footer-copy { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.footer-copy img { width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; }
.footer-legal { font-size: 0.75rem; color: var(--muted); max-width: 520px; line-height: 1.6; }

/* ── Buyer pages (pay and POS, refund claim, fundraising) ───────────────── */
/* One centred column with the 16px phone gutter. Until 2026-11-15 these pages
   had no rule for it: the card sat at the left edge on tablets and desktops
   and touched both screen edges on a phone. The page's own header, card and
   footer keep their widths (width: 100%, max-width). */
body.buyer-page {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; padding: 24px 16px;
}

/* ── Scroll-reveal ─────────────────────────────────────────────────────── */

.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: none; }
.fade-in.delay-1 { transition-delay: 0.1s; }
.fade-in.delay-2 { transition-delay: 0.2s; }
.fade-in.delay-3 { transition-delay: 0.3s; }

/* Without JS (or with reduced motion) content must still be visible. */
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; }
}

/* ── Utilities ─────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Breakpoints ───────────────────────────────────────────────────────────
   Three stops, shared by every surface. The dashboard shell (stage 4) hangs
   its sidebar behaviour off the same two thresholds rather than inventing
   its own. */

/* No icon rail at the tablet stop. The original plan narrowed the sidebar to
   68px of icons here; seven unlabelled destinations are a guessing game, so the
   full sidebar collapses straight to a drawer instead (dashboard.html handles
   that at the same 1099px). --sidebar-w therefore has one value. */

/* The marketing nav collapses to a drawer at 1099px, NOT at 820px, because that
   is where it stops fitting. Measured on the widest bar (the eight top-level
   links): logo 112 + links 794 + toggle 94, plus a 24px flex gap either side and
   the container's 24px gutters, is 1072px of unshrinkable content — every link
   carries `white-space: nowrap` so the row has no give at all. With the drawer
   at 820 the whole 821–1071px band overflowed: +48px at 1024, the commonest
   tablet-landscape and small-laptop width, on all seven pages that carry a full
   nav. 1099 is not a new number — it is the existing tablet stop the dashboard
   sidebar already collapses at, and it clears 1072 with room for a longer CTA.
   The footer grid keeps its own 820 stop below; the two were only ever sharing
   a block, not a reason. */
@media (max-width: 1099px) {
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 20px;
    gap: 16px;
    box-shadow: var(--shadow-pop);
  }
  .nav-mobile-toggle { display: block; }
}

/* Mobile — the app sidebar goes off-canvas and the footer halves its columns. */
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 500px) {
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; }
}
