@font-face {
  font-family: 'Golos';
  src: url('/fonts/golos-text-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos';
  src: url('/fonts/golos-text-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/pt-serif-cyrillic-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/pt-serif-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/pt-serif-cyrillic-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Serif';
  src: url('/fonts/pt-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --surface: #ffffff;
  --ink: #15171c;
  --ink-2: #464a53;
  --muted: #787b83;
  --line: #ddd7ca;
  --line-strong: #c9c1b1;
  --navy: #1c2a4f;
  --navy-2: #2c3d6b;
  --red: #c0392b;
  --blue: #2a5bd7;
  --ok: #1d7a4a;
  --ok-bg: #e6f2ea;
  --bad: #b3261e;
  --bad-bg: #fae9e6;
  --focus: #2a5bd7;

  --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Golos', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --topbar-bg: rgba(244, 241, 234, 0.92);
  --sel-bg: #f3f5fa;
  --ok-ink: #134d2f;
  --bad-ink: #7d1a14;
  --tip-bg: #15171c;
  --hover: #faf8f4;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 0 rgba(21, 23, 28, 0.04), 0 1px 3px rgba(21, 23, 28, 0.06);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #12141a;
  --paper-2: #1f222b;
  --surface: #1a1d25;
  --ink: #ecebe6;
  --ink-2: #b8b7b1;
  --muted: #8a8c93;
  --line: #2a2e38;
  --line-strong: #3c414e;
  --navy: #3b5bb0;
  --navy-2: #4a6bc2;
  --red: #ec7365;
  --blue: #86a8ff;
  --ok: #4fc487;
  --ok-bg: #15301f;
  --bad: #f2857a;
  --bad-bg: #3a1c19;
  --focus: #86a8ff;
  --topbar-bg: rgba(18, 20, 26, 0.9);
  --sel-bg: #1f2840;
  --ok-ink: #bfe8cf;
  --bad-ink: #f6c9c3;
  --tip-bg: #2c303b;
  --hover: #20232c;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Переключатель темы */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.theme-btn:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}
.theme-btn .i-sun,
:root[data-theme='dark'] .theme-btn .i-moon {
  display: none;
}
:root[data-theme='dark'] .theme-btn .i-sun {
  display: block;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 0;
}
[hidden] {
  display: none !important;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--blue);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}
p {
  margin: 0;
}
.num {
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover {
  background: var(--navy-2);
  color: #fff;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.ghost:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink-2);
}
.btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: var(--r-sm);
}
.btn.danger {
  background: var(--bad);
}
.btn.danger:hover {
  background: #8f1e18;
}
.btn.block {
  width: 100%;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 14px;
}
.link-btn:hover {
  color: var(--blue);
}

/* Поля */
.field {
  display: grid;
  gap: 6px;
}
.field > label,
.field > .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-2);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(42, 91, 215, 0.18);
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.form-error {
  color: var(--bad);
  font-size: 14px;
  min-height: 0;
}
.form-error:empty {
  display: none;
}

/* Сегментированный выбор */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.seg label:hover {
  border-color: var(--ink-2);
}
.seg input:checked + label {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.seg input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--tip-bg);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 15px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.toast.bad {
  background: var(--bad);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
