/* frontend/css/tokens.css */
/* Дизайн-система «Ателье» (Вариант B) + Dark Mode токени */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;800&family=Rubik:wght@500;700&display=swap');

:root {
  /* Палитра «Ателье» (Светлая тема) */
  --bg-app: #e7f0ea;
  --bg-card: #ffffff;
  --bg-surface: #d3e4da;
  --bg-input: #ffffff;

  --text-primary: #0f3b2e;
  --text-secondary: #4f6d5f;
  --text-on-accent: #ffffff;

  --border-color: #c3d8cb;
  --border-width: 1.5px;

  /* Главный акцент (малиновый) */
  --accent-primary: #c81e6a;
  --accent-hover: #b0155b;
  --scan-highlight: #fbd5e5;

  /* Функциональные статусы */
  --color-success: #1c7c4d;
  --color-warning: #b45309;
  --color-error: #b42318;

  /* Статусы ячейки (фон / текст / рамка) */
  --cell-free-bg: #ffffff;
  --cell-free-text: #0f3b2e;
  --cell-free-border: #c3d8cb;

  --cell-progress-bg: #fde4ee;
  --cell-progress-text: #8f1450;
  --cell-progress-border: #c81e6a;

  --cell-closed-bg: #d3e4da;
  --cell-closed-text: #0f3b2e;
  --cell-closed-border: #b6d0c0;

  --cell-accepted-bg: #d7f0e1;
  --cell-accepted-text: #14633c;
  --cell-accepted-border: #1c7c4d;

  --cell-recount-bg: #fdebd0;
  --cell-recount-text: #8a4a06;
  --cell-recount-border: #b45309;

  /* Формы и тени */
  --radius-card: 22px;
  --radius-tile: 22px;
  --radius-app: 34px;
  --radius-pill: 999px;
  --shadow-card: 0 6px 16px rgba(15, 59, 46, 0.10);

  /* Типографика */
  --font-headings: 'Rubik', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;

  /* Размеры сенсорных зон */
  --touch-button-h: 60px;
  --touch-primary-btn-h: 68px;
  --touch-tile-h: 100px;
  --touch-chip-h: 44px;
  --touch-icon-h: 48px;
  --touch-pm-btn-h: 64px;
}

/* Темная тема (Dark Mode для складов с плохим освещением) */
[data-theme="dark"] {
  --bg-app: #0f1c16;
  --bg-card: #182b22;
  --bg-surface: #22382d;
  --bg-input: #182b22;

  --text-primary: #e4f2eb;
  --text-secondary: #90b3a3;

  --border-color: #2e4a3c;
  --border-width: 1.5px;

  --accent-primary: #e02479;
  --accent-hover: #c81e6a;
  --scan-highlight: #3b1728;

  --color-success: #2ec27c;
  --color-warning: #e08326;
  --color-error: #e64537;

  --cell-free-bg: #182b22;
  --cell-free-text: #e4f2eb;
  --cell-free-border: #2e4a3c;

  --cell-progress-bg: #381a28;
  --cell-progress-text: #fca7cb;
  --cell-progress-border: #e02479;

  --cell-closed-bg: #22382d;
  --cell-closed-text: #e4f2eb;
  --cell-closed-border: #355746;

  --cell-accepted-bg: #163d2b;
  --cell-accepted-text: #70e3a5;
  --cell-accepted-border: #2ec27c;

  --cell-recount-bg: #422912;
  --cell-recount-text: #f8c07e;
  --cell-recount-border: #e08326;

  --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.40);
}

/* Базовый сброс */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-primary);
  background-color: var(--bg-app);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

h1, h2, h3, h4, .font-heading {
  font-family: var(--font-headings);
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
