/* AllPaid app-layer design tokens — CSS custom properties.
 * GENERATED from tokens/app-tokens.json. Do not hand-edit; change the JSON and regenerate.
 * v0.3.0 · WCAG 2.1 AA target
 * v0.3.0 adds the tokens the CYG UI Refresh prototype needed and the app layer
 * did not yet name: the agency header ramp and its on-dark scale, the inset
 * hairline/ring set, field and validation colors, and two type steps.
 *
 * Load AFTER the AllPaid brand stylesheets:
 *   <link rel="stylesheet" href="…/tokens/colors.css">
 *   <link rel="stylesheet" href="…/styles.css">
 *   <link rel="stylesheet" href="tokens/app-tokens.css">
 *
 * Consume semantic tokens only (--app-*). The brand mirrors and the two
 * rebindings below are implementation detail.
 */

:root {
  /* ---- Brand rebindings (adopted overrides) ------------------------------
   * White on brand #28AC40 is 2.97:1, which fails AA for text and misses the
   * 3:1 non-text floor. The AllPaid kit binds Button's green tone to
   * --green-600, so the app rebinds that name rather than forking components.
   * The identity green stays reachable as --brand-green.
   */
  --brand-green: #28AC40;
  --green-600: #1F8431; /* was #28AC40 · 4.77:1 with white */
  --green-700: #155B22; /* hover, one step darker than the rebound base */

  /* ---- Surfaces & text -------------------------------------------------- */
  --app-bg: #F7F7F7;
  --app-surface: #FFFFFF;
  --app-sunken: #F1F4F2;
  --app-border: rgba(38, 38, 38, 0.10);
  --app-border-strong: #DEDEDE;
  --app-border-field: #D4D4D4;  /* input, radio and checkbox outlines · 3.1:1 non-text */
  --app-divider: #E5E5E5;
  --app-surface-alt: #F5F5F5;   /* read-only fields, locked payment details */
  --app-surface-subtle: #F9F9F9;
  --app-surface-tint: #F2F7F3;  /* summary wells on light backgrounds */
  --app-text: #262626;          /* 15.1:1 on white */
  --app-head: #1E293B;          /* 14.6:1 on white */
  --app-text-1: #454545;        /* 9.2:1 · dense receipt and table body */
  --app-text-2: #5E5E5E;        /* 6.49:1 · overrides brand neutral-600 (4.41:1) */
  --app-text-label: #787878;    /* 4.55:1 · uppercase eyebrow labels only, 12px bold and up */
  --app-text-3: #919191;        /* 3.2:1 · non-text only */
  --app-scrim: rgba(5, 7, 10, 0.48);

  /* ---- Action & focus --------------------------------------------------- */
  --app-action: #1F8431;
  --app-action-hover: #155B22;
  --app-focus: #1F8431;
  --app-error: #B42318;         /* 6.4:1 · inline field validation text and border */
  --app-error-surface: #FDE7E7;
  /* app-gpn additions, not in the design tokens yet */
  --app-chrome: #05070A;       /* forest-ink · inverse header/footer */
  --app-chrome-fg: #FFFFFF;
  --app-hero: #004C45;         /* forest · agency hero gradient start */
  --app-hero-end: #05070A;
  --app-on-hero: #FFFFFF;

  /* ---- Agency header: the dark forest ramp the payment flow runs under ----
   * One gradient, used on every agency-branded header and hero. On-dark text
   * is full-opacity white for anything a payer must read; the alpha steps are
   * for secondary copy and hairlines only.
   */
  --app-agency-gradient: linear-gradient(160deg, #000D09 0%, #001F14 30%, #003D26 65%, #006B40 100%);
  --app-agency-ink: #05070A;        /* footer and print band */
  --app-on-dark: #FFFFFF;
  --app-on-dark-2: rgba(255, 255, 255, 0.85);
  --app-on-dark-3: rgba(255, 255, 255, 0.70);  /* non-essential copy only */
  --app-on-dark-accent: #7BE495;    /* active step, links and confirmations on dark */
  --app-on-dark-fill: rgba(255, 255, 255, 0.08);
  --app-on-dark-fill-strong: rgba(255, 255, 255, 0.12);
  --app-on-dark-hairline: rgba(255, 255, 255, 0.18);
  --app-on-dark-ring: rgba(255, 255, 255, 0.32);
  --app-on-dark-ring-strong: rgba(255, 255, 255, 0.40);

  /* ---- Status: the canonical five --------------------------------------- */
  --app-status-outstanding-bg: #F1F4F2;
  --app-status-outstanding-fg: #454545;  /* 8.8:1 */
  --app-status-overdue-bg: #FDE7E7;
  --app-status-overdue-fg: #9B1C23;      /* 6.9:1 */
  --app-status-pending-bg: #FEE3C6;
  --app-status-pending-fg: #8A5212;      /* 5.6:1 */
  --app-status-paid-bg: #DEF7E3;
  --app-status-paid-fg: #155B22;         /* 7.3:1 */
  --app-status-refunded-bg: #F7F7F7;
  --app-status-refunded-fg: #454545;     /* 8.9:1 */

  /* ---- Type scale ------------------------------------------------------- */
  --app-font-display: 500 32px/40px var(--font-sans);
  --app-font-title-lg: 600 24px/32px var(--font-sans);
  --app-font-title: 600 20px/28px var(--font-sans);
  --app-font-title-sm: 600 17px/24px var(--font-sans);
  --app-font-body: 400 16px/24px var(--font-sans);
  --app-font-body-sm: 400 14px/20px var(--font-sans);
  --app-font-label: 600 14px/20px var(--font-sans);
  --app-font-title-md: 600 22px/30px var(--font-sans);
  --app-font-caption: 400 12px/16px var(--font-sans);
  --app-font-body-xs: 400 13px/20px var(--font-sans);  /* receipt and summary metadata */
  --app-font-eyebrow: 700 12px/16px var(--font-sans);
  --app-font-amount: 600 28px/34px var(--font-sans);
  --app-font-amount-hero: 600 40px/46px var(--font-sans);
  --app-display-tracking: 0.01em; /* display only */
  --app-eyebrow-tracking: 0.06em;

  /* ---- Density: comfortable is the default ------------------------------ */
  --row-h: 56px;
  --control-h: 48px;
  --button-h: 48px;
  --cell-y: 14px;
  --row-font: 15px;

  /* ---- Targets --------------------------------------------------------- */
  --app-target-min: 44px;
  --app-target: 48px;
  --app-target-clearance: 8px;

  /* ---- Radius ---------------------------------------------------------- */
  --app-radius-control: 8px;
  --app-radius-card: 12px;
  --app-radius-panel: 16px;
  --app-radius-chip: 6px;
  --app-radius-row: 10px;   /* nested rows inside a card */
  --app-radius-pill: 999px;
  --app-radius-circle: 50%;

  /* ---- Shadow ---------------------------------------------------------- */
  --app-shadow-card: 0 8px 24px rgba(18, 18, 18, 0.08);
  --app-shadow-overlay: 0 16px 40px rgba(18, 18, 18, 0.16);
  --app-shadow-sticky: 0 -1px 2px rgba(18, 18, 18, 0.06);

  /* Inset hairlines and rings. The app has no 1px borders: every edge is an
   * inset shadow, so it never affects layout and never doubles on adjacent
   * rows. --app-hairline-top / -bottom are the row and section dividers. */
  --app-ring: inset 0 0 0 1px rgba(38, 38, 38, 0.10);
  --app-ring-strong: inset 0 0 0 1px rgba(38, 38, 38, 0.24);
  --app-ring-field: inset 0 0 0 1px #D4D4D4;
  --app-ring-selected: inset 0 0 0 1.5px #1F8431;
  --app-ring-error: inset 0 0 0 1.5px #B42318;
  --app-hairline-top: inset 0 1px 0 rgba(38, 38, 38, 0.10);
  --app-hairline-bottom: inset 0 -1px 0 rgba(38, 38, 38, 0.10);
  --app-elevation-card: inset 0 0 0 1px rgba(38, 38, 38, 0.10), 0 8px 24px rgba(18, 18, 18, 0.08);

  /* ---- Motion ---------------------------------------------------------- */
  --app-dur-fast: 120ms;
  --app-dur-base: 200ms;
  --app-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --app-ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Layout ---------------------------------------------------------- */
  --app-bp-sm: 390px;
  --app-bp-md: 600px;
  --app-bp-lg: 1024px;
  --app-bp-xl: 1280px;
  --app-container-max: 1200px;
  --app-grid-base: 4px;
  --app-topbar-h: 64px;
  --app-tabbar-h: 68px;
  --app-agency-header-h: 72px;

  /* ---- Wallet marks ------------------------------------------------------
   * Third-party brand colors, fixed by their owners. Reproduce exactly. */
  --app-wallet-apple: #000000;
  --app-wallet-google-blue: #4285F4;
  --app-wallet-google-red: #EA4335;
  --app-wallet-google-yellow: #FBBC05;
  --app-wallet-google-green: #34A853;
}

/* Compact: pointer-only, LG-only opt-in for tables.
 * Apply [data-density="compact"] on a container, never on touch. */
[data-density="compact"] {
  --row-h: 44px;
  --control-h: 36px;
  --button-h: 40px;
  --cell-y: 9px;
  --row-font: 14px;
}

/* Mobile type steps. Body, body-sm, label and caption never change. */
@media (max-width: 600px) {
  :root {
    --app-font-display: 500 26px/32px var(--font-sans);
    --app-font-title-lg: 600 22px/30px var(--font-sans);
    --app-font-title: 600 18px/26px var(--font-sans);
    --app-font-title-sm: 600 16px/24px var(--font-sans);
    --app-font-amount: 600 24px/30px var(--font-sans);
    --app-font-title-md: 600 20px/28px var(--font-sans);
    --app-font-amount-hero: 600 32px/38px var(--font-sans);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --app-dur-fast: 0ms;
    --app-dur-base: 0ms;
  }
}
