/* ============================================================================
 * HBH DIGITAL APP - DESIGN TOKENS (root.css)
 * Aturan Warna 90/8/2: 90% Netral, 8% Struktur, 2% Ramadhan Emerald Accent
 * ============================================================================ */

:root {
  /* --------------------------------------------------------------------------
   * 1. COLOR SCALE (50 - 950)
   * -------------------------------------------------------------------------- */

  /* Primary: Ramadhan Emerald */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-900: #064e3b;
  --emerald-950: #022c22;

  /* Neutral: Sage / Slate Gray */
  --neutral-0: #ffffff;
  --neutral-50: #f7f8f7;
  --neutral-100: #eff1ef;
  --neutral-200: #e2e6e3;
  --neutral-300: #cdd3cf;
  --neutral-400: #9aa39d;
  --neutral-500: #6b756f;
  --neutral-600: #4f5853;
  --neutral-700: #3a413d;
  --neutral-800: #252a27;
  --neutral-900: #161a18;
  --neutral-950: #0d100e;

  /* Semantic Colors (Light Mode Defaults) */
  --success-subtle: #ecfdf5;
  --success-base: #059669;
  --success-strong: #047857;
  --success-text: #065f46;

  --warning-subtle: #fefce8;
  --warning-base: #ca8a04;
  --warning-strong: #a16207;
  --warning-text: #854d0e;

  --danger-subtle: #fef2f2;
  --danger-base: #dc2626;
  --danger-strong: #b91c1c;
  --danger-text: #991b1b;

  /* Accent Mapping (2% Rule: primary buttons, focus rings, active indicators) */
  --accent-base: var(--emerald-700);
  --accent-hover: var(--emerald-800);
  --accent-subtle: var(--emerald-50);
  --accent-text: var(--emerald-800);

  /* Theme Mapping - Light Mode */
  --bg-canvas: var(--neutral-50);
  --bg-surface: var(--neutral-0);
  --bg-subtle: var(--neutral-100);
  --bg-elevated: var(--neutral-0);

  --border-subtle: var(--neutral-200);
  --border-default: var(--neutral-300);
  --border-strong: var(--neutral-400);
  --border-focus: var(--emerald-700);

  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-muted: var(--neutral-500);
  --text-inverse: var(--neutral-0);

  /* --------------------------------------------------------------------------
   * 2. SPACING SCALE
   * -------------------------------------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* --------------------------------------------------------------------------
   * 3. TYPOGRAPHY SCALE
   * -------------------------------------------------------------------------- */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* --------------------------------------------------------------------------
   * 4. BORDER & RADIUS SCALE
   * -------------------------------------------------------------------------- */
  --border-1: 1px;
  --border-2: 2px;

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-textarea: 1.25rem;
  --radius-pill: 9999px;

  /* Control Geometry */
  --control-height: 46px;
  --control-height-sm: 38px;
  --control-px: 1.25rem;

  /* --------------------------------------------------------------------------
   * 5. LAYOUT, Z-INDEX & TRANSITION
   * -------------------------------------------------------------------------- */
  --container-form: 560px;
  --container-dashboard: 1280px;

  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1055;
  --z-toast: 1080;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ============================================================================
 * DARK MODE THEME MAPPING
 * ============================================================================ */
[data-theme="dark"] {
  --bg-canvas: var(--neutral-950);
  --bg-surface: var(--neutral-900);
  --bg-subtle: var(--neutral-800);
  --bg-elevated: var(--neutral-800);

  --border-subtle: var(--neutral-800);
  --border-default: var(--neutral-700);
  --border-strong: var(--neutral-600);
  --border-focus: var(--emerald-500);

  --text-primary: var(--neutral-50);
  --text-secondary: var(--neutral-300);
  --text-muted: var(--neutral-400);
  --text-inverse: var(--neutral-950);

  --accent-base: var(--emerald-500);
  --accent-hover: var(--emerald-400);
  --accent-subtle: var(--emerald-950);
  --accent-text: var(--emerald-300);

  --success-subtle: #052e22;
  --success-base: #10b981;
  --success-strong: #34d399;
  --success-text: #6ee7b7;

  --warning-subtle: #2b2106;
  --warning-base: #eab308;
  --warning-strong: #facc15;
  --warning-text: #fde047;

  --danger-subtle: #2d0d0d;
  --danger-base: #ef4444;
  --danger-strong: #f87171;
  --danger-text: #fca5a5;
}
