/* ComprasEC design tokens: the only place colours, type, spacing, radii, shadows and motion are defined. */
:root {
  color-scheme: light;

  /* Primitivos: la paleta del brief y sus pasos derivados para contraste */
  --petrol-900: #082340;
  --petrol-800: #0B2D4D;
  --petrol-700: #13406A;
  --petrol-50:  #E7EEF5;
  --teal-500:   #00A388;
  --teal-700:   #00775F;
  --teal-800:   #00705E;
  --teal-50:    #E1F5F1;
  --yellow-400: #FFCC15;
  --yellow-800: #8A6100;
  --yellow-50:  #FFF6D6;
  --cyan-400:   #21B8D5;
  --cyan-600:   #1597B5;
  --cyan-700:   #0A7D96;
  --slate-900:  #0F172A;
  --slate-600:  #56657A;
  --slate-500:  #64748B;
  --slate-400:  #7F8FA3;
  --slate-300:  #94A3B8;
  --slate-200:  #E5EDF3;
  --slate-100:  #EEF3F8;
  --slate-50:   #F6F9FC;
  --white:      #FFFFFF;

  /* Semánticos: superficie y texto */
  --color-bg: var(--slate-50);
  --color-surface: var(--white);
  --color-surface-muted: var(--slate-100);
  --color-text: var(--slate-900);
  --color-text-secondary: var(--slate-500);
  --color-text-secondary-strong: var(--slate-600);
  --color-text-disabled: var(--slate-300);
  --color-border: var(--slate-200);
  --color-border-strong: var(--slate-400);

  /* Semánticos: marca y acción */
  --color-primary: var(--petrol-800);
  --color-primary-hover: var(--petrol-700);
  --color-primary-pressed: var(--petrol-900);
  --color-primary-soft: var(--petrol-50);
  --color-on-primary: var(--white);
  --color-on-primary-muted: #C7D3E0;
  --color-secondary: var(--teal-500);
  --color-secondary-strong: var(--teal-700);
  --color-secondary-hover: var(--teal-800);
  --color-secondary-soft: var(--teal-50);
  --color-link: var(--teal-700);
  --color-link-hover: var(--teal-800);
  --color-accent: var(--yellow-400);
  --color-on-accent: var(--slate-900);
  --color-accent-strong: var(--yellow-800);
  --color-accent-soft: var(--yellow-50);
  --color-focus: var(--teal-700);
  /* The lightest bar of the ComprasEC mark. */
  --color-mark-light: #7FD6C7;

  /* Estados */
  --color-success: #137A4B;
  --color-success-soft: #E6F5EC;
  --color-warning: #92580A;
  --color-warning-soft: #FFF6D6;
  --color-danger: #B42318;
  --color-danger-soft: #FDECEC;
  --color-info: #0A6A8A;
  --color-info-soft: #E3F4FA;

  /* Datos */
  --color-data: var(--cyan-400);
  --color-data-strong: var(--cyan-700);
  --chart-1: var(--cyan-600);
  --chart-2: #B8860B;
  --chart-3: #3561A8;
  --chart-4: #00917A;
  --chart-5: #C9502A;
  --chart-neutral: var(--slate-400);
  --chart-grid: var(--slate-200);
  --chart-track: var(--teal-50);
  --chart-area: color-mix(in srgb, var(--cyan-400) 18%, transparent);
  /* Escala secuencial para el mapa de provincias: un solo tono, de claro a oscuro */
  --seq-1: #E3F4FA;
  --seq-2: #A8DDEB;
  --seq-3: #5BBFD8;
  --seq-4: #1597B5;
  --seq-5: #0E6F8A;
  --seq-6: #0B2D4D;

  /* Tipografía */
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 0.75rem;     /* 12 px: mínimo absoluto, solo metadatos */
  --text-sm: 0.875rem;    /* 14 px */
  --text-md: 1rem;        /* 16 px: cuerpo */
  --text-lg: 1.125rem;    /* 18 px */
  --text-xl: 1.25rem;     /* 20 px */
  --text-2xl: 1.5rem;     /* 24 px */
  --text-3xl: clamp(1.75rem, 1.35rem + 1.6vw, 2.25rem);
  --text-display: clamp(2rem, 1.3rem + 3vw, 3.25rem);
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading: 1.6;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --tracking-tight: -0.025em;

  /* Espaciado: múltiplos de 4 px */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.25rem;  /* 20 */
  --space-6: 1.5rem;   /* 24 */
  --space-8: 2rem;     /* 32 */
  --space-10: 2.5rem;  /* 40 */
  --space-12: 3rem;    /* 48 */
  --space-16: 4rem;    /* 64 */
  --space-20: 5rem;    /* 80 */

  /* Forma */
  --radius-sm: 8px;    /* insignias, chips cuadrados, celdas */
  --radius-md: 12px;   /* botones, campos, menús */
  --radius-lg: 16px;   /* tarjetas, paneles, tablas */
  --radius-xl: 20px;   /* tarjeta destacada, diálogos */
  --radius-pill: 999px;

  /* Elevación: sombras suaves con desplazamiento, nunca halos de color */
  --shadow-xs: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 4%), 0 4px 12px rgb(11 45 77 / 6%);
  --shadow-md: 0 2px 4px rgb(15 23 42 / 4%), 0 12px 32px rgb(11 45 77 / 8%);
  --shadow-lg: 0 4px 8px rgb(15 23 42 / 5%), 0 24px 48px rgb(11 45 77 / 12%);
  --focus-ring: 0 0 0 2px var(--color-surface), 0 0 0 5px var(--color-focus);

  /* Movimiento */
  --duration-fast: 150ms;   /* color, fondo, borde */
  --duration-base: 200ms;   /* desplegables, chevrons */
  --duration-slow: 250ms;   /* paneles, menús móviles */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* Medidas */
  --target: 44px;
  --control-height: 44px;
  --control-height-lg: 52px;
  --measure: 68ch;
  --page: 80rem;
  --header-height: 64px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0.01ms; --duration-base: 0.01ms; --duration-slow: 0.01ms; }
}
