/* ==========================================================================
   CFI PROVIDENCIA - Demo V3 - Design Tokens (3-Layer Architecture)
   Layer 1: Primitives | Layer 2: Semantic | Layer 3: Component
   ========================================================================== */

/* === LAYER 1: PRIMITIVE TOKENS === */
:root {
  /* Colors - Green palette */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #72BE44;
  --green-600: #5a9e35;
  --green-700: #0B5D18;
  --green-800: #073d10;
  --green-900: #052e0a;

  /* Colors - Yellow palette */
  --yellow-50: #fefce8;
  --yellow-100: #fef9c3;
  --yellow-200: #fef08a;
  --yellow-300: #fde047;
  --yellow-400: #FFF100;
  --yellow-500: #eab308;

  /* Colors - Neutral palette */
  --neutral-0: #ffffff;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;

  /* Spacing (4px base unit) */
  --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;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.05rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.65;
  --line-height-loose: 1.75;

  --letter-spacing-tight: -0.03em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.08em;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 24px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.12);
  --shadow-xl: 0 20px 60px rgb(0 0 0 / 0.16);

  /* Durations */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* Easings */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === LAYER 2: SEMANTIC TOKENS (Light Mode) === */
:root {
  /* Background */
  --color-background: var(--neutral-0);
  --color-background-alt: var(--neutral-100);
  --color-background-subtle: var(--neutral-50);
  --color-surface: var(--neutral-0);

  /* Foreground */
  --color-foreground: var(--neutral-900);
  --color-foreground-secondary: var(--neutral-600);
  --color-foreground-muted: var(--neutral-500);

  /* Primary */
  --color-primary: var(--green-500);
  --color-primary-dark: var(--green-700);
  --color-primary-light: var(--green-100);
  --color-primary-hover: var(--green-600);
  --color-primary-foreground: var(--neutral-0);

  /* Accent */
  --color-accent: var(--yellow-400);
  --color-accent-foreground: var(--neutral-900);

  /* Border */
  --color-border: var(--neutral-200);
  --color-border-subtle: rgba(114, 190, 68, 0.08);

  /* Focus */
  --color-focus-ring: var(--green-500);

  /* Spacing - Semantic */
  --spacing-section: var(--space-24);
  --spacing-section-sm: var(--space-16);
  --spacing-component: var(--space-8);
  --spacing-element: var(--space-4);

  /* Layout */
  --container-max: 1200px;
  --header-height: 76px;
}

/* === LAYER 2: SEMANTIC TOKENS (Dark Mode) === */
[data-theme="dark"] {
  --color-background: var(--neutral-950);
  --color-background-alt: var(--neutral-900);
  --color-background-subtle: var(--neutral-800);
  --color-surface: var(--neutral-900);

  --color-foreground: var(--neutral-50);
  --color-foreground-secondary: var(--neutral-400);
  --color-foreground-muted: var(--neutral-500);

  --color-primary: var(--green-400);
  --color-primary-dark: var(--green-500);
  --color-primary-light: rgba(114, 190, 68, 0.12);
  --color-primary-hover: var(--green-300);
  --color-primary-foreground: var(--neutral-900);

  --color-accent: var(--yellow-300);
  --color-accent-foreground: var(--neutral-900);

  --color-border: var(--neutral-800);
  --color-border-subtle: rgba(114, 190, 68, 0.1);

  --color-focus-ring: var(--green-400);

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.2);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.25);
  --shadow-md: 0 4px 24px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 60px rgb(0 0 0 / 0.5);
}

/* === LAYER 3: COMPONENT TOKENS === */
:root {
  /* Header */
  --header-bg: rgba(255, 255, 255, 0.92);
  --header-bg-scrolled: rgba(255, 255, 255, 0.97);
  --header-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);

  /* Button */
  --btn-padding-x: var(--space-8);
  --btn-padding-y: var(--space-4);
  --btn-radius: var(--radius-xl);
  --btn-font-size: var(--font-size-sm);
  --btn-font-weight: var(--font-weight-semibold);
  --btn-min-height: 48px;

  /* Card */
  --card-bg: var(--color-surface);
  --card-border: var(--color-border-subtle);
  --card-padding: var(--space-8);
  --card-radius: var(--radius-2xl);
  --card-shadow: var(--shadow-md);
  --card-shadow-hover: var(--shadow-lg);

  /* Input */
  --input-bg: var(--color-background);
  --input-border: var(--color-border);
  --input-border-focus: var(--color-primary);
  --input-radius: var(--radius-xl);
  --input-padding: var(--space-4) var(--space-5);
  --input-focus-ring: 0 0 0 4px rgba(114, 190, 68, 0.08);

  /* Nav */
  --nav-link-padding: var(--space-3) var(--space-5);
  --nav-link-radius: var(--radius-lg);

  /* Section label */
  --label-padding: var(--space-2) var(--space-4);
  --label-radius: var(--radius-full);
  --label-font-size: var(--font-size-xs);
}

[data-theme="dark"] {
  --header-bg: rgba(10, 10, 10, 0.92);
  --header-bg-scrolled: rgba(10, 10, 10, 0.97);
  --header-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
