/* ===================================================================
   AiTenderChat — Design Tokens (iOS 26 / Glassmorphism / SaaS)
   Version: 2026-05-13 v1
   =================================================================== */

:root {
  /* Brand colors */
  --at-primary: #6366f1;
  --at-primary-dark: #4f46e5;
  --at-violet: #8b5cf6;
  --at-cyan: #06b6d4;
  --at-success: #10b981;
  --at-warning: #f59e0b;
  --at-danger: #ef4444;

  /* Brand gradient (everywhere we need accent) */
  --at-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --at-grad-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --at-grad-soft: linear-gradient(135deg, rgba(99,102,241,.14) 0%, rgba(139,92,246,.10) 100%);

  /* Surfaces — light */
  --at-bg: #f5f5f7;          /* Apple gray bg */
  --at-surface: #ffffff;
  --at-surface-2: #fafafa;
  --at-text: #0f172a;
  --at-text-soft: #475569;
  --at-text-muted: #94a3b8;
  --at-border: rgba(0,0,0,.08);
  --at-border-soft: rgba(0,0,0,.04);

  /* Glass — light */
  --at-glass-bg: rgba(255,255,255,.72);
  --at-glass-strong: rgba(255,255,255,.88);
  --at-glass-border: rgba(255,255,255,.6);
  --at-glass-blur: saturate(180%) blur(20px);
  --at-glass-blur-strong: saturate(200%) blur(28px);

  /* Shadows */
  --at-shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.02);
  --at-shadow-md: 0 8px 24px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --at-shadow-lg: 0 24px 60px rgba(15,23,42,.14), 0 6px 16px rgba(15,23,42,.06);
  --at-shadow-glow: 0 8px 28px rgba(99,102,241,.42), 0 2px 8px rgba(139,92,246,.30);

  /* iOS spring curves */
  --at-ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --at-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --at-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --at-dur-fast: 180ms;
  --at-dur: 280ms;
  --at-dur-slow: 420ms;

  /* Radii */
  --at-r-sm: 10px;
  --at-r: 14px;
  --at-r-md: 18px;
  --at-r-lg: 22px;
  --at-r-xl: 28px;
  --at-r-pill: 999px;

  /* Spacing scale */
  --at-s-1: 4px;
  --at-s-2: 8px;
  --at-s-3: 12px;
  --at-s-4: 16px;
  --at-s-5: 20px;
  --at-s-6: 24px;
  --at-s-7: 32px;

  /* Bottom nav heights */
  --at-bn-height: 64px;
  --at-bn-fab-size: 58px;
  --at-bn-fab-lift: 18px;
}

[data-theme="dark"] {
  --at-bg: #000000;
  --at-surface: #1c1c1e;
  --at-surface-2: #2c2c2e;
  --at-text: #f8fafc;
  --at-text-soft: #cbd5e1;
  --at-text-muted: #64748b;
  --at-border: rgba(255,255,255,.10);
  --at-border-soft: rgba(255,255,255,.05);

  --at-glass-bg: rgba(28,28,30,.72);
  --at-glass-strong: rgba(28,28,30,.92);
  --at-glass-border: rgba(255,255,255,.08);

  --at-grad-soft: linear-gradient(135deg, rgba(99,102,241,.20) 0%, rgba(139,92,246,.14) 100%);

  --at-shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --at-shadow-md: 0 8px 24px rgba(0,0,0,.50), 0 2px 6px rgba(0,0,0,.30);
  --at-shadow-lg: 0 24px 60px rgba(0,0,0,.60), 0 6px 16px rgba(0,0,0,.40);
  --at-shadow-glow: 0 8px 28px rgba(99,102,241,.55), 0 2px 8px rgba(139,92,246,.40);
}

/* Respect reduced motion globally */
@media (prefers-reduced-motion: reduce) {
  :root {
    --at-dur-fast: 1ms;
    --at-dur: 1ms;
    --at-dur-slow: 1ms;
  }
}

/* ===================================================================
   Extended tokens (v2, 2026-05-14) — без перезаписи v1
   Префикс без --at- для роадмап-совместимости.
   =================================================================== */
:root {
  /* 4pt grid spacing (parallel to --at-s-*) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 32px;

  /* Radii (parallel to --at-r-*) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Easing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Durations (parallel to --at-dur-*) */
  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-slow: 300ms;

  /* Z-index layers (для очистки 99999) */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 100;
  --z-modal: 1000;
  --z-toast: 10000;
}

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