/* АПТ Периметр — Дизайн-токены */
:root {
  --apt-font-sans: Inter, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --apt-font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  /* Brand colors */
  --apt-brand-50: #e9f8f6;
  --apt-brand-100: #ccefeb;
  --apt-brand-200: #99ddd5;
  --apt-brand-300: #59c6bb;
  --apt-brand-400: #20ab9d;
  --apt-brand-500: #008f81;
  --apt-brand-600: #00786e;
  --apt-brand-700: #006158;
  --apt-brand-800: #064e48;
  --apt-brand-900: #083f3b;

  /* Light theme */
  --apt-bg: #f7fafb;
  --apt-bg-soft: #f0f6f6;
  --apt-surface: #ffffff;
  --apt-surface-raised: rgba(255, 255, 255, 0.94);
  --apt-surface-tint: #eef9f7;
  --apt-text: #132932;
  --apt-text-muted: #5e7180;
  --apt-text-faint: #8a9aa7;
  --apt-border: #dce6e9;
  --apt-border-strong: #bfd2d6;
  --apt-focus: #00786e;
  --apt-success: #087b55;
  --apt-warning: #a15c00;
  --apt-warning-bg: #fff8eb;
  --apt-danger: #c92f45;
  --apt-danger-bg: #fff2f4;
  --apt-info: #126a88;
  --apt-overlay: rgba(8, 24, 30, 0.58);

  /* Палитра диаграмм (стиль АПТ: бирюза — основной, приглушённые акценты для сроков) */
  --ch-ok: #20ab9d;
  --ch-ok-2: #008f81;
  --ch-info: #59c6bb;
  --ch-warn: #d9a441;
  --ch-bad: #d9667a;
  --ch-muted: #bfd2d6;

  /* Spacing */
  --apt-space-1: 4px;
  --apt-space-2: 8px;
  --apt-space-3: 12px;
  --apt-space-4: 16px;
  --apt-space-5: 20px;
  --apt-space-6: 24px;
  --apt-space-8: 32px;
  --apt-space-10: 40px;
  --apt-space-12: 48px;

  /* Radius */
  --apt-radius-sm: 8px;
  --apt-radius-md: 12px;
  --apt-radius-lg: 18px;
  --apt-radius-xl: 24px;
  --apt-radius-pill: 999px;

  /* Shadows */
  --apt-shadow-sm: 0 2px 8px rgba(20, 54, 64, 0.07);
  --apt-shadow-md: 0 12px 34px rgba(20, 54, 64, 0.1);
  --apt-shadow-lg: 0 24px 72px rgba(20, 54, 64, 0.16);
  --apt-glow: 0 8px 24px rgba(0, 143, 129, 0.22);

  /* Animation */
  --apt-duration-fast: 140ms;
  --apt-duration-base: 240ms;
  --apt-duration-slow: 480ms;
  --apt-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --apt-sidebar: 272px;
  --apt-topbar: 64px;
  --apt-content: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --apt-bg: #0d181c;
    --apt-bg-soft: #132226;
    --apt-surface: #17272c;
    --apt-surface-raised: rgba(23, 39, 44, 0.94);
    --apt-surface-tint: #16302f;
    --apt-text: #edf6f5;
    --apt-text-muted: #afc1c5;
    --apt-text-faint: #7f949a;
    --apt-border: #2d4248;
    --apt-border-strong: #446067;
    --apt-focus: #59c6bb;
    --apt-warning: #ffc268;
    --apt-warning-bg: #342718;
    --apt-danger: #ff8797;
    --apt-danger-bg: #351e24;
    --apt-info: #72c9e6;
    --apt-overlay: rgba(2, 9, 11, 0.76);
    --apt-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.22);
    --apt-shadow-md: 0 12px 34px rgba(0, 0, 0, 0.3);
    --apt-shadow-lg: 0 24px 72px rgba(0, 0, 0, 0.44);
  }
}

/* Base styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--apt-font-sans);
  background: var(--apt-bg);
  color: var(--apt-text);
  line-height: 1.5;
}

/* Фирменный фон — линии-нейросети (только светлая тема, канон АПТ) */
@media (prefers-color-scheme: light) {
  .apt-pattern { background-image: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--apt-bg) 70%, transparent)), url('../assets/circuit-pattern.svg'); background-repeat: no-repeat, repeat; background-position: center, right 10px top 22px; background-size: auto, 640px 420px; }
}

/* Поля ввода — плашки (канон АПТ: как композер чата) */
input:not([type="checkbox"]):not([type="radio"]),
select, textarea {
  background: var(--apt-surface) !important;
  border: 1px solid var(--apt-border) !important;
  border-radius: var(--apt-radius-md) !important;
  box-shadow: var(--apt-shadow-sm);
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: var(--apt-focus) !important;
  box-shadow: var(--apt-glow);
  outline: none;
}
