/*
 * TRA Colombia design tokens. Full reference: docs/design-system.md.
 *
 * Brand palette (fixed, from the logo):
 *   Azul TRA        #004080  trust, authority     -> --brand (actions, links, headings accents)
 *   Azul seguridad  #1E6091  reliability          -> --info (in-progress, informative notes)
 *   Amarillo        #F4C542  warmth               -> --accent (fills and indicators, NEVER text)
 *   Rojo            #D9534F  attention            -> --danger (errors, destructive actions only)
 *
 * Every themed color is written once as light-dark(<light>, <dark>), so both themes sit side by
 * side. The theme follows the OS unless <html data-theme="light|dark"> pins it.
 * Contrast targets: text >= 4.5:1 on its own background, control borders and focus >= 3:1.
 */
:root {
  color-scheme: light dark;

  /* Fixed brand colors: logo, flag band. Same in both themes. */
  --flag-yellow: #f4c542;
  --flag-blue: #1e6091;
  --flag-red: #d9534f;
  --tra-blue: #004080;

  /* Surfaces, from back to front */
  --bg: light-dark(#f3f6fa, #0b1626);
  --bg-deep: light-dark(#e6edf5, #101f33);
  --surface: light-dark(#ffffff, #132740);

  /* Text */
  --ink: light-dark(#0e2440, #e6eef8); /* 14.4:1 on --bg */
  --ink-soft: light-dark(#4a5e77, #9fb2c8); /* 6.1:1 on --bg, secondary text */

  /* Lines */
  --line: light-dark(#cfd9e5, #27405e); /* decorative dividers and panel edges only */
  --line-strong: light-dark(#8da2bb, #5f7a99); /* hover on decorative edges */
  --field-border: light-dark(#7489a3, #6a86a8); /* inputs, selects, checkboxes: >= 3.3:1 */

  /* Brand roles */
  --brand: light-dark(#004080, #7fb2ea);
  --brand-strong: light-dark(#002f60, #a6caf3); /* hover/pressed, text on --brand-tint */
  --brand-tint: light-dark(#dce8f5, #1a3556);
  --on-brand: light-dark(#ffffff, #0b1626); /* text on a --brand fill */

  --info: light-dark(#1e6091, #8cc0e6);
  --info-tint: light-dark(#d9e8f3, #17304a);

  --accent: #f4c542; /* indicators only; text on --accent-tint stays --ink */
  --accent-tint: light-dark(#fcf0c8, #3a3217);

  --danger: light-dark(#d9534f, #ec7c78); /* borders and icons */
  --danger-ink: light-dark(#ad3935, #f19a96); /* error text */
  --danger-tint: light-dark(#fbe0df, #3d1f1f);

  /* Type */
  --font-display: 'Montserrat Variable', 'Montserrat', system-ui, sans-serif;
  --font-ui: 'Hanken Grotesk Variable', 'Hanken Grotesk', system-ui, sans-serif;
  --font-code: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Modular scale, ratio 1.25 from 16px */
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Shape: small for chips, medium for controls and panels, pill for status */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-pill: 999px;

  /* Elevation: only for things that float above the page (toast, sticky bars) */
  --shadow-float: 0 8px 24px light-dark(rgb(14 36 64 / 0.18), rgb(0 0 0 / 0.45));

  /* Motion */
  --dur-fast: 120ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand);
}

:root[data-theme='light'] {
  color-scheme: light;
}
:root[data-theme='dark'] {
  color-scheme: dark;
}
