/*
 * CoSavr palette — Mango & Slate.
 *
 * Mirrored value for value from the app's design system:
 *   ios/Packages/Core/Sources/DesignSystem/CSColors.swift
 *
 * ⚠️ These are not "close enough" web equivalents. They are the same hexes the
 * app ships, including the WCAG corrections made in iOS-156: --text-secondary
 * and --status-positive-fg were both darkened there because the original
 * palette values measured under 4.5:1 on body text. Do not restore the values
 * in `design-mock-icon/03 - color palette.html`; that file predates the fix.
 *
 * Light is defined on bare :root so a browser with no preference, or one that
 * cannot report one, still gets a complete palette.
 */

:root {
  --bg-primary: #F4EFE6;          /* Cloud Dancer — page canvas */
  --bg-secondary: #FBF8F4;        /* Cloud Light — cards, raised surfaces */

  --accent-primary: #E8601A;      /* Mango — the one accent */
  --accent-primary-pressed: #C04E10;
  --accent-primary-tint: #FBEADF; /* soft mango fill */
  --accent-secondary: #F2A44A;    /* Papaya — same in both modes */

  --info: #4A8FC0;                /* Sky — links, savings */

  --border: #E5DCCB;              /* hairlines on surfaces */

  --text-primary: #2A1F14;        /* Espresso — body and headings */
  --text-secondary: #6A5C4C;      /* iOS-156: 4.64:1 worst case, was 3.61:1 */

  --status-positive-bg: #FDE8D8;
  --status-positive-fg: #AD4400;  /* iOS-156: 4.91:1, was 4.47:1 */

  --danger: #D92D20;              /* Warm Vermillion */

  /* Derived for the web, not copied from the app.
   *
   * The app applies Mango to large figures and to filled controls whose text
   * it sizes itself. On a web page the same colour also lands on 12px kickers
   * and body links, where it measures 4.23:1 on the cream ground and fails.
   * --accent-text is the accent at a weight that survives small text on every
   * surface the site uses; --on-accent is what sits *on* a mango fill, where
   * white manages only 3.43:1. Both values are hexes the app already ships.
   * --info-text does the same for Sky on the demo's Money in figures, where
   * Sky is 3.32:1 on a card. The app has no darker Sky, so this one is new. */
  --accent-text: #AD4400;         /* 5.09 on canvas, 4.98 on tint, 5.50 on card */
  --on-accent: #2A1F14;           /* 4.69 on mango, 7.81 on papaya, 6.19 on dark mango */
  --info-text: #2F6F9C;           /* 4.73 on canvas, 5.12 on card */

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #2E2C2A;        /* Slate */
    --bg-secondary: #3D3A37;      /* Ash */

    --accent-primary: #FF7A2F;
    --accent-primary-pressed: #E8601A;
    --accent-primary-tint: #4A2A14;
    --accent-secondary: #F2A44A;

    --info: #72B8E8;

    --border: #4A4642;

    --text-primary: #F4EFE6;
    --text-secondary: #BAB0A6;    /* iOS-156: 4.88:1 worst case */

    --status-positive-bg: #5A2E10;
    --status-positive-fg: #FF9A60;

    --danger: #FF5A4D;

    --accent-text: #FF9A60;       /* 6.65 on slate, 5.40 on ash, 6.15 on tint */
    --on-accent: #2A1F14;         /* unchanged: dark text on a bright fill */
    --info-text: #72B8E8;         /* Sky itself: 6.45 on slate, 5.24 on ash */
  }
}
