:root {
  --bg: #f4f7fb;
  --bg-top: #f8fbff;
  --surface: #ffffff;
  --ink: #0b1220;
  --muted: #5b6b7e;
  --line: #d9e2ec;
  --accent: #1d4ed8;
  --accent-strong: #0b3b8c;
  --sky: #0ea5e9;
  --soft: #eaf3ff;
  --success: #047857;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(255, 255, 255, 0.92);
  --field-bg: #f8fafc;
  --footer-bg: #0b1220;
  --radius: 16px;
  --radius-lg: 24px;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-top: #0f172a;
  --surface: #111c2e;
  --ink: #e5edf7;
  --muted: #94a3b8;
  --line: #2a3a4f;
  --accent: #60a5fa;
  --accent-strong: #bfdbfe;
  --sky: #38bdf8;
  --soft: #172a42;
  --success: #34d399;
  --danger: #f87171;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  --header-bg: rgba(10, 16, 26, 0.92);
  --field-bg: #17283f;
  --footer-bg: #070d15;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.skip-link:focus { left: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 56px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1rem; }
.brand-text span { font-size: 0.8rem; color: var(--muted); }
.site-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}
.site-nav a:hover { background: var(--soft); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav-toggle {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.header-cta { flex-shrink: 0; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--soft); }
.theme-icon { font-size: 1rem; line-height: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--sky));
  color: #fff;
}
.btn-primary:hover { color: #fff; text-decoration: none; }
.btn-light { background: var(--surface); color: var(--ink); }
.btn-light:hover { background: var(--soft); text-decoration: none; }
.btn-ghost-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.2); text-decoration: none; }

.hero {
  color: #fff;
  background: linear-gradient(135deg, #0b1220 0%, #123a6b 55%, #1d4ed8 100%);
}
.hero-home,
.hero-profile { padding: 44px 0 52px; }
.hero-page {
  padding: 36px 0 42px;
  background: linear-gradient(135deg, #0b1220 0%, #123a6b 65%, #2563eb 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: center;
}
.hero-copy h1,
.hero-narrow h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.12;
}
.hero-page .hero-narrow h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.hero-narrow { max-width: 900px; }
.lead {
  color: #dbeafe;
  font-size: 1.05rem;
  max-width: 70ch;
  margin: 0;
}
.eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.hero-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(8px);
}
.hero-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #e0f2fe;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.stats div {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
}
.stats strong { display: block; font-size: 1.35rem; }
.stats span { color: #cbd5e1; font-size: 0.78rem; }
.page-main { padding: 18px 0 42px; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 18px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.sep { color: #94a3b8; }

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 32px);
}

.prose h2 { margin-top: 1.5em; font-size: 1.35rem; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.2em; font-size: 1.1rem; }
.prose p { margin: 0 0 1rem; }
.prose ul,
.prose ol { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }
.prose strong { color: var(--accent-strong); }
.prose a { font-weight: 600; }
.prose blockquote {
  border-left: 4px solid var(--accent);
  background: var(--soft);
  padding: 10px 14px;
  border-radius: 8px;
}
.prose table { width: 100%; border-collapse: collapse; }
.prose th,
.prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose sub,
.prose sup { font-size: 0.8em; }

.sidebar { display: grid; gap: 16px; }
.side-card { padding: 18px; }
.side-card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.link-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 0.9rem;
}
.link-list a:hover { background: var(--soft); text-decoration: none; }
.link-list a[aria-current="page"] { background: var(--accent); color: #fff; }

.muted { color: var(--muted); font-size: 0.9rem; }

.section-block { margin-top: 28px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-head p { margin: 0; }

.testimonial-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.testimonial,
.news-card { padding: 18px; }
.testimonial h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--accent-strong);
}
.testimonial p { margin: 0; font-size: 0.95rem; }
.testimonial-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}
.news-card h3 { margin: 8px 0; font-size: 1rem; }
.news-card p { margin: 0; font-size: 0.92rem; }

.feature-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}
.feature-list li {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.feature-list a { color: var(--ink); font-weight: 600; }

.notice {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 4px solid var(--sky);
  background: var(--soft);
  border-radius: 10px;
  font-size: 0.92rem;
}
.notice strong { display: block; color: var(--ink); }
.notice span { color: var(--muted); }

.quiz-accordion {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.quiz-accordion summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.quiz-accordion summary::-webkit-details-marker { display: none; }
.quiz-summary-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.quiz-accordion summary::after {
  content: 'Открыть';
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.quiz-accordion[open] summary::after { content: 'Скрыть'; }
.quiz-body {
  padding: 0 clamp(20px, 4vw, 32px) clamp(20px, 4vw, 32px);
  border-top: 1px solid var(--line);
}
.quiz-body > .muted { margin: 14px 0 0; }
.quiz-form { margin-top: 16px; }
.quiz-question {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg);
}
.quiz-question legend {
  margin-bottom: 8px;
  font-weight: 700;
}
.quiz-options { display: grid; gap: 8px; }
.quiz-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.95rem;
}
.quiz-options input { margin-top: 0.25rem; }
.quiz-result {
  margin: 12px 0 0;
  font-weight: 600;
  color: var(--muted);
}
.quiz-result.is-success { color: var(--success); }
.quiz-result.is-error { color: var(--danger); }
.quiz-details { display: grid; gap: 10px; margin-top: 14px; }
.quiz-detail {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--field-bg);
}
.quiz-detail-correct { border-left-color: var(--success); }
.quiz-detail-wrong { border-left-color: var(--danger); }
.quiz-detail p { margin: 0 0 4px; font-size: 0.9rem; }
.quiz-detail p:last-child { margin-bottom: 0; }
.quiz-detail-question { font-weight: 700; color: var(--ink); }
.quiz-detail-status { font-weight: 700; }
.quiz-detail-correct .quiz-detail-status { color: var(--success); }
.quiz-detail-wrong .quiz-detail-status { color: var(--danger); }
.quiz-detail-correct-answer { font-weight: 700; }

.main-column { display: grid; gap: 16px; }
.contact-form-card {
  padding: clamp(20px, 4vw, 32px);
}
.contact-form-card h2 { margin: 0 0 6px; font-size: 1.35rem; }
.form-grid { display: grid; gap: 14px; margin-top: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field label { font-weight: 700; font-size: 0.9rem; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.form-field textarea { resize: vertical; }
.form-status {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.form-status.is-success { color: var(--success); }
.form-status.is-error { color: var(--danger); }
.form-actions { margin-top: 14px; }
.turnstile-widget { min-height: 65px; }
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  background: var(--footer-bg);
  color: #cbd5e1;
  padding: 32px 0 18px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 20px;
}
.footer-grid h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #e2e8f0;
}
.footer-grid p { margin: 6px 0 0; color: #94a3b8; font-size: 0.9rem; }
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.footer-grid a { color: #e2e8f0; font-size: 0.88rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  margin-top: 20px;
  padding-top: 14px;
  color: #94a3b8;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    margin-left: 0;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 8px 10px; }
  .header-cta { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 480px; }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .testimonial-grid,
  .news-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .container { width: calc(100% - 24px); }
  .header-inner { gap: 10px; }
  .brand img { width: 32px; height: 48px; }
  .brand-text strong { font-size: 0.9rem; }
  .brand-text span { font-size: 0.72rem; }
  .theme-toggle { padding: 8px 9px; }
  .theme-label { display: none; }
  .hero-home,
  .hero-profile { padding: 30px 0 36px; }
  .hero-copy h1 { font-size: 1.7rem; }
  .hero-page { padding: 26px 0 32px; }
  .hero-page .hero-narrow h1 { font-size: 1.45rem; }
  .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

