/*
 * Buenos Padel — brand tokens.
 * Source of truth: guides/brandbook.html.
 * Loaded on every portal page; new components consume these vars.
 */

@font-face {
  font-family: 'Prostir Sans';
  src: url('/static/fonts/ProstirSans-900.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Mori';
  src: url('/static/fonts/PPMori-400.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Mori';
  src: url('/static/fonts/PPMori-600.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/static/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Typography roles */
  --ff-display: 'Prostir Sans', 'Arial Black', sans-serif;
  --ff-body: 'PP Mori', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Brand palette — canonical (paper / brandbook truth) */
  --bp-green: #79AC2B;
  --bp-green-dark: #5c8a1a;
  --bp-green-tint: #eef6e0;
  /* Same hue, lifted for legibility on slate surfaces */
  --bp-green-on-dark: #92c43a;
  --bp-green-on-dark-deep: #79ac2b;
  --bp-blue: #044184;
  --bp-blue-ink: #032e5e;
  --bp-blue-tint: #e6edf5;
  --bp-paper: #f4f1ea;
  /* v2 airy: #ebe6d9 → ближе к бумаге, второй слой тише */
  --bp-paper-2: #efeadd;
  --bp-ink: #17181a;
  /* v2 airy: #4b4d51 → чуть светлее, меньше шума второстепенного текста */
  --bp-ink-soft: #55575e;
  /* v2 airy: #8a8c92 → */
  --bp-muted: #96989e;
  /* v2 airy: #d9d3c2 → мягче разделители */
  --bp-line: #e2dccc;
  --bp-stamp-red: #a0301e;
  /* Warning palette — Bootstrap's default amber #ffc107 is unreadable on
   * the paper background. Use a deeper mustard tuned for legibility on
   * --bp-paper. `--bp-warning-bg` is the soft-tint cell highlight used
   * in tables/cards (e.g. discount-training column group). */
  --bp-warning: #b07a1f;
  --bp-warning-deep: #8a5e15;
  --bp-warning-fill: #e3a833;
  --bp-warning-bg: #f3dba0;
  --bp-warning-tint: #f9e9c2;

  /* ---- Airy pass v2 (Claude Design) — новые токены ---- */
  --bp-sheet: #ffffff;        /* белый «лист»: карточки, виджеты, модалки */
  --bp-red-tint: #f9e9e6;     /* мягкий фон долга/опасности */
  --bp-line-strong: #cfc8b6;  /* акцентные разделители (thead, статус-бары) */
  --bp-shadow-card: 0 1px 2px rgba(23, 24, 26, 0.04);
  --bp-shadow-pop: 0 12px 32px rgba(23, 24, 26, 0.10);
  --bp-shadow-modal: 0 24px 64px rgba(23, 24, 26, 0.14);

  /* ---- v3 modern (Claude Design) ----
   * Единый гротеск: весь UI — PP Mori; Prostir Sans только заголовки/крупные числа;
   * JetBrains Mono остаётся только для чеков/табуляции цифр.
   * Скругления вместо радиуса 0. */
  --ff-ui: var(--ff-body);
  --bp-radius-lg: 14px;  /* карточки, виджеты, модалки */
  --bp-radius: 10px;     /* алерты, дропдауны */
  --bp-radius-sm: 8px;   /* кнопки, поля, контролы */

  /* ---- v3.1: токены по заявкам token-свипа (10 агентов, 2026-07-04) ---- */
  --bp-radius-xs: 4px;            /* плотная сетка журнала, мелкие свотчи */
  --bp-on-accent: #ffffff;        /* текст на акцентных заливках (blue/green/red) */
  --bp-purple: #7c3aed;           /* группы/турниры — акцент событий с местами */
  --bp-purple-tint: #f1e8fb;
  --bp-orange: #fd7e14;           /* середина severity-шкалы warning→orange→danger */
  --bp-orange-tint: #fdecdc;      /* мягкий фон «не оплачено» (журнал) — в ряду green/red/warning-tint */
  --bp-focus-ring: rgba(4, 65, 132, 0.15);   /* брендовое фокус-кольцо (из --bp-blue) */
  --bp-shadow-hover: 0 2px 8px rgba(23, 24, 26, 0.08);  /* hover-элевация чипов/карточек */
}

/*
 * Portal runs on dark slate surfaces — locally remap --bp-green to the
 * brighter variant so existing var(--bp-green) usages render legibly on dark
 * backgrounds without per-component overrides. CRM/paper surfaces opt out
 * via body.theme-paper.
 */
body:not(.theme-paper) {
  --bp-green: var(--bp-green-on-dark);
  --bp-green-dark: var(--bp-green-on-dark-deep);
}
