/*
 * Design tokens — the single source of truth for color, type, spacing, radii,
 * elevation and motion. Components reference these custom properties only;
 * no raw color or pixel literals belong in component styles.
 *
 * Brand: ATS.am blue (primary, the one accent) and green (status only).
 * Every text/background pair below meets WCAG 2.2 AA (contrast >= 4.5:1).
 */

:root {
  color-scheme: light dark;

  /* Color — light theme */
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-sunken: #eaf0f7;
  --color-border: #d5deea;
  --color-border-strong: #a9b8cc;

  --color-text: #12233a;
  --color-text-muted: #4a5c74;
  --color-text-on-accent: #ffffff;

  --color-accent: #0973ba;
  --color-accent-hover: #075e99;
  --color-accent-active: #064e80;
  --color-accent-soft: #e3f1fb;
  --color-accent-text: #075e99;

  --color-success: #007a47;
  --color-success-soft: #e0f5ec;
  --color-warning: #8a5300;
  --color-warning-soft: #fdf1dc;
  --color-danger: #b3261e;
  --color-danger-hover: #931f18;
  --color-danger-soft: #fdeceb;

  --color-focus-ring: #0973ba;
  --color-overlay: rgb(10 25 45 / 0.62);

  /* Call surface (always dark, independent of theme) */
  --color-call-bg: #0b2138;
  --color-call-surface: #12304f;
  --color-call-border: #274a6e;
  --color-call-text: #f2f7fc;
  --color-call-text-muted: #b4c6da;
  --color-call-agent: #4fc3f7;
  --color-call-customer: #7ee2b0;
  /* The end-call button sits on the always-dark call surface, so it must not
     follow the theme: white text on these reds keeps a contrast above 4.5:1. */
  --color-call-danger: #b3261e;
  --color-call-danger-hover: #931f18;
  --color-call-alert-bg: #fdeceb;
  --color-call-alert-text: #931f18;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Noto Sans Armenian", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --text-md: clamp(0.9375rem, 0.91rem + 0.15vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.2;
  --leading-normal: 1.5;

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Sizing */
  --size-touch: 2.75rem; /* 44px minimum touch target */
  --size-content: 46rem;
  --size-dashboard: 78rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgb(18 35 58 / 0.08);
  --shadow-md: 0 4px 14px rgb(18 35 58 / 0.1);
  --shadow-lg: 0 18px 44px rgb(18 35 58 / 0.2);

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

  /* Layering */
  --layer-sticky: 10;
  --layer-overlay: 100;
  --layer-toast: 200;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0a1626;
    --color-surface: #112338;
    --color-surface-raised: #183049;
    --color-surface-sunken: #0c1b2e;
    --color-border: #26405c;
    --color-border-strong: #3d5f85;

    --color-text: #eaf1f8;
    --color-text-muted: #a9bbcf;
    --color-text-on-accent: #ffffff;

    --color-accent: #0973ba;
    --color-accent-hover: #0b84d4;
    --color-accent-active: #075e99;
    --color-accent-soft: #12334f;
    --color-accent-text: #7cc4f2;

    --color-success: #5fd6a0;
    --color-success-soft: #123a2b;
    --color-warning: #f3c06b;
    --color-warning-soft: #3d2d10;
    --color-danger: #ff8a80;
    --color-danger-hover: #ffa69e;
    --color-danger-soft: #42191a;

    --color-focus-ring: #7cc4f2;
    --color-overlay: rgb(2 8 16 / 0.72);

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 18px 44px rgb(0 0 0 / 0.6);
  }
}

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