/* ==========================================================================
   CalculatorLuv — Design Tokens
   Every color, radius, shadow and spacing value used anywhere on the site
   must come from here. No component file should ever hardcode a color.
   This is what makes dark mode automatic across every calculator.
   ========================================================================== */

:root{
  /* ---- Brand ---- */
  --primary:        #4f46e5;
  --primary-hover:  #4338ca;
  --primary-soft:   #eef2ff;
  --success:        #16a34a;
  --success-soft:   #ecfdf3;
  --danger:         #dc2626;

  /* ---- Surfaces & text (light theme = default) ---- */
  --bg:             #ffffff;
  --bg-secondary:   #f7f8fa;
  --surface:        #ffffff;
  --surface-hover:  #f3f4f6;
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;

  --text-primary:   #0f1115;
  --text-secondary: #5b6270;
  --text-tertiary:  #9098a4;
  --text-on-primary:#ffffff;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(15,17,21,0.05), 0 1px 1px rgba(15,17,21,0.03);
  --shadow-md: 0 4px 12px rgba(15,17,21,0.06), 0 1px 2px rgba(15,17,21,0.04);
  --shadow-lg: 0 12px 32px rgba(15,17,21,0.10), 0 2px 6px rgba(15,17,21,0.05);

  /* ---- Shape ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* ---- Spacing scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* ---- Type ---- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* ---- Motion (kept intentionally short) ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 150ms;
}

/* ---- Dark theme ---- */
[data-theme="dark"]{
  --primary:        #818cf8;
  --primary-hover:  #a5b4fc;
  --primary-soft:   rgba(129,140,248,0.14);
  --success:        #4ade80;
  --success-soft:   rgba(74,222,128,0.12);
  --danger:         #f87171;

  --bg:             #0a0b0f;
  --bg-secondary:   #111319;
  --surface:        #15171f;
  --surface-hover:  #1c1f29;
  --border:         #242835;
  --border-strong:  #323848;

  --text-primary:   #f3f4f6;
  --text-secondary: #9aa1af;
  --text-tertiary:  #676f7e;
  --text-on-primary:#0a0b0f;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
}

/* Respect system preference the instant before JS runs, so there is no flash.
   theme.js will overwrite this with the user's saved choice if one exists. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --primary:        #818cf8;
    --primary-hover:  #a5b4fc;
    --primary-soft:   rgba(129,140,248,0.14);
    --success:        #4ade80;
    --success-soft:   rgba(74,222,128,0.12);
    --danger:         #f87171;
    --bg:             #0a0b0f;
    --bg-secondary:   #111319;
    --surface:        #15171f;
    --surface-hover:  #1c1f29;
    --border:         #242835;
    --border-strong:  #323848;
    --text-primary:   #f3f4f6;
    --text-secondary: #9aa1af;
    --text-tertiary:  #676f7e;
    --text-on-primary:#0a0b0f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
  }
}
