:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-sunken: #eef1f6;
  --fg: #14171f;
  --fg-muted: #5b6472;
  --line: #dfe3ea;
  --line-strong: #c6cdd8;
  --brand: #1f6feb;
  --brand-dark: #1957bb;
  --brand-soft: #e8f0fe;
  --green: #16794c;
  --green-soft: #e6f4ec;
  --yellow: #8a6100;
  --yellow-soft: #fdf3e0;
  --red: #b42318;
  --red-soft: #fdeceb;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 23, 31, .06), 0 8px 24px rgba(20, 23, 31, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218;
    --bg-soft: #161a22;
    --bg-sunken: #1c212b;
    --fg: #e8ecf3;
    --fg-muted: #9aa4b4;
    --line: #262c38;
    --line-strong: #333b4a;
    --brand: #4f92ff;
    --brand-dark: #79aaff;
    --brand-soft: #16233c;
    --green: #4ec98d;
    --green-soft: #12271d;
    --yellow: #e0b24d;
    --yellow-soft: #2a2113;
    --red: #f18b82;
    --red-soft: #2c1614;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

/* Явный выбор тёмной темы перекрывает системную настройку. */
:root[data-theme="dark"] {
    --bg: #0f1218;
    --bg-soft: #161a22;
    --bg-sunken: #1c212b;
    --fg: #e8ecf3;
    --fg-muted: #9aa4b4;
    --line: #262c38;
    --line-strong: #333b4a;
    --brand: #4f92ff;
    --brand-dark: #79aaff;
    --brand-soft: #16233c;
    --green: #4ec98d;
    --green-soft: #12271d;
    --yellow: #e0b24d;
    --yellow-soft: #2a2113;
    --red: #f18b82;
    --red-soft: #2c1614;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 460px; margin: 0 auto; padding: 0 20px; }

/* --- шапка --- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.topbar .inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 60px; max-width: 1080px; margin: 0 auto; padding: 0 20px;
}
.logo { font-weight: 700; font-size: 16px; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo .mark { font-size: 18px; letter-spacing: -2px; }
.nav { display: flex; gap: 18px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--fg-muted); font-size: 14px; }
.nav a.active { color: var(--fg); font-weight: 600; }

/* --- кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff; transition: background .15s ease;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--fg); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --- карточки --- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg); padding: 22px; margin-bottom: 18px;
}
.card-soft { background: var(--bg-soft); }
.card h2 { font-size: 17px; margin: 0 0 14px; }
.card h3 { font-size: 15px; margin: 0 0 10px; }

/* --- формы --- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--fg-muted); font-weight: 400; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.checkbox input { width: auto; margin-top: 3px; }

/* --- сообщения --- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); }
.alert-warn { background: var(--yellow-soft); color: var(--yellow); }

/* --- светофор --- */
.verdict { display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.verdict.green { background: var(--green-soft); color: var(--green); }
.verdict.yellow { background: var(--yellow-soft); color: var(--yellow); }
.verdict.red { background: var(--red-soft); color: var(--red); }

.finding { border-left: 3px solid var(--line-strong); padding: 10px 14px;
  margin-bottom: 10px; background: var(--bg-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.finding.red { border-left-color: var(--red); }
.finding.yellow { border-left-color: var(--yellow); }
.finding .title { font-weight: 600; font-size: 14px; }
.finding .detail { font-size: 13px; color: var(--fg-muted); margin-top: 4px; }

/* --- таблицы --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--fg-muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* --- утилиты --- */
.muted { color: var(--fg-muted); }
.small { font-size: 13px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--bg-sunken); font-size: 12px; color: var(--fg-muted); margin: 2px 4px 2px 0; }
.tag-ok { background: var(--green-soft); color: var(--green); }
.tag-warn { background: var(--yellow-soft); color: var(--yellow); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.page-title { font-size: 24px; margin: 26px 0 6px; }
.page-sub { color: var(--fg-muted); margin: 0 0 22px; }
main { padding-bottom: 60px; }

/* --- лендинг --- */
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: 42px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -.02em; }
.hero p.lead { font-size: 18px; color: var(--fg-muted); max-width: 620px; margin: 0 0 28px; }
.eyebrow { display: inline-block; padding: 5px 13px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 600; margin-bottom: 20px; }
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 27px; margin: 0 0 10px; letter-spacing: -.01em; }
.section > .container > p.lead { color: var(--fg-muted); max-width: 640px; margin: 0 0 30px; }
.step { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-soft); }
.step .num { display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 15px; }
.step p { margin: 0; font-size: 14px; color: var(--fg-muted); }

.demo {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-soft); padding: 20px; box-shadow: var(--shadow);
}
.demo-line { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.demo-line:last-child { border-bottom: none; }

/* --- тарифы --- */
.plan { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; background: var(--bg); }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan .price { font-size: 38px; font-weight: 700; letter-spacing: -.02em; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--fg-muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0; }
.plan li { padding: 6px 0 6px 26px; position: relative; font-size: 14px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.addon { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg); text-align: center; }
.addon .price { font-size: 22px; font-weight: 700; }
.addon .price small { font-size: 13px; font-weight: 500; color: var(--fg-muted); }

footer { border-top: 1px solid var(--line); padding: 30px 0 44px; color: var(--fg-muted); font-size: 13.5px; }
footer a { color: var(--fg-muted); }

@media (max-width: 640px) {
  .hero { padding: 46px 0 34px; }
  .hero h1 { font-size: 30px; }
  .field-row { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
}

/* --- переключатель темы --- */
.theme-toggle {
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--radius); cursor: pointer; font-size: 15px;
  line-height: 1; padding: 7px 11px; color: var(--fg);
}
.theme-toggle:hover { background: var(--bg-soft); }
.lang-switch { display: flex; gap: 2px; align-items: center; font-size: 13px; }
.lang-switch a { color: var(--fg-muted); padding: 4px 7px; border-radius: 6px; }
.lang-switch a.active { color: var(--fg); background: var(--bg-sunken); font-weight: 600; }
