/* ============================================================
   DESIGN SYSTEM - Sistema Disciplinar Pantanal
   PR-1: tokens-only. Sem reset global, sem importacao de fonte, sem estilos globais.
   ============================================================ */

:root {
  /* Color palette - Pantanal Document */
  --color-navy-950: #16243C;
  --color-navy-900: #1F2D4A;
  --color-navy-800: #2A3A5C;
  --color-navy-700: #36476B;
  --color-navy-600: #445782;
  --color-navy-100: #E8EDF4;

  --color-gold-500: #B5904A;
  --color-gold-400: #C9A560;
  --color-gold-200: #EDD99A;
  --color-gold-100: #F7F0DC;

  --color-surface-0: #FFFFFF;
  --color-surface-1: #F6F4EE;
  --color-surface-2: #EFEBE0;
  --color-surface-3: #DDD6C4;
  --color-surface-elevated: #FFFFFF;

  --color-text-primary: #111827;
  --color-text-secondary: #4B5563;
  --color-text-muted: #6B7280;
  --color-text-subtle: #9CA3AF;
  --color-text-inverse: #FAF8F2;

  --color-status-success: #16A34A;
  --color-status-warning: #CA8A04;
  --color-status-danger: #DC2626;
  --color-status-info: #2563EB;

  --color-success-soft: #DCFCE7;
  --color-warning-soft: #FEF3C7;
  --color-danger-soft: #FEF2F2;
  --color-danger-border: #FECACA;
  --color-info-soft: #DBEAFE;

  /* Semantic interaction states */
  --color-action-hover: var(--color-surface-2);
  --color-action-active: var(--color-surface-3);
  --color-action-selected: var(--color-gold-100);
  --color-action-disabled: #E5E7EB;
  --color-border-subtle: var(--color-surface-3);
  --color-border-strong: #C8BFA8;
  --color-focus-ring: rgba(181, 144, 74, 0.42);
  --color-focus-border: var(--color-gold-500);
  --color-selection-bg: var(--color-gold-100);
  --color-selection-text: var(--color-navy-950);

  /* Typography */
  --font-family-base: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-display: var(--font-family-base);
  --font-body: var(--font-family-base);

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --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-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-base: 1.5;
  --line-height-loose: 1.75;

  --letter-spacing-tight: 0em;
  --letter-spacing-base: 0em;
  --letter-spacing-wide: 0.04em;
  --letter-spacing-widest: 0.11em;

  /* Spacing */
  --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;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(31, 45, 74, 0.06);
  --shadow-md: 0 1px 3px rgba(31, 45, 74, 0.08), 0 1px 2px rgba(31, 45, 74, 0.05);
  --shadow-lg: 0 8px 20px rgba(31, 45, 74, 0.10), 0 2px 5px rgba(31, 45, 74, 0.06);
  --shadow-xl: 0 16px 36px rgba(31, 45, 74, 0.14), 0 6px 14px rgba(31, 45, 74, 0.08);
  --shadow-institutional: 0 1px 0 rgba(31, 45, 74, 0.06), 0 10px 24px rgba(31, 45, 74, 0.08);
  --shadow-focus: 0 0 0 3px var(--color-focus-ring);
  --shadow-gold: 0 0 0 2px rgba(181, 144, 74, 0.35);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 360ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout and density */
  --sidebar-width: 288px;
  --sidebar-collapsed: 68px;
  --topbar-height: 64px;
  --content-max-width: 1280px;
  --control-height-sm: 32px;
  --control-height-md: 40px;
  --control-height-lg: 44px;
  --control-padding-x: var(--space-3);
  --control-gap: var(--space-2);

  /* Component tokens */
  --topbar-bg: var(--color-surface-elevated);
  --topbar-border: var(--color-border-subtle);
  --topbar-text: var(--color-text-primary);
  --topbar-muted: var(--color-text-muted);
  --topbar-shadow: var(--shadow-institutional);

  --control-bg: var(--color-surface-1);
  --control-bg-hover: var(--color-action-hover);
  --control-bg-active: var(--color-action-active);
  --control-border: var(--color-border-subtle);
  --control-border-hover: var(--color-border-strong);
  --control-text: var(--color-text-primary);
  --control-muted: var(--color-text-muted);
  --control-disabled-bg: var(--color-action-disabled);
  --control-disabled-text: var(--color-text-subtle);

  --z-index-topbar: 1000;
  --z-index-dropdown: 1050;
  --z-index-modal: 1100;

  /* Breakpoints (reference for media queries) */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

@media (max-width: 768px) {
  :root {
    --topbar-height: 56px;
    --control-height-md: 36px;
    --control-padding-x: var(--space-2);
    --control-gap: var(--space-1);
  }
}

/* Dark mode tokens. Navy brand colors stay stable; surfaces and controls are designed for contrast. */
[data-theme="dark"] {
  --color-surface-0: #111827;
  --color-surface-1: #0D1B2A;
  --color-surface-2: #152236;
  --color-surface-3: #243659;
  --color-surface-elevated: #132033;

  --color-text-primary: #F5F7FA;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #A8B3C7;
  --color-text-subtle: #7D8AA3;
  --color-text-inverse: #FAF8F2;

  --color-success-soft: rgba(22, 163, 74, 0.16);
  --color-warning-soft: rgba(202, 138, 4, 0.18);
  --color-danger-soft: rgba(220, 38, 38, 0.16);
  --color-danger-border: rgba(248, 113, 113, 0.42);
  --color-info-soft: rgba(37, 99, 235, 0.18);

  --color-action-hover: #1B2A42;
  --color-action-active: #233754;
  --color-action-selected: rgba(181, 144, 74, 0.18);
  --color-action-disabled: #1F2A3C;
  --color-border-subtle: #2A3B56;
  --color-border-strong: #4A5E7C;
  --color-focus-ring: rgba(201, 165, 96, 0.36);
  --color-selection-bg: rgba(201, 165, 96, 0.28);
  --color-selection-text: #F8FAFC;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.30), 0 2px 5px rgba(0, 0, 0, 0.22);
  --shadow-xl: 0 16px 36px rgba(0, 0, 0, 0.36), 0 6px 14px rgba(0, 0, 0, 0.24);
  --shadow-institutional: 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.28);
}
