/*
  SoftMed — fundamentos visuales.
  Este archivo contiene primitivos invariantes. La semántica de cada
  superficie se asigna en public.css y app.css mediante data-surface.
*/

:root {
  color-scheme: light;

  /* Marca */
  --brand-teal: oklch(0.48 0.095 190);
  --brand-teal-strong: oklch(0.37 0.078 190);
  --brand-teal-soft: oklch(0.94 0.028 190);

  /* Neutros: papel a grafito, sin sesgo de producto */
  --neutral-0: oklch(1 0 0);
  --neutral-50: oklch(0.987 0.002 90);
  --neutral-100: oklch(0.968 0.004 90);
  --neutral-150: oklch(0.946 0.005 90);
  --neutral-200: oklch(0.905 0.006 90);
  --neutral-300: oklch(0.82 0.008 250);
  --neutral-500: oklch(0.54 0.012 250);
  --neutral-600: oklch(0.44 0.014 250);
  --neutral-700: oklch(0.33 0.016 250);
  --neutral-850: oklch(0.22 0.018 250);
  --neutral-950: oklch(0.14 0.016 250);

  /* Estados universales */
  --success: oklch(0.5 0.125 150);
  --success-weak: oklch(0.95 0.032 150);
  --danger: oklch(0.53 0.17 25);
  --danger-weak: oklch(0.95 0.035 25);
  --warning: oklch(0.57 0.12 65);
  --warning-weak: oklch(0.95 0.035 70);
  --info: oklch(0.5 0.115 255);
  --info-weak: oklch(0.95 0.03 255);

  /* Categorías funcionales. El color siempre comunica identidad o estado. */
  --hue-teal: oklch(0.5 0.1 190);
  --hue-teal-bg: oklch(0.95 0.032 190);
  --hue-indigo: oklch(0.5 0.12 275);
  --hue-indigo-bg: oklch(0.95 0.032 275);
  --hue-violet: oklch(0.51 0.135 305);
  --hue-violet-bg: oklch(0.95 0.032 305);
  --hue-rose: oklch(0.54 0.145 15);
  --hue-rose-bg: oklch(0.95 0.032 15);
  --hue-amber: oklch(0.57 0.115 65);
  --hue-amber-bg: oklch(0.95 0.036 75);
  --hue-emerald: oklch(0.51 0.115 155);
  --hue-emerald-bg: oklch(0.95 0.036 155);
  --hue-sky: oklch(0.53 0.1 230);
  --hue-sky-bg: oklch(0.95 0.032 230);

  /* Tipografía */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI Variable",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.375rem;
  --leading-tight: 1.15;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Espacio */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;

  /* Forma */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.125rem;
  --radius-pill: 999px;

  /* Profundidad: sombras tintadas, nunca negro puro */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 240 / 0.055);
  --shadow-md:
    0 2px 5px oklch(0.2 0.02 240 / 0.05),
    0 12px 30px -16px oklch(0.2 0.03 240 / 0.22);
  --shadow-lg:
    0 4px 10px oklch(0.2 0.02 240 / 0.06),
    0 24px 60px -24px oklch(0.2 0.03 240 / 0.3);

  /* Capas */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-scrim: 290;
  --z-modal-backdrop: 300;
  --z-modal: 310;
  --z-toast: 400;
  --z-tooltip: 500;

  /* Movimiento */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-press: 120ms;
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
  --duration-reveal: 380ms;

  /* Alias de compatibilidad. Cada tema los redefine explícitamente. */
  --bg: var(--neutral-0);
  --surface: var(--neutral-100);
  --surface-strong: var(--neutral-150);
  --border: var(--neutral-200);
  --ink: var(--neutral-850);
  --muted: var(--neutral-600);
  --muted-weak: var(--neutral-500);
  --primary: var(--brand-teal);
  --primary-strong: var(--brand-teal-strong);
  --primary-weak: var(--brand-teal-soft);
  --accent: var(--warning);
  --accent-weak: var(--warning-weak);
}

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