/* Общие токены и база для теста и админки. Цвета — по брендбуку «100 Лидеров» */
@font-face {
  font-family: "Golos Text";
  src: url("/static/fonts/golos-text.woff") format("woff");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --brand: #293A96;          /* фирменный синий «100 Лидеров» */
  --brand-deep: #1F2C78;
  --brand-ink-soft: #DDE2F6; /* второстепенный текст на синем */
  --ground: #EEF0F6;
  --surface: #FFFFFF;
  --surface-2: #F5F6FA;
  --ink: #141A33;
  --ink-2: #3E4666;
  --ink-3: #555D7C;
  --placeholder: #6A7290;
  --line: #D6DAE8;
  --line-strong: #8790AE;
  --primary: var(--brand);
  --primary-hover: var(--brand-deep);
  --primary-tint: #E7EAF6;
  --on-primary: #FFFFFF;
  --best: #16714A;
  --best-tint: #E1F1E7;
  --worst: #A6382A;
  --worst-hover: #8A2D21;
  --worst-tint: #F8E6E2;
  --warn: #8A5A00;
  --warn-tint: #FBF0D9;
  --row-hover: #F2F4FA;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --shadow: 0 1px 2px rgba(20, 26, 51, .06), 0 8px 20px -10px rgba(20, 26, 51, .2);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  caret-color: var(--primary);
}
::selection { background: #C9D0EE; color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p, li { text-wrap: pretty; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-m);
  background: var(--primary); color: var(--on-primary);
  font-weight: 600; font-size: 1rem; line-height: 1; white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--primary-hover); } }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
@media (hover: hover) { .btn.secondary:hover { border-color: var(--ink-3); background: var(--surface-2); } }
.btn.ghost { background: transparent; color: var(--primary); padding: 0 12px; }
@media (hover: hover) { .btn.ghost:hover { background: var(--primary-tint); } }
.btn.danger { background: var(--worst); }
@media (hover: hover) { .btn.danger:hover { background: var(--worst-hover); } }
.btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn[aria-busy="true"] { position: relative; color: transparent; }
.btn[aria-busy="true"] svg { visibility: hidden; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border: 2px solid var(--on-primary); border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.secondary[aria-busy="true"]::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field-label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: 8px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  background: var(--surface); font-size: 1.0625rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input::placeholder { color: var(--placeholder); }
@media (hover: hover) { .input:hover { border-color: var(--ink-3); } }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(41, 58, 150, .25); }
.input[aria-invalid="true"] { border-color: var(--worst); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.error-text { color: var(--worst); font-size: .9375rem; margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn[aria-busy="true"]::after { border-right-color: var(--on-primary); opacity: .6; }
}
