/* Взыщи — Дизайн-система и токены
   Проект платформы ЛавЮрТех (vzyshi.lawjurtech.ru)
   Поддержка светлой и тёмной темы, режима «Спокойно», доступности для дальтоников.
   Внешние шрифты не подключаются — системный безопасный стек. */

:root {
  /* Базовая палитра (Светлая тема) */
  --bg-page: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f3f5;
  --bg-muted: #e9ecef;

  --text-main: #1e242b;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --border-light: #e5e7eb;
  --border-base: #d1d5db;
  --border-strong: #9ca3af;

  /* Бренд-акцент (надёжный синий платформы) */
  --brand-primary: #1e40af;
  --brand-primary-hover: #1d4ed8;
  --brand-light: #eff6ff;
  --brand-border: #bfdbfe;
  --brand-text: #1e3a8a;

  /* Токены таймеров (4 цвета с иконками для дальтоников) */
  /* Зелёный: Можно сейчас */
  --timer-green-text: #166534;
  --timer-green-bg: #f0fdf4;
  --timer-green-border: #86efac;
  --timer-green-accent: #22c55e;

  /* Жёлтый: Скоро дедлайн */
  --timer-yellow-text: #854d0e;
  --timer-yellow-bg: #fefce8;
  --timer-yellow-border: #fef08a;
  --timer-yellow-accent: #eab308;

  /* Красный: Ход другой стороны / пока нельзя (тёплый терракот, не пугающий) */
  --timer-red-text: #9a3412;
  --timer-red-bg: #fff7ed;
  --timer-red-border: #fed7aa;
  --timer-red-accent: #f97316;

  /* Серый: Срок вышел — есть план Б */
  --timer-grey-text: #374151;
  --timer-grey-bg: #f3f4f6;
  --timer-grey-border: #d1d5db;
  --timer-grey-accent: #6b7280;

  /* Радиусы */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  /* Типографика: только системный стек (правило 6: без Google Fonts) */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Анимации (включаются/выключаются) */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --ring-duration: 4s;
}

/* Тёмная тема */
[data-theme="dark"] {
  --bg-page: #0f1419;
  --bg-surface: #182026;
  --bg-surface-elevated: #222c35;
  --bg-subtle: #1f2933;
  --bg-muted: #2d3748;

  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #111827;

  --border-light: #2d3748;
  --border-base: #374151;
  --border-strong: #4b5563;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-light: #1e293b;
  --brand-border: #1e3a8a;
  --brand-text: #93c5fd;

  --timer-green-text: #86efac;
  --timer-green-bg: #064e3b;
  --timer-green-border: #059669;
  --timer-green-accent: #34d399;

  --timer-yellow-text: #fde047;
  --timer-yellow-bg: #713f12;
  --timer-yellow-border: #a16207;
  --timer-yellow-accent: #facc15;

  --timer-red-text: #fdba74;
  --timer-red-bg: #431407;
  --timer-red-border: #9a3412;
  --timer-red-accent: #fb923c;

  --timer-grey-text: #d1d5db;
  --timer-grey-bg: #1f2937;
  --timer-grey-border: #374151;
  --timer-grey-accent: #9ca3af;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

/* Режим «Спокойно» (Calm mode): отключает игровые эффекты, конфетти, пульсацию */
[data-calm-mode="true"],
.calm-mode {
  --ring-duration: 0s;
}

[data-calm-mode="true"] *,
.calm-mode * {
  animation: none !important;
  transition: none !important;
}

/* Базовые стили */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* Ссылки */
a {
  color: var(--brand-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.btn--primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}
.btn--primary:hover {
  background-color: var(--brand-primary-hover);
  text-decoration: none;
}
.btn--secondary {
  background-color: var(--bg-surface);
  border-color: var(--border-base);
  color: var(--text-main);
}
.btn--secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn--ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  text-decoration: none;
}
.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Контейнеры */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
