/* AgentBroker — design tokens (CSS custom properties)
 * Generated from tokens/tokens.json. Consume directly in legacy PHP/Yii2 CSS
 * and in new React widgets that need raw CSS variables.
 *
 * Usage:
 *   <link rel="stylesheet" href="/widget/_shared/tokens.css">
 *   color: var(--ab-color-text);
 *   background: var(--ab-color-brand-500);
 */

:root {
  /* ── Brand ─────────────────────────────────────────────── */
  --ab-color-brand-50:  #fff1f4;
  --ab-color-brand-100: #ffe1e8;
  --ab-color-brand-200: #ffc2ce;
  --ab-color-brand-300: #ff8ea5;
  --ab-color-brand-400: #fc5b7b;
  --ab-color-brand-500: #f91942; /* primary */
  --ab-color-brand-600: #db1239; /* hover */
  --ab-color-brand-700: #b40c2e; /* active */
  --ab-color-brand-800: #8e0924;
  --ab-color-brand-900: #5f0618;

  /* ── Neutral scale ─────────────────────────────────────── */
  --ab-color-gray-0:    #ffffff;
  --ab-color-gray-25:   #fbfbfc;
  --ab-color-gray-50:   #f7f7f8;
  --ab-color-gray-100:  #eeeef1;
  --ab-color-gray-200:  #e2e2e6;
  --ab-color-gray-300:  #cfcfd6;
  --ab-color-gray-400:  #a1a1ab;
  --ab-color-gray-500:  #71717a;
  --ab-color-gray-600:  #52525b;
  --ab-color-gray-700:  #3f3f46;
  --ab-color-gray-800:  #27272a;
  --ab-color-gray-900:  #18181b;
  --ab-color-gray-1000: #0a0a0c;

  /* ── Semantic status ───────────────────────────────────── */
  --ab-color-success-soft:   #e8f5ec;
  --ab-color-success:        #2f9e44;
  --ab-color-success-strong: #207732;
  --ab-color-warning-soft:   #fff4e0;
  --ab-color-warning:        #e8890b;
  --ab-color-warning-strong: #a86104;
  --ab-color-error-soft:     #fdecec;
  --ab-color-error:          #dc2626;
  --ab-color-error-strong:   #a61b1b;
  --ab-color-info-soft:      #e7f1fb;
  --ab-color-info:           #1971c2;
  --ab-color-info-strong:    #0f4f8a;

  /* ── Semantic aliases (use these in UI CSS) ────────────── */
  --ab-color-bg:            #ffffff;
  --ab-color-bg-subtle:     var(--ab-color-gray-50);
  --ab-color-bg-muted:      var(--ab-color-gray-100);
  --ab-color-surface:       #ffffff;
  --ab-color-surface-alt:   var(--ab-color-gray-25);
  --ab-color-border:        var(--ab-color-gray-200);
  --ab-color-border-strong: var(--ab-color-gray-300);
  --ab-color-text:          var(--ab-color-gray-800);
  --ab-color-text-muted:    var(--ab-color-gray-600);
  --ab-color-text-subtle:   var(--ab-color-gray-500);
  --ab-color-text-inverse:  #ffffff;
  --ab-color-link:          var(--ab-color-brand-600);
  --ab-color-link-hover:    var(--ab-color-brand-700);
  --ab-color-focus-ring:    rgba(249, 25, 66, 0.35);

  /* ── Typography ────────────────────────────────────────── */
  --ab-font-sans: "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ab-font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  --ab-font-size-xs:   12px;
  --ab-font-size-sm:   13px;
  --ab-font-size-base: 14px;
  --ab-font-size-md:   15px;
  --ab-font-size-lg:   16px;
  --ab-font-size-xl:   18px;
  --ab-font-size-2xl:  20px;
  --ab-font-size-3xl:  24px;
  --ab-font-size-4xl:  30px;
  --ab-font-size-5xl:  36px;

  --ab-line-tight:   1.2;
  --ab-line-snug:    1.35;
  --ab-line-normal:  1.5;
  --ab-line-relaxed: 1.65;

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

  /* ── Spacing (4px scale) ───────────────────────────────── */
  --ab-space-0:  0;
  --ab-space-1:  4px;
  --ab-space-2:  8px;
  --ab-space-3:  12px;
  --ab-space-4:  16px;
  --ab-space-5:  20px;
  --ab-space-6:  24px;
  --ab-space-8:  32px;
  --ab-space-10: 40px;
  --ab-space-12: 48px;
  --ab-space-16: 64px;
  --ab-space-20: 80px;

  /* ── Radius ────────────────────────────────────────────── */
  --ab-radius-sm:   4px;
  --ab-radius-md:   6px;
  --ab-radius-lg:   10px;
  --ab-radius-xl:   16px;
  --ab-radius-full: 9999px;

  /* ── Shadow ────────────────────────────────────────────── */
  --ab-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --ab-shadow-md: 0 2px 6px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --ab-shadow-lg: 0 8px 20px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --ab-shadow-xl: 0 20px 48px rgba(15, 23, 42, 0.14), 0 6px 16px rgba(15, 23, 42, 0.06);
  --ab-shadow-focus: 0 0 0 3px var(--ab-color-focus-ring);

  /* ── Motion ────────────────────────────────────────────── */
  --ab-duration-fast: 120ms;
  --ab-duration-base: 180ms;
  --ab-duration-slow: 240ms;
  --ab-ease-standard:   cubic-bezier(0.2, 0, 0, 1);
  --ab-ease-emphasized: cubic-bezier(0.2, 0, 0, 1.2);

  /* ── Z-index ───────────────────────────────────────────── */
  --ab-z-base:    0;
  --ab-z-sticky:  100;
  --ab-z-overlay: 900;
  --ab-z-modal:   1000;
  --ab-z-popover: 1100;
  --ab-z-toast:   1200;
  --ab-z-tooltip: 1300;
}

/* Dark theme — stub for future Telegram Mini App / dark mode.
 * Turn on by adding data-theme="dark" to <html> or <body>.
 * Only semantic aliases change; brand/scale stay the same. */
[data-theme="dark"] {
  --ab-color-bg:            #0f0f12;
  --ab-color-bg-subtle:     #17171b;
  --ab-color-bg-muted:      #1f1f24;
  --ab-color-surface:       #17171b;
  --ab-color-surface-alt:   #1f1f24;
  --ab-color-border:        #2a2a31;
  --ab-color-border-strong: #3a3a43;
  --ab-color-text:          #f4f4f5;
  --ab-color-text-muted:    #a1a1ab;
  --ab-color-text-subtle:   #71717a;
  --ab-color-text-inverse:  #0a0a0c;
  --ab-color-link:          var(--ab-color-brand-400);
  --ab-color-link-hover:    var(--ab-color-brand-300);
}
