/* =========================================================================
   shared.css — design tokens + reset
   Source of truth: design.md §2 (palette), §3 (typography), §4 (layout).
   ========================================================================= */

:root {
  /* Core palette — M4 (Forge) */
  --color-bg: #13131C;
  --color-surface: #1A1A24;
  --color-surface-raised: #22222E;
  --color-primary: #F59E0B;
  --color-primary-hover: #FBBF24;
  --color-primary-fg: #0A0A0F;
  --color-accent: #DC2626;
  --color-accent-hover: #EF4444;
  --color-accent-fg: #FFFFFF;
  --color-text: #F8FAFC;
  --color-text-muted: #94A3B8;
  --color-border: rgba(255,255,255,0.08);
  --color-border-strong: rgba(255,255,255,0.16);

  /* Alias for Tebex.checkout.init — main.js:1755-1758 reads --color-secondary
     via getComputedStyle. Pre-M4 retornaba empty string (bug). */
  --color-secondary: var(--color-accent);

  /* Brand mark — gradient as token (M4 introduces) */
  --gradient-primary: linear-gradient(90deg, #DC2626 0%, #F59E0B 100%);

  /* Price */
  --color-price: #FBBF24;

  /* Semantic — danger=accent (lava), warning=primary (amber) */
  --color-success: #22C55E;
  --color-danger: #DC2626;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;

  /* Badges — M4 (Forge): popular=amber, hot=lava, new=success bright, limited=gradient */
  --badge-popular-bg: #F59E0B; --badge-popular-fg: #0A0A0F;
  --badge-hot-bg: #DC2626;     --badge-hot-fg: #FFFFFF;
  --badge-new-bg: #22C55E;     --badge-new-fg: #0A0A0F;
  --badge-limited-bg: var(--gradient-primary); --badge-limited-fg: #FFFFFF;

  /* Typography */
  --font-display: "Unbounded", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Menlo", monospace;

  --text-xs: 0.75rem;    --lh-xs: 1rem;
  --text-sm: 0.875rem;   --lh-sm: 1.25rem;
  --text-base: 1rem;     --lh-base: 1.5rem;
  --text-lg: 1.125rem;   --lh-lg: 1.75rem;
  --text-xl: 1.25rem;    --lh-xl: 2rem;
  --text-2xl: 1.5rem;    --lh-2xl: 2.25rem;
  --text-3xl: 2rem;      --lh-3xl: 2.75rem;
  --text-4xl: 2.75rem;   --lh-4xl: 3.5rem;
  --text-hero: 4.5rem;   --lh-hero: 5.25rem;

  /* Spacing (4px base) */
  --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;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

  /* Glow signature — M4 (Forge) */
  --shadow-glow-cta: 0 0 24px rgba(245,158,11,0.55), 0 0 4px rgba(220,38,38,0.4);
  --shadow-glow-cta-hover: 0 0 32px rgba(245,158,11,0.7), 0 0 6px rgba(220,38,38,0.5);
  --shadow-glow-cta-focus: 0 0 12px rgba(245,158,11,0.5);
  --shadow-glow-amber: 0 0 32px rgba(245,158,11,0.35);
  --shadow-glow-lava: 0 0 32px rgba(220,38,38,0.35);
  --text-shadow-price: 0 0 18px rgba(251,191,36,0.55);

  /* Layout */
  --content-max-width: 1280px;
  --gutter: 24px;
  --header-h: 72px;
  --bottom-nav-h: 64px;

  /* Mouse cursor glow (set by JS) */
  --mouse-x: 50%;
  --mouse-y: 50%;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-feature-settings: "ss01", "cv02", "cv11";
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { max-width: 100%; display: block; }
a { color: inherit; } /* keep browser-default underline for inline body links (a11y) — components like .btn opt out explicitly */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-glow-cta-focus);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
