:root {
  --ink: #16202c;
  --ink-soft: #5b6775;
  --line: #e3e8ee;
  --bg: #f6f8fa;
  --paper: #ffffff;
  --accent: #1f6feb;
  --accent-dark: #1757bd;
  --warn-bg: #fff6e5;
  --warn-line: #f0c36d;
  --error: #c0392b;
  --radius: 12px;
  --wrap: 1120px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* --- шапка/подвал --- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--ink-soft); font-size: .95rem; }
.nav-cta { color: var(--accent) !important; font-weight: 600; }
.site-footer { margin-top: 64px; padding: 28px 0; border-top: 1px solid var(--line); background: var(--paper); font-size: .9rem; color: var(--ink-soft); }

/* --- главная --- */
.hero { padding: 56px 0 32px; max-width: 760px; }
.hero h1 { font-size: 2.4rem; line-height: 1.2; margin: 0 0 16px; }
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-points { list-style: none; padding: 0; margin: 0; color: var(--ink-soft); }
.hero-points li { padding-left: 26px; position: relative; margin-bottom: 6px; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.section { padding: 32px 0; }
.section h2 { font-size: 1.5rem; margin: 0 0 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; color: inherit; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0 0 12px; color: var(--ink-soft); font-size: .95rem; }
.card-meta { font-size: .85rem; color: var(--ink-soft); }
.steps-list { padding-left: 20px; color: var(--ink-soft); }
.steps-list b { color: var(--ink); }

/* --- кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .98rem; cursor: pointer; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }

/* --- страница документа --- */
.crumbs { padding: 20px 0 8px; font-size: .88rem; color: var(--ink-soft); }
.doc-page { max-width: 760px; }
.doc-page h1 { font-size: 2rem; margin: 8px 0 12px; }
.lead { font-size: 1.1rem; color: var(--ink-soft); }
.start-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 24px 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.start-note { color: var(--ink-soft); font-size: .92rem; }
.legal-note { font-size: .88rem; color: var(--ink-soft); }
.checklist, .mistakes { padding-left: 20px; }
.checklist li, .mistakes li { margin-bottom: 10px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* --- мастер --- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 24px 0 48px; align-items: start; }
.wizard-form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.wizard-form h1 { font-size: 1.5rem; margin: 6px 0 8px; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); transition: width .3s; }
.progress-label { font-size: .85rem; color: var(--ink-soft); margin: 8px 0 4px; }
.hint { color: var(--ink-soft); margin-top: 0; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.req { color: var(--error); }
.field input[type=text], .field input[type=date], .field input[type=tel],
.field input[type=email], .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}
.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; cursor: pointer; }
.option input { margin-top: 4px; }
.help { font-size: .86rem; color: var(--ink-soft); margin: 6px 0 0; }
.error { color: var(--error); font-size: .88rem; margin: 6px 0 0; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--error); }
.alert { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

.wizard-preview { position: sticky; top: 88px; }
.preview-head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-soft); margin-bottom: 8px; }
.preview-paper {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 36px; max-height: 76vh; overflow: auto;
}

/* --- текст документа --- */
.doc { font-family: "Times New Roman", Georgia, serif; font-size: 15px; line-height: 1.55; color: #111; }
.doc .doc-title { font-size: 17px; text-align: center; text-transform: uppercase; margin: 0 0 18px; }
.doc .doc-section { font-size: 15px; margin: 18px 0 8px; }
.doc .doc-p, .doc .doc-clause, .doc .doc-sub { margin: 0 0 8px; text-align: justify; }
.doc .doc-clause { text-indent: 0; }
.doc .doc-sub { padding-left: 18px; }
.doc .doc-num { font-weight: 600; }
.doc .doc-note { font-size: 13px; color: #6b7684; font-style: italic; }
.doc .doc-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.doc .doc-sign-role { font-weight: 700; }
.doc .doc-sign-line { margin-top: 28px; }

/* --- результат --- */
.result { padding: 24px 0 48px; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.annex-title { margin-top: 40px; }

@media (max-width: 900px) {
  .wizard { grid-template-columns: 1fr; }
  .wizard-preview { position: static; order: -1; }
  .preview-paper { max-height: 40vh; padding: 20px; }
  .hero h1 { font-size: 1.9rem; }
  .nav a:not(.nav-cta) { display: none; }
}

/* --- поиск --- */
.search-form { display: flex; gap: 10px; margin: 20px 0 28px; max-width: 620px; }
.search-form input[type=search] {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 1rem; background: var(--paper); color: var(--ink);
}
.search-form input[type=search]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

/* --- списки ссылок и статьи --- */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: none; }
.section h2 a { color: inherit; }
.section h2 a:hover { color: var(--accent); text-decoration: none; }

.article-body { max-width: 720px; }
.article-body h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.article-body h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.article-body p { margin: 0 0 14px; }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 16px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--paper); color: var(--ink-soft); border-radius: 0 8px 8px 0;
}
.article-meta { color: var(--ink-soft); font-size: .9rem; margin-top: -6px; }
.callout {
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px;
  padding: 14px 16px; margin: 20px 0;
}
.callout p:last-child { margin-bottom: 0; }

/* --- оплата --- */
.print-watermark {
  max-width: 800px; margin: 16px auto -8px; padding: 10px 14px; text-align: center;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px;
  font-family: Inter, sans-serif; font-size: .9rem; color: #7a5b16;
}
.doc-watermark { position: relative; }
.doc-watermark::before {
  content: "ОБРАЗЕЦ"; position: absolute; top: 40%; left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-size: 5rem; font-weight: 700; color: rgba(31, 111, 235, .07);
  pointer-events: none; letter-spacing: .1em; white-space: nowrap;
}
.price-box {
  display: flex; align-items: baseline; gap: 12px; margin: 8px 0 20px;
}
.price { font-size: 2rem; font-weight: 700; }
.price-old { color: var(--ink-soft); text-decoration: line-through; }
.checkout { max-width: 640px; }
.checkout-list { list-style: none; padding: 0; margin: 0 0 24px; }
.checkout-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.checkout-list li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 10px; }
.test-badge {
  display: inline-block; background: #fff3cd; border: 1px solid var(--warn-line);
  border-radius: 6px; padding: 2px 8px; font-size: .8rem; color: #7a5b16; margin-left: 8px;
}
.files-list { display: grid; gap: 12px; margin: 20px 0; }
.file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
}
.file-row b { display: block; }
.file-row .muted { font-size: .85rem; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 600px) {
  .file-row { flex-direction: column; align-items: stretch; }
  .file-actions { justify-content: stretch; }
  .file-actions .btn { flex: 1; }
}

/* --- админка --- */
.admin-nav {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 0 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.admin-nav a { color: var(--ink-soft); font-size: .95rem; }
.admin-nav a:hover { color: var(--accent); }
.admin-logout { margin-left: auto; }
.link-button {
  background: none; border: none; padding: 0; font: inherit; font-size: .95rem;
  color: var(--ink-soft); cursor: pointer;
}
.link-button:hover { color: var(--error); }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head h1 { font-size: 1.6rem; }
.period-switch { display: flex; gap: 4px; }
.period-switch a {
  padding: 5px 12px; border-radius: 8px; font-size: .88rem;
  color: var(--ink-soft); border: 1px solid transparent;
}
.period-switch a.is-active { background: var(--paper); border-color: var(--line); color: var(--ink); }
.admin-section { margin: 36px 0; }
.admin-section h2 { font-size: 1.2rem; margin-bottom: 14px; }
.admin-login { max-width: 380px; margin: 60px auto; }

/* плитки-показатели: число крупно, подпись мелко */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 20px 0; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile-label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 6px; }
.tile-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 1rem; font-weight: 400; color: var(--ink-soft); }

/* воронка: один ряд, одна заливка, значения подписаны рядом с полосой */
.funnel { width: 100%; border-collapse: collapse; }
.funnel th {
  text-align: left; font-weight: 400; color: var(--ink-soft);
  padding: 7px 14px 7px 0; white-space: nowrap; font-size: .95rem;
}
.funnel-bar-cell { width: 55%; padding: 7px 0; }
.funnel-bar {
  display: block; height: 14px; min-width: 3px; background: var(--accent);
  border-radius: 0 4px 4px 0;
}
.funnel-count {
  padding: 7px 0 7px 14px; font-variant-numeric: tabular-nums;
  font-weight: 600; text-align: right; width: 76px;
}
.funnel-rate {
  padding: 7px 0 7px 14px; font-variant-numeric: tabular-nums;
  color: var(--ink-soft); text-align: right; width: 70px; font-size: .9rem;
}

/* таблицы данных */
.grid { width: 100%; border-collapse: collapse; font-size: .94rem; }
.grid th {
  text-align: left; font-weight: 600; font-size: .85rem; color: var(--ink-soft);
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: none; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* статус подписан словом, а не только цветом */
.status {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: .82rem; border: 1px solid;
}
.status.is-good { background: #eaf6ec; border-color: #b6ddbe; color: #256b33; }
.status.is-wait { background: var(--warn-bg); border-color: var(--warn-line); color: #7a5b16; }
.status.is-bad  { background: #fdeceb; border-color: #f0b7b2; color: #a02c22; }
.status.is-new  { background: #eef2f7; border-color: var(--line); color: var(--ink-soft); }

.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: .88rem; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
@media (max-width: 700px) {
  .grid { font-size: .88rem; }
  .funnel th { font-size: .85rem; }
  .funnel-bar-cell { width: 40%; }
}
.admin-mark {
  font-size: .8rem; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 99px; padding: 3px 10px;
}

/* --- правовые страницы и согласие --- */
.legal-page h2 { font-size: 1.25rem; margin: 30px 0 10px; }
.legal-page p, .legal-page li { color: var(--ink); }
.md-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .94rem; }
.md-table th {
  text-align: left; font-size: .85rem; color: var(--ink-soft); font-weight: 600;
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line);
}
.md-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.consent-field { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.consent-field .option span { font-size: .92rem; line-height: 1.5; }
