/*
 * View Modernization - Phase 1 foundation.
 * Additive tokens and accessibility defaults only; no component migration.
 */

:root {
  /* Canvas, surface, text, and border */
  --vm-canvas: #f4f7fb;
  --vm-surface: #ffffff;
  --vm-surface-subtle: #f8fafc;
  --vm-surface-raised: #ffffff;
  --vm-text: #111827;
  --vm-text-muted: #667085;
  --vm-text-subtle: #98a2b3;
  --vm-border: #dbe3ef;
  --vm-border-strong: #cbd5e1;
  --vm-link: #3349c7;

  /* Brand and semantic status */
  --vm-primary: #4256d9;
  --vm-primary-hover: #3347c2;
  --vm-primary-active: #2939a3;
  --vm-primary-soft: #eaf0ff;
  --vm-info: #2563eb;
  --vm-info-soft: #eff6ff;
  --vm-info-text: #1d4ed8;
  --vm-info-border: #bfdbfe;
  --vm-success: #059669;
  --vm-success-soft: #ecfdf5;
  --vm-success-text: #047857;
  --vm-success-border: #a7f3d0;
  --vm-warning: #b54708;
  --vm-warning-soft: #fffaeb;
  --vm-warning-text: #92400e;
  --vm-warning-border: #fed7aa;
  --vm-danger: #b42318;
  --vm-danger-soft: #fef3f2;
  --vm-danger-text: #991b1b;
  --vm-danger-border: #fecaca;
  --vm-critical: #9b1c31;
  --vm-critical-soft: #fff1f3;
  --vm-critical-text: #881337;
  --vm-critical-border: #fecdd3;
  --vm-recovery: #047857;
  --vm-recovery-soft: #ecfdf5;
  --vm-recovery-text: #047857;
  --vm-recovery-border: #a7f3d0;

  /* Typography */
  --vm-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --vm-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --vm-text-xs: 0.75rem;
  --vm-text-sm: 0.875rem;
  --vm-text-base: 1rem;
  --vm-text-lg: 1.125rem;
  --vm-text-xl: 1.25rem;
  --vm-leading-tight: 1.2;
  --vm-leading-normal: 1.5;

  /* Geometry and depth */
  --vm-space-1: 0.25rem;
  --vm-space-2: 0.5rem;
  --vm-space-3: 0.75rem;
  --vm-space-4: 1rem;
  --vm-space-5: 1.5rem;
  --vm-space-6: 2rem;
  --vm-space-7: 3rem;
  --vm-radius-sm: 0.5rem;
  --vm-radius-md: 0.625rem;
  --vm-radius-lg: 0.875rem;
  --vm-radius-pill: 999px;
  --vm-border-width: 1px;
  --vm-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --vm-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --vm-shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
  --vm-shadow-overlay: 0 24px 64px rgba(15, 23, 42, 0.22);

  /* Motion and responsive references (custom properties cannot drive @media). */
  --vm-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --vm-ease-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1);
  --vm-duration-fast: 120ms;
  --vm-duration-base: 160ms;
  --vm-duration-slow: 220ms;
  --vm-breakpoint-sm: 640px;
  --vm-breakpoint-md: 820px;
  --vm-breakpoint-lg: 1100px;
  --vm-focus-ring: 0 0 0 3px rgba(66, 86, 217, 0.24);
}

/* Additive, keyboard-only focus visibility. Existing IDs/classes remain untouched. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--vm-primary);
  outline-offset: 2px;
  box-shadow: var(--vm-focus-ring);
}

:where(button, input, select, textarea):disabled {
  cursor: not-allowed;
}

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
