/* =====================================================================
   PROTIDEFX COLOR TOKENS  —  the ONLY file you need to edit to recolor
   the site. See docs/COLOR_CUSTOMIZATION.md.

   Format: every token is an HSL triplet "H S% L%" (no hsl() wrapper),
   because the vendor CSS uses them as  hsl(var(--token) / alpha).
   The hex next to each value is for reference only — if you change a
   color, update the triplet (the hex comment is just a note).

   The site's BASE color (buttons, links, highlights) is NOT here: it is
   set in Admin → System Settings → General Settings → "Site Base Color".
   ===================================================================== */

/* ---------- GENERAL PALETTE (use these for all new pages) ----------
   The whole site uses ONE primary color + five fixed colors. New pages
   and components must use only these (plus the neutral tokens below for
   backgrounds, text and borders). Do NOT add tokens per page or section:
   for a soft background use the same color with alpha, e.g.
       background: hsl(var(--pfx-success) / 0.12);
   ------------------------------------------------------------------- */
:root {
  /* Primary = admin "Site Base Color" (set by the vendor color.php).
     Do not edit here: change it in Admin → General Settings. */
  --pfx-primary: var(--base-h, 216) var(--base-s, 100%) var(--base-l, 50%);
}

/* ---------- LIGHT MODE ---------- */
:root,
[data-pfx-theme="light"] {
  color-scheme: light;

  /* General palette (see above) */
  --pfx-brand-dark: 235 52% 13%;    /* #101333  deep brand panel: auth sidebar, hero, banners */
  --pfx-on-brand: 0 0% 100%;        /* #ffffff  text / icons on --pfx-brand-dark (use alpha for muted) */
  --pfx-success: 143 76% 30%;       /* #12873f  success, completed, verified */
  --pfx-warning: 36 68% 42%;        /* #b67a22  warnings, pending, notices */
  --pfx-danger: 0 66% 53%;          /* #d63a3a  errors, destructive actions */

  /* Backgrounds */
  --pfx-bg: 0 0% 100%;              /* #ffffff  page / sidebar / header / bottom bar  */
  --pfx-canvas: 216 29% 97%;        /* #f4f6f9  backdrop behind trading panels        */
  --pfx-surface: 0 0% 100%;         /* #ffffff  panels, cards, tables, modals        */
  --pfx-section: 210 25% 97%;       /* #f5f7f9  alternate page sections, footer       */
  --pfx-surface-2: 210 26% 93%;     /* #e7ecf1  selected row, tab bars, soft fills    */
  --pfx-control: 210 26% 93%;       /* #e7ecf1  small buttons, chips, input steppers  */
  --pfx-input: 0 0% 100%;           /* #ffffff  form inputs                           */

  /* Lines */
  --pfx-border: 213 18% 90%;        /* #e1e5ea  panel borders, inputs, tab underlines */
  --pfx-border-soft: 210 20% 94%;   /* #edf0f3  faint row / table separators          */

  /* Text */
  --pfx-text-strong: 228 14% 7%;    /* #101115  headings, prices, important values    */
  --pfx-text: 225 10% 23%;          /* #353841  normal body text                      */
  --pfx-text-muted: 220 8% 58%;     /* #8a909c  labels, placeholders, secondary text  */

  /* Inverse (active pill / selected tab: black chip in light, white chip in dark) */
  --pfx-inverse-bg: 228 14% 7%;     /* #101115 */
  --pfx-inverse-text: 0 0% 100%;    /* #ffffff */

  /* Disabled */
  --pfx-disabled-bg: 205 30% 92%;   /* #e5ecf1 */
  --pfx-disabled-text: 226 11% 71%; /* #acb0bd */

  /* Market colors */
  --pfx-up: 140 46% 56%;            /* #5dc37f  buy / price up / profit               */
  --pfx-down: 0 70% 61%;            /* #e15757  sell / price down / loss              */
  --pfx-up-soft: 138 60% 89%;       /* #d3f4dd  soft green background                 */
  --pfx-down-soft: 0 75% 94%;       /* #fbe4e4  soft red background                   */
  /* Readable shades for text + filled buy/sell buttons (≥ 4.5:1 on white) */
  --pfx-up-text: 143 76% 30%;       /* #12873f  green numbers, BUY button fill        */
  --pfx-down-text: 0 66% 53%;       /* #d63a3a  red numbers, SELL button fill         */

  /* Accents */
  --pfx-accent: 254 35% 44%;        /* #5c4a98  "Demo" badge purple                   */
  --pfx-accent-text: 0 0% 100%;     /* #ffffff  text on accent                        */
  --pfx-star: 43 50% 48%;           /* #b8963e  favourite star                        */

  /* Charts */
  --pfx-chart-bg: 0 0% 100%;        /* #ffffff */
  --pfx-chart-grid: 180 4% 95%;     /* #f2f3f3 */

  /* Loading skeletons (placeholder blocks while data loads) */
  --pfx-skeleton: 214 23% 94%;      /* #eceff3  block color      */
  --pfx-skeleton-shine: 210 33% 98%;/* #f7f9fb  moving highlight */

  /* Shadows */
  --pfx-shadow: 0 2px 12px hsl(228 14% 7% / 0.08);
  --pfx-panel-shadow: 0 1px 2px hsl(220 25% 20% / 0.04), 0 4px 14px hsl(220 25% 20% / 0.04);

  /* Panels (trading cards) */
  --pfx-radius: 10px;
}

/* ---------- DARK MODE ---------- */
[data-pfx-theme="dark"] {
  color-scheme: dark;

  /* General palette (see top of file) */
  --pfx-brand-dark: 235 42% 11%;    /* #10122a */
  --pfx-on-brand: 0 0% 100%;        /* #ffffff */
  --pfx-success: 140 46% 56%;       /* #5dc37f */
  --pfx-warning: 38 72% 56%;        /* #e3a43f */
  --pfx-danger: 0 70% 61%;          /* #e15757 */

  /* Backgrounds */
  --pfx-bg: 228 14% 7%;             /* #101115  page / sidebar / header / bottom bar  */
  --pfx-canvas: 228 14% 7%;         /* #101115  backdrop behind trading panels        */
  --pfx-surface: 225 12% 13%;       /* #1d1f25  panels, cards, tables, modals         */
  --pfx-section: 223 14% 10%;       /* #15171c  alternate page sections, footer       */
  --pfx-surface-2: 223 14% 10%;     /* #15171c  selected row, tab bars, soft fills    */
  --pfx-control: 228 8% 23%;        /* #363840  small buttons, chips, input steppers  */
  --pfx-input: 225 12% 13%;         /* #1d1f25  form inputs                           */

  /* Lines */
  --pfx-border: 225 10% 23%;        /* #353841 */
  --pfx-border-soft: 227 11% 17%;   /* #26282f */

  /* Text */
  --pfx-text-strong: 0 0% 100%;     /* #ffffff */
  --pfx-text: 223 12% 70%;          /* #a9aebb */
  --pfx-text-muted: 220 8% 58%;     /* #8a909c */

  /* Inverse */
  --pfx-inverse-bg: 0 0% 100%;      /* #ffffff */
  --pfx-inverse-text: 228 14% 7%;   /* #101115 */

  /* Disabled */
  --pfx-disabled-bg: 231 8% 30%;    /* #464853 */
  --pfx-disabled-text: 227 6% 44%;  /* #686b76 */

  /* Market colors */
  --pfx-up: 140 46% 56%;            /* #5dc37f */
  --pfx-down: 0 70% 61%;            /* #e15757 */
  --pfx-up-soft: 133 57% 9%;        /* #0a2510 */
  --pfx-down-soft: 0 45% 12%;       /* #2c1111 */
  --pfx-up-text: 140 46% 56%;       /* #5dc37f  (same as --pfx-up on dark)   */
  --pfx-down-text: 0 70% 61%;       /* #e15757  (same as --pfx-down on dark) */

  /* Accents */
  --pfx-accent: 254 35% 44%;        /* #5c4a98 */
  --pfx-accent-text: 253 79% 91%;   /* #dcd4fa */
  --pfx-star: 43 50% 48%;           /* #b8963e */

  /* Charts */
  --pfx-chart-bg: 227 23% 12%;      /* #171a25 */
  --pfx-chart-grid: 231 16% 17%;    /* #242632 */

  /* Loading skeletons */
  --pfx-skeleton: 225 12% 13%;      /* #1d1f25 */
  --pfx-skeleton-shine: 227 11% 17%;/* #26282f */

  /* Shadows */
  --pfx-shadow: 0 2px 12px hsl(0 0% 0% / 0.4);
  --pfx-panel-shadow: none;

  /* Panels (trading cards) */
  --pfx-radius: 10px;
}
