/* =====================================================================
   РЕПЕТИТУМ — Дизайн-токены (формат shadcn/ui)
   ---------------------------------------------------------------------
   Светлая тема — :root. Тёмная — те же переменные под классом .dark.
   Никаких инлайн-литералов в UI: всё через var(--name).
   Шрифт Inter — self-hosted (см. @font-face ниже), без CDN.
   Базовый бренд-синий #2990DC; --primary взят как глубокий #1D73B3
   (проходит контраст белого текста на заливке), #2990DC — glow/ring.
   Нейтрали слегка тёплые (мягче холодного slate).
   ===================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-04FF;
  src: url('fonts/Inter-cyrillic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/Inter-latin.woff2') format('woff2');
}

:root {
  /* --- Поверхности и текст --- */
  --background:            #FBFAF8;
  --foreground:            #1C1A17;
  --card:                  #FFFFFF;
  --popover:               #FFFFFF;
  --popover-foreground:    #1C1A17;

  /* --- Primary (бренд-синий) --- */
  --primary:               #1D73B3;
  --primary-foreground:    #FFFFFF;

  /* --- Secondary / muted / accent (нейтральные роли) --- */
  --secondary:             #F3F1ED;
  --secondary-foreground:  #34302B;
  --muted:                 #F3F1ED;
  --muted-foreground:      #726B62;
  --accent:                #E9F2FA;   /* бренд-тинт: hover/выбранное */
  --accent-foreground:     #14598E;

  /* --- Destructive --- */
  --destructive:           #DC2626;
  --destructive-foreground:#FFFFFF;

  /* --- Линии и фокус --- */
  --border:                #E7E3DC;
  --input:                 #DED8D0;
  --ring:                  #2990DC;

  /* --- Радиус (базовый) --- */
  --radius:                10px;

  /* --------- Расширения поверх shadcn (нужны продукту) --------- */
  /* Статусы: заливка + мягкая подложка (chip/alert) */
  --success:               #1F9D5B;
  --success-foreground:    #FFFFFF;
  --success-muted:         #E6F5EC;
  --success-muted-foreground:#136B3E;

  --warning:               #C77A0A;
  --warning-foreground:    #FFFFFF;
  --warning-muted:         #FAEFD9;
  --warning-muted-foreground:#845205;

  --info:                  #1D73B3;
  --info-muted:            #E9F2FA;
  --info-muted-foreground: #14598E;

  --destructive-muted:            #FCE9E7;
  --destructive-muted-foreground: #A31D1D;

  /* Доска в видеокомнате — «бумага». Единственная поверхность продукта, НЕ зависящая
     от темы: палитра маркеров в RoomToolRail захардкожена под светлый фон (#1a1a1a,
     #e53935, …) и не может стать var() — цвет штриха синкается между участниками как
     литерал (LOCKED-1, см. whiteboard.js). На тёмном --card тёмный маркер по умолчанию
     просто не виден. Пара paper/ink — как --reader-bg/--reader-fg у читалки: --wb-ink нужен,
     потому что накладки над квадратом (rp-chip без модификатора — «Подключаемся к занятию…»,
     «Ждём учителя…») не задают своего цвета и наследуют его; без пиннинга в тёмной теме они
     стали бы светлым текстом на белой бумаге. НЕ переопределять в .dark. */
  --wb-paper:              #FFFFFF;
  --wb-ink:                #1C1A17;

  /* Бренд-константы (для лого/акцентов, не для UI-заливок).
     Исключение — групповые чипы/аватары расписания, залитые --brand-orange: их текст обязан идти
     парным --brand-orange-foreground (тёплые чернила, ~6:1 на оранжевом в обеих темах) — белый
     на #F39322 давал ~2.2:1 (гард BrandOrangeContrastTests). */
  --brand-blue:            #2990DC;
  --brand-blue-deep:       #1D73B3;
  --brand-orange:          #F39322;
  --brand-orange-foreground: #3A2606;

  /* Производные радиусы */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  10px;
  --radius-xl:  14px;
  --radius-2xl: 18px;

  /* Тени — тёплый оттенок, сдержанные (глубину держат hairline-бордеры) */
  --shadow-xs: 0 1px 2px 0 rgba(28, 26, 23, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(28, 26, 23, 0.07), 0 1px 2px -1px rgba(28, 26, 23, 0.05);
  --shadow-md: 0 4px 14px -3px rgba(28, 26, 23, 0.10), 0 2px 4px -2px rgba(28, 26, 23, 0.05);
  --shadow-lg: 0 14px 34px -8px rgba(28, 26, 23, 0.16), 0 4px 8px -4px rgba(28, 26, 23, 0.07);
  --shadow-focus: 0 0 0 3px rgba(41, 144, 220, 0.30);

  /* Отступы (шаг 4px) */
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-5:20px; --space-6:24px; --space-8:32px; --space-10:40px;
  --space-12:48px; --space-16:64px;

  /* Типографика */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;
}

.dark {
  --background:            #171614;
  --foreground:            #F3F1ED;
  --card:                  #201E1B;
  --popover:               #201E1B;
  --popover-foreground:    #F3F1ED;

  --primary:               #3D9BE0;
  --primary-foreground:    #06121C;

  --secondary:             #2A2723;
  --secondary-foreground:  #EDE9E3;
  --muted:                 #262320;
  --muted-foreground:      #A8A199;
  --accent:                #17324A;
  --accent-foreground:     #BFE0F7;

  --destructive:           #F0574F;
  --destructive-foreground:#1A0B0A;

  --border:                #322E28;
  --input:                 #39342D;
  --ring:                  #3D9BE0;

  --success:               #34C285;
  --success-foreground:    #06120C;
  --success-muted:         #16311F;
  --success-muted-foreground:#79DDAC;

  --warning:               #E9A63B;
  --warning-foreground:    #1E1405;
  --warning-muted:         #382A12;
  --warning-muted-foreground:#F0C079;

  --info:                  #3D9BE0;
  --info-muted:            #17324A;
  --info-muted-foreground: #BFE0F7;

  --destructive-muted:            #3A1A17;
  --destructive-muted-foreground: #F5A79F;

  --brand-blue:            #2990DC;
  --brand-blue-deep:       #1D73B3;
  --brand-orange:          #F5A94D;
  --brand-orange-foreground: #3A2606;  /* ~7.3:1 на тёмной #F5A94D */

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.36), 0 1px 2px -1px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 14px -3px rgba(0, 0, 0, 0.44), 0 2px 4px -2px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 14px 34px -8px rgba(0, 0, 0, 0.55), 0 4px 8px -4px rgba(0, 0, 0, 0.35);
  --shadow-focus: 0 0 0 3px rgba(61, 155, 224, 0.35);
}

/* The site-template families (Lora, Nunito, Onest, Unbounded, Manrope) are deliberately NOT declared
   here. Their @font-face rules live in _content/Repetitum.Landing.Blocks/css/site-templates.css,
   which both cabinet hosts link AFTER this file — so with identical descriptors that copy always won
   and the mirror here was dead weight (861 KB of woff2 nothing ever downloaded).

   🔒 Do not restore the mirror "just in case": @font-face does not chain. Rules matching on
   family/weight/style/unicode-range collapse to the LAST one, and if its file fails to load the
   browser falls back to the next family in the font-family list (system-ui) — never to the earlier
   @font-face. A duplicate insures nothing; it only weighs. Guard: TemplateFontsPresentTests. */
