/*
 * NightPOS design tokens. Principle: glassmorphism on a deep violet-navy night sky with gold accents
 * ("Reborn Wave"). Components in app.css must only use these custom properties.
 * Breakpoints (media queries cannot read custom properties, so app.css repeats the literals):
 *   sm 640px, md 768px, lg 1024px, xl 1280px, 2xl 1536px.
 */
:root {
  color-scheme: dark;

  /* palette */
  --color-bg: #120e24;
  --color-bg-raised: #1d1838;
  --color-bg-glow-a: rgba(125, 107, 214, 0.28);
  --color-bg-glow-b: rgba(247, 215, 116, 0.1);
  --color-surface: rgba(29, 24, 56, 0.66);
  --color-surface-solid: #1d1838;
  --color-surface-hi: rgba(255, 243, 196, 0.07);
  --color-surface-input: rgba(18, 14, 36, 0.7);
  --color-fg: #f1e9d2;
  --color-fg-strong: #fff3c4;
  --color-muted: #b7aed4;
  --color-border: rgba(247, 215, 116, 0.22);
  --color-border-strong: rgba(247, 215, 116, 0.55);

  --color-primary: #f7d774;
  --color-primary-strong: #f3b52f;
  --color-primary-light: #ffe89a;
  --color-primary-dark: #a06a0c;
  --color-primary-fg: #2a1a00;
  --color-accent-text: #f7d774;
  --color-secondary: #6d5cc7;
  --color-secondary-fg: #ffffff;
  --color-accent: #ffe89a;
  --color-accent-fg: #2a1a00;

  --color-success: #62dba6;
  --color-success-bg: rgba(98, 219, 166, 0.14);
  --color-success-fg: #0b2a1d;
  --color-warning: #f3b52f;
  --color-warning-bg: rgba(243, 181, 47, 0.16);
  --color-warning-fg: #2a1a00;
  --color-destructive: #ff8fa0;
  --color-destructive-bg: rgba(255, 143, 160, 0.14);
  --color-destructive-fg: #2d0610;
  --color-focus: #ffe89a;
  --color-qr-bg: #fffdf4;
  --color-qr-fg: #120e24;
  --color-scrim: rgba(10, 7, 22, 0.72);
  --color-star: #fff3c4;
  /* text laid over a photo: always light on a dark fade, whatever the theme */
  --color-on-photo: #ffffff;
  --color-photo-scrim: rgba(5, 5, 10, 0.82);
  --color-photo-ring: rgba(255, 255, 255, 0.85);

  /* spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --tap-size: 44px;

  /* radius */
  --radius-none: 0;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(5, 3, 14, 0.5);
  --shadow-md: 0 6px 18px rgba(5, 3, 14, 0.45);
  --shadow-lg: 0 14px 36px rgba(5, 3, 14, 0.55);
  --shadow-xl: 0 28px 70px rgba(5, 3, 14, 0.65);
  --shadow-inner: inset 0 1px 0 rgba(255, 243, 196, 0.08), inset 0 0 18px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 0 1px rgba(247, 215, 116, 0.35), 0 8px 28px rgba(243, 181, 47, 0.22);
  --blur-glass: 14px;

  /* typography: system stacks only (strict CSP, no external fonts) */
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.5rem;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-bold: 800;
  --leading-tight: 1.15;
  --leading-body: 1.5;

  /* z-index */
  --z-bg: -1;
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-toast: 600;
  --z-tooltip: 700;

  /* motion */
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --duration-slow: 480ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* breakpoints, for reference and JS matchMedia */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1536px;
}

/* The brand look is dark and gold; the light theme is opt-in via <html data-theme="light">. */
:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #f7f2e4;
  --color-bg-raised: #fffaec;
  --color-bg-glow-a: rgba(141, 125, 224, 0.2);
  --color-bg-glow-b: rgba(243, 181, 47, 0.2);
  --color-surface: rgba(255, 250, 236, 0.78);
  --color-surface-solid: #fffaec;
  --color-surface-hi: rgba(42, 26, 90, 0.05);
  --color-surface-input: rgba(255, 253, 244, 0.9);
  --color-fg: #261c47;
  --color-fg-strong: #170f33;
  --color-muted: #5b5280;
  --color-border: rgba(160, 106, 12, 0.3);
  --color-border-strong: rgba(160, 106, 12, 0.7);
  --color-accent-text: #7a4f00;
  --color-secondary: #5b49b8;
  --color-success: #0d7a4f;
  --color-success-bg: rgba(13, 122, 79, 0.12);
  --color-warning: #8a5a00;
  --color-warning-bg: rgba(243, 181, 47, 0.22);
  --color-destructive: #b3243b;
  --color-destructive-bg: rgba(179, 36, 59, 0.1);
  --color-focus: #5b49b8;
  --color-scrim: rgba(38, 28, 71, 0.5);
  --color-star: #a06a0c;
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, 0.18);
  --shadow-md: 0 6px 18px rgba(60, 40, 10, 0.16);
  --shadow-lg: 0 14px 36px rgba(60, 40, 10, 0.2);
  --shadow-xl: 0 28px 70px rgba(60, 40, 10, 0.28);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 14px rgba(160, 106, 12, 0.08);
  --shadow-glow: 0 0 0 1px rgba(160, 106, 12, 0.4), 0 8px 24px rgba(243, 181, 47, 0.3);
}
