/*
 * Design tokens of the unified UI.
 * Brand values are a hand copy of ui/tokens/brand-tokens.json (source of truth: project-hub
 * design/votviracka/tokens.json) — tests/ui/tokens_tests.py checks they are all present here.
 * Everything below the "Semantic" heading is UI-only and not part of the brand kit.
 */
:root {
  color-scheme: light;

  /* Brand */
  --vv-primary: #2B3074;
  --vv-secondary: #30378D;
  --vv-accent: #EC2C91;
  --vv-accent-strong: #D11B7E;
  --vv-deep: #1A1F5C;
  --vv-surface: #FFFFFF;
  --vv-surface-muted: #F0F1F8;
  --vv-border: #D9DCEB;
  --vv-text-muted: #555A79;

  --vv-font-sans: 'DM Sans', Arial, sans-serif;
  --vv-font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --vv-weight-regular: 400;
  --vv-weight-bold: 700;

  --vv-radius-card: 1.5rem;
  --vv-radius-control: 0.75rem;
  --vv-radius-pill: 999px;
  --vv-content-max: 1400px;
  --vv-reading-max: 720px;

  /* Neutral scale, tilted towards the navy hue. 100/200 equal brand surface-muted/border. */
  --ui-gray-50: #F8F9FC;
  --ui-gray-100: #F0F1F8;
  --ui-gray-200: #D9DCEB;
  --ui-gray-300: #BEC2DA;
  --ui-gray-400: #9096B5;
  --ui-gray-500: #6C7295;
  --ui-gray-600: #555A79;
  --ui-gray-700: #3E4262;
  --ui-gray-800: #292C4A;
  --ui-gray-900: #1A1D38;

  /* Semantic. Text colours are chosen for >= 4.5:1 on their own tinted background. */
  --ui-success: #1B7A4B;
  --ui-success-strong: #14633B;
  --ui-success-bg: #E4F5EC;
  --ui-success-border: #A8DCC3;
  --ui-warning: #8A5700;
  --ui-warning-strong: #6E4500;
  --ui-warning-bg: #FFF2D4;
  --ui-warning-border: #F0CE86;
  --ui-danger: #B3261E;
  --ui-danger-strong: #8F1C16;
  --ui-danger-bg: #FDE9E7;
  --ui-danger-border: #F2B5B0;
  --ui-info: #2D52B8;
  --ui-info-strong: #213F92;
  --ui-info-bg: #E8EEFC;
  --ui-info-border: #B4C6F0;
  --ui-neutral: var(--ui-gray-700);
  --ui-neutral-bg: var(--ui-gray-100);
  --ui-neutral-border: var(--ui-gray-200);

  /* Roles of colour */
  --ui-bg: var(--ui-gray-50);
  --ui-surface: var(--vv-surface);
  --ui-text: var(--vv-primary);
  --ui-text-muted: var(--vv-text-muted);
  --ui-border: var(--vv-border);
  /* Control borders (inputs, choices) must reach 3:1 on white and on --ui-bg (WCAG 1.4.11); gray-300 does not. */
  --ui-border-strong: #868CAD;
  --ui-focus: var(--vv-accent);
  --ui-action: var(--vv-primary);
  --ui-action-hover: var(--vv-deep);
  --ui-cta: var(--vv-accent-strong);
  --ui-cta-hover: #B5166B;
  --ui-nav-active-bg: #E9EBF7;

  /* Spacing, 4px base */
  --ui-space-0: 0;
  --ui-space-1: 0.25rem;
  --ui-space-2: 0.5rem;
  --ui-space-3: 0.75rem;
  --ui-space-4: 1rem;
  --ui-space-5: 1.25rem;
  --ui-space-6: 1.5rem;
  --ui-space-8: 2rem;
  --ui-space-10: 2.5rem;
  --ui-space-12: 3rem;
  --ui-space-16: 4rem;

  /* Type scale */
  --ui-text-xs: 0.75rem;
  --ui-text-sm: 0.875rem;
  --ui-text-md: 1rem;
  --ui-text-lg: 1.125rem;
  --ui-text-xl: 1.375rem;
  --ui-text-2xl: 1.75rem;
  --ui-text-3xl: 2.25rem;
  --ui-leading-tight: 1.2;
  --ui-leading-normal: 1.5;

  /* Elevation */
  --ui-shadow-xs: 0 1px 2px rgb(26 29 56 / 6%);
  --ui-shadow-sm: 0 1px 3px rgb(26 29 56 / 8%), 0 1px 2px rgb(26 29 56 / 6%);
  --ui-shadow-md: 0 6px 18px rgb(43 48 116 / 10%);
  --ui-shadow-lg: 0 18px 48px rgb(43 48 116 / 16%);

  /* Layers */
  --ui-z-sticky: 20;
  --ui-z-drawer: 40;
  --ui-z-dropdown: 50;
  --ui-z-dialog: 60;
  --ui-z-toast: 70;

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

  --ui-sidebar-w: 16rem;
  --ui-topbar-h: 3.5rem;
}

/*
 * Density. Admin screens are compact, host / public screens comfortable. Both drive the same
 * components through these variables, so a component never knows which mode it is in.
 */
:root,
[data-density="compact"] {
  --ui-font-size: 0.9375rem;
  --ui-control-h: 2.25rem;
  --ui-control-px: 0.875rem;
  --ui-radius-card: 0.875rem;
  --ui-radius-control: 0.5rem;
  --ui-card-pad: 1.125rem;
  --ui-gap: 1rem;
  --ui-row-pad-y: 0.5rem;
  --ui-page-pad: 1.5rem;
}

[data-density="comfortable"] {
  --ui-font-size: 1.0625rem;
  --ui-control-h: 2.875rem;
  --ui-control-px: 1.25rem;
  --ui-radius-card: var(--vv-radius-card);
  --ui-radius-control: var(--vv-radius-control);
  --ui-card-pad: 1.75rem;
  --ui-gap: 1.5rem;
  --ui-row-pad-y: 0.875rem;
  --ui-page-pad: 2rem;
}

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