/* ── Astra · tokens de diseño ────────────────────────────────────────────────
   Única fuente de colores, tipografía, espacios y radios. Los módulos solo usan estas variables.
   El tema lo resuelve js/tema-inicial.js en <html data-tema="claro|oscuro"> antes de pintar.
   Paleta copiada de ONTA admin_v2 (D-024): neutros cálidos y acento naranja. Sin morado. */

/* Tipografías autohospedadas (la CSP solo permite 'self'). Archivos variables, subconjunto latin. OFL. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/vendor/fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* Superficies */
  --fondo: #f7f6f3;
  --superficie: #ffffff;
  --superficie-2: #f1efeb;
  --superficie-3: #e8e4dd;
  --borde: #e8e4dd;
  --borde-fuerte: #d9d3c9;
  --sombra: 0 1px 2px rgb(31 29 27 / 0.04), 0 8px 24px -12px rgb(31 29 27 / 0.10);
  --sombra-alta: 0 2px 6px rgb(31 29 27 / 0.06), 0 24px 48px -16px rgb(31 29 27 / 0.22);
  --velo: rgb(31 29 27 / 0.38);

  /* Texto */
  --texto: #1f1d1b;
  --texto-suave: #6b6560;
  --texto-tenue: #9c958d;
  --texto-sobre-acento: #ffffff;

  /* Acento y estados */
  --acento: #e8590c;
  --acento-fuerte: #c94e0a;
  --acento-suave: #fdede1;
  --ok: #1f9254;
  --ok-suave: #e4f5eb;
  --aviso: #a9660a;
  --aviso-suave: #fcefd8;
  --peligro: #c7402b;
  --peligro-suave: #fbeae6;
  --info: #2f6fb3;
  --info-suave: #e3eef9;
  --foco: #e8590c;

  /* Código (colores de sintaxis) */
  --cod-fondo: #f6f4f0;
  --cod-clave: #c94e0a;
  --cod-cadena: #1f7a4a;
  --cod-numero: #2f6fb3;
  --cod-propiedad: #8a4b0f;
  --cod-comentario: #9c958d;
  --cod-funcion: #1d5f9e;
  --cod-tipo: #a9660a;

  /* Tipografía */
  --fuente: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fuente-titulos: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --fuente-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: 1.625rem;
  --t-2xl: 2.25rem;

  /* Espacios */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 24px;
  --e-6: 32px;
  --e-7: 48px;

  /* Formas */
  --radio-sm: 8px;
  --radio: 12px;
  --radio-lg: 16px;
  --radio-pildora: 999px;

  /* Medidas del layout */
  --ancho-lateral: 236px;
  --ancho-lateral-mini: 64px;
  --alto-barra: 46px;
  --alto-tabbar: 58px;
  --ancho-lectura: 780px;

  --transicion: 160ms cubic-bezier(0.2, 0, 0, 1);
}

:root[data-tema="oscuro"] {
  color-scheme: dark;

  --fondo: #16130f;
  --superficie: #201c17;
  --superficie-2: #2a241d;
  --superficie-3: #332c24;
  --borde: #383029;
  --borde-fuerte: #4a4037;
  --sombra: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.5);
  --sombra-alta: 0 2px 6px rgb(0 0 0 / 0.35), 0 24px 48px -16px rgb(0 0 0 / 0.6);
  --velo: rgb(0 0 0 / 0.55);

  --texto: #f4f1ec;
  --texto-suave: #b6afa5;
  --texto-tenue: #7c766c;
  --texto-sobre-acento: #1a120c;

  --acento: #ff7a3d;
  --acento-fuerte: #ff9459;
  --acento-suave: rgb(255 122 61 / 0.16);
  --ok: #3fcb86;
  --ok-suave: rgb(63 203 134 / 0.14);
  --aviso: #f0b429;
  --aviso-suave: rgb(240 180 41 / 0.14);
  --peligro: #ff6b57;
  --peligro-suave: rgb(255 107 87 / 0.14);
  --info: #6aa8f0;
  --info-suave: rgb(106 168 240 / 0.14);
  --foco: #ff9459;

  --cod-fondo: #1a1612;
  --cod-clave: #ff9459;
  --cod-cadena: #8fd694;
  --cod-numero: #8cbcf5;
  --cod-propiedad: #f0c674;
  --cod-comentario: #7c766c;
  --cod-funcion: #7fb6f0;
  --cod-tipo: #f0b429;
}

@media (prefers-reduced-motion: reduce) {
  :root { --transicion: 0ms; }
}
