/* origem: bussola-licitacao/static/css/tokens.css @ f5649db */
/* ============================================================
   Bússola de Licitações — Design System Tokens
   ============================================================
   Editorial · Institucional · B2G
   Dois temas: light (operação diária) + dark (foco / analistas)
   ============================================================ */

:root {
  /* ---------- Brand / accent (shared) ---------- */
  --brand-navy: oklch(0.24 0.04 255);
  --brand-navy-deep: oklch(0.18 0.035 255);
  --brand-navy-soft: oklch(0.32 0.04 255);
  --brand-brass: oklch(0.62 0.13 75);
  --brand-brass-hover: oklch(0.56 0.14 75);
  --brand-brass-bright: oklch(0.74 0.12 80);

  /* Semantic (sempre legíveis nos dois temas) */
  --c-success: oklch(0.55 0.14 155);
  --c-warning: oklch(0.68 0.15 70);
  --c-danger: oklch(0.55 0.18 25);
  --c-info: oklch(0.55 0.13 240);

  /* Severidade de auditoria */
  --c-sev-high: oklch(0.55 0.18 25);
  --c-sev-med: oklch(0.68 0.15 70);
  --c-sev-low: oklch(0.55 0.14 155);

  /* ---------- Typography ---------- */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 44px;
  --text-5xl: 60px;
  --text-6xl: 84px;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-body: 1.5;
  --lh-loose: 1.7;

  --tracking-eyebrow: 0.22em;
  --tracking-tight: -0.015em;
  --tracking-display: -0.025em;

  /* ---------- Spacing (base 4) ---------- */
  --space-0: 0;
  --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;
  --space-20: 80px;
  --space-24: 96px;

  /* ---------- Radii ---------- */
  --radius-none: 0;
  --radius-xs: 2px;       /* chips, badges — editorial: quase retos */
  --radius-sm: 4px;       /* inputs, small buttons */
  --radius-md: 6px;       /* cards */
  --radius-lg: 10px;      /* large cards, modals */
  --radius-full: 9999px;  /* pills, avatars */

  /* ---------- Shadows ---------- */
  --shadow-xs: 0 1px 2px rgba(10, 17, 38, 0.05);
  --shadow-sm: 0 1px 3px rgba(10, 17, 38, 0.08), 0 1px 2px rgba(10, 17, 38, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 17, 38, 0.08), 0 2px 4px rgba(10, 17, 38, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 17, 38, 0.12), 0 4px 8px rgba(10, 17, 38, 0.06);
  --shadow-xl: 0 24px 64px rgba(10, 17, 38, 0.18), 0 8px 16px rgba(10, 17, 38, 0.1);
  --shadow-inset: inset 0 1px 0 rgba(10, 17, 38, 0.04);

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 400ms;
  --dur-slower: 800ms;

  /* ---------- Z-index ---------- */
  --z-base: 0;
  --z-sticky: 20;
  --z-header: 40;
  --z-dropdown: 50;
  --z-overlay: 60;
  --z-modal: 70;
  --z-toast: 80;
}

/* =============================================================
   LIGHT theme — "paper & ink"
   Warm cream/paper background, deep navy ink. Institucional.
   ============================================================= */
:root,
[data-theme="light"] {
  --bg-canvas: oklch(0.98 0.008 85);       /* warm paper */
  --bg-surface: oklch(1.00 0 0);           /* pure white cards */
  --bg-surface-2: oklch(0.96 0.01 85);     /* secondary surface */
  --bg-surface-sunken: oklch(0.94 0.012 85); /* sunken panels */
  --bg-overlay: rgba(20, 24, 40, 0.55);
  --bg-inverse: oklch(0.18 0.035 255);

  --fg-primary: oklch(0.18 0.035 255);     /* deep navy ink */
  --fg-secondary: oklch(0.36 0.03 255);
  --fg-muted: oklch(0.52 0.022 255);
  --fg-subtle: oklch(0.68 0.015 255);
  --fg-inverse: oklch(0.97 0.012 85);
  --fg-brand: oklch(0.52 0.13 75);
  --fg-link: oklch(0.48 0.12 255);

  --border-subtle: oklch(0.92 0.012 255);
  --border-default: oklch(0.86 0.018 255);
  --border-strong: oklch(0.72 0.02 255);
  --border-brand: oklch(0.62 0.13 75);

  /* Severity BG tints */
  --bg-sev-high: oklch(0.96 0.04 25);
  --bg-sev-med: oklch(0.96 0.05 75);
  --bg-sev-low: oklch(0.96 0.04 155);

  /* Data viz palette (categorical) */
  --data-1: oklch(0.52 0.13 255);
  --data-2: oklch(0.62 0.13 75);
  --data-3: oklch(0.55 0.14 155);
  --data-4: oklch(0.58 0.16 300);
  --data-5: oklch(0.55 0.16 25);
  --data-6: oklch(0.60 0.12 200);

  /* Semantic status — feedback (success/danger/warning/info).
     Tons médios: legíveis como TEXTO sobre superfícies claras E com texto
     BRANCO por cima (botões Aceitar/Confirmar usam background: var(--success)
     + color: white). Sem isto, var(--success) era inválido → fundo não
     pintava e sobrava texto branco no branco. */
  --success: oklch(0.58 0.14 150);
  --danger:  oklch(0.55 0.20 27);
  --warning: oklch(0.62 0.14 70);
  --info:    oklch(0.55 0.13 240);
  --fg-success: var(--success);
  --fg-danger: var(--danger);

  color-scheme: light;
}

/* =============================================================
   DARK theme — "deep sea"
   Navy deep, brass accent, cream text.
   ============================================================= */
[data-theme="dark"] {
  --bg-canvas: oklch(0.16 0.03 255);
  --bg-surface: oklch(0.22 0.035 255);
  --bg-surface-2: oklch(0.26 0.035 255);
  --bg-surface-sunken: oklch(0.14 0.028 255);
  --bg-overlay: rgba(6, 10, 20, 0.72);
  --bg-inverse: oklch(0.97 0.012 85);

  --fg-primary: oklch(0.97 0.012 85);
  --fg-secondary: oklch(0.84 0.012 85);
  --fg-muted: oklch(0.68 0.015 255);
  --fg-subtle: oklch(0.52 0.02 255);
  --fg-inverse: oklch(0.18 0.035 255);
  --fg-brand: oklch(0.78 0.13 80);
  --fg-link: oklch(0.78 0.12 240);

  --border-subtle: oklch(0.30 0.03 255);
  --border-default: oklch(0.38 0.035 255);
  --border-strong: oklch(0.52 0.04 255);
  --border-brand: oklch(0.74 0.12 80);

  --bg-sev-high: oklch(0.28 0.08 25);
  --bg-sev-med: oklch(0.30 0.08 70);
  --bg-sev-low: oklch(0.28 0.07 155);

  --data-1: oklch(0.72 0.14 255);
  --data-2: oklch(0.78 0.13 80);
  --data-3: oklch(0.70 0.14 155);
  --data-4: oklch(0.72 0.15 300);
  --data-5: oklch(0.70 0.16 25);
  --data-6: oklch(0.74 0.12 200);

  /* Semantic status — mais claros pra ler como texto sobre o navy escuro,
     mantendo contraste com texto branco nos botões de fundo sólido. */
  --success: oklch(0.64 0.15 152);
  --danger:  oklch(0.62 0.19 27);
  --warning: oklch(0.80 0.14 80);
  --info:    oklch(0.70 0.13 240);

  color-scheme: dark;
}

/* =============================================================
   Base element resets
   ============================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--fg-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}
::selection { background: var(--brand-brass); color: var(--brand-navy-deep); }

/* =============================================================
   Utility primitives used across the system
   ============================================================= */

/* Eyebrow label — uppercase monospace */
.ds-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-brand);
  font-weight: 500;
}

/* Editorial italic display text */
.ds-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  color: var(--fg-primary);
}

/* Mono tabular data */
.ds-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Hairline divider */
.ds-hr {
  height: 1px;
  background: var(--border-subtle);
  border: 0;
}

/* Bearing-line ornament (compass motif) */
.ds-bearing {
  position: relative;
}
.ds-bearing::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 24px; height: 1px;
  background: var(--brand-brass);
  transform: translateY(-50%);
}

/* Focus ring */
.ds-focus:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
