/* ==========================================================================
   RATELi TFM Academy - Design tokens
   --------------------------------------------------------------------------
   The single source of truth for the visual language. Everything downstream
   reads these custom properties; nothing hard codes a colour, radius or
   shadow, so the whole academy changes together.

   Visual language: theme.md (the Pearl theme). Warm white canvas in light
   mode and near-black surfaces in dark, DM Sans throughout, flame orange as the primary
   colour with amber as the second, softly outlined cards with 12-16px radii
   and a restrained orange glow on brand marks and featured panels. Profit
   green and loss red keep their meaning on trading screens.

   Brand rule kept: the wordmark is RATELi, with the lowercase trailing "i"
   in the accent colour.
   ========================================================================== */

:root {
  /* --- Brand (RATELi FX palette) ----------------------------------------- */
  --brand-accent: #F47721;          /* 2.100: RATELi Orange, the approved brand colour */
  --brand-accent-bright: #FF9A4D;
  --brand-accent-deep: #C2410C;
  /* 2.100: the approved supporting colours (System Control > Brand). */
  --brand-orange: #F47721;
  --brand-ink-navy: #0B1F44;
  --brand-green: #10B981;
  --brand-blue: #2563EB;
  --brand-light: #F8FAFC;
  --brand-accent-ink: #1c1004;      /* text on orange and amber buttons */
  --brand-secondary: #f59e0b;       /* amber, the second accent */
  --brand-navy: #18181b;            /* ink */
  --brand-slate: #27272a;

  /* --- Market semantics -------------------------------------------------- */
  --bull: #00b386;
  --bull-soft: rgba(0, 179, 134, 0.12);
  --bear: #ff4b5c;
  --bear-soft: rgba(255, 75, 92, 0.12);
  --neutral: #94a3b8;

  /* --- Status ------------------------------------------------------------ */
  --info: #f59e0b;
  --info-soft: rgba(245, 158, 11, 0.12);
  --success: #00b386;
  --success-soft: rgba(0, 179, 134, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ff4b5c;
  --danger-soft: rgba(255, 75, 92, 0.12);

  /* --- Typography -------------------------------------------------------- */
  --font-display: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "DM Sans", "Segoe UI", system-ui, sans-serif; /* figures: DM Sans, tabular */
  --font-code: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace; /* code blocks only */

  --text-2xs: 0.7rem;
  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.375rem;
  --text-4xl: 3rem;
  --text-5xl: 3.75rem;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.03em;
  --tracking-caps: 0.08em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* --- Spacing ----------------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Radii: RATELi FX uses 12px everywhere, 16 to 20 on feature cards -- */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  /* --- Layout ------------------------------------------------------------ */
  --container: 1240px;
  --container-wide: 1480px;
  --container-narrow: 820px;
  --header-height: 70px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 76px;

  /* --- Motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 420ms;

  /* --- Z index ----------------------------------------------------------- */
  --z-base: 1;
  --z-sticky: 50;
  --z-header: 100;
  --z-drawer: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ==========================================================================
   Light theme: the default. A clear white canvas.
   ========================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;

  --page: #ffffff;          /* pure white canvas (2.37) */
  --page-alt: #f5f3ef;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f5f3ef;
  --surface-hover: #f1eee8;
  --surface-inverse: #18181b;

  --line: #efebe5;
  --line-strong: #e7e3dd;
  --line-accent: rgba(249, 115, 22, 0.4);

  --text: #3f3f46;
  --text-strong: #18181b;
  --text-muted: #71717a;
  --text-dim: #a1a1aa;
  --text-inverse: #ffffff;

  --accent: var(--brand-accent);
  --accent-hover: var(--brand-accent-deep);
  --accent-soft: #fff0df;
  --accent-ghost: rgba(249, 115, 22, 0.06);
  --accent-text: #c2410c;

  /* The RATELi FX card shadow: two soft, low layers. */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 30px 60px -24px rgba(15, 23, 42, 0.25);
  --shadow-accent: 0 4px 14px rgba(249, 115, 22, 0.3);

  --glass: rgba(255, 255, 255, 0.95);
  --glass-border: #efebe5;

  --grid-line: rgba(24, 24, 27, 0.04);
  --chart-grid: rgba(24, 24, 27, 0.07);
  --chart-axis: #a1a1aa;
  --chart-crosshair: rgba(249, 115, 22, 0.6);

  --hero-glow-a: rgba(249, 115, 22, 0.12);
  --hero-glow-b: rgba(245, 158, 11, 0.1);
  --hero-glow-c: rgba(249, 115, 22, 0.05);
}

/* ==========================================================================
   Dark theme: only when a person chooses it with the theme switch.
   ========================================================================== */

[data-theme="dark"] {
  color-scheme: dark;

  --page: #090a0f;
  --page-alt: #0d0e14;
  --surface: #101219;
  --surface-raised: #141720;
  --surface-sunken: #171a23;
  --surface-hover: #1c202b;
  --surface-inverse: #f3f4f6;

  --line: #1f222c;
  --line-strong: #292c36;
  --line-accent: rgba(251, 146, 60, 0.4);

  --text: #d1d5db;
  --text-strong: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --text-inverse: #18181b;

  --accent: var(--brand-accent);
  --accent-hover: #fdba74;
  --accent-soft: rgba(249, 115, 22, 0.1);
  --accent-ghost: rgba(249, 115, 22, 0.06);
  --accent-text: #fb923c;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 30px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 28px 60px -24px rgba(0, 0, 0, 0.8);
  --shadow-accent: 0 4px 18px rgba(249, 115, 22, 0.35);

  --glass: rgba(16, 18, 25, 0.9);
  --glass-border: rgba(255, 255, 255, 0.06);

  --grid-line: rgba(255, 255, 255, 0.045);
  --chart-grid: rgba(255, 255, 255, 0.06);
  --chart-axis: #64748b;
  --chart-crosshair: rgba(251, 146, 60, 0.6);

  --hero-glow-a: rgba(249, 115, 22, 0.16);
  --hero-glow-b: rgba(245, 158, 11, 0.1);
  --hero-glow-c: rgba(249, 115, 22, 0.08);
}
