/* Виртуаль — разработка и доработка 1С.
   Мотив: учётная книга — бумага с зелёной линовкой и красной двойной полевой линией. */

:root {
  --paper: #F6F8F5;
  --card: #FFFFFF;
  --rule: #D3E2D8;
  --rule-soft: #E6EFE9;
  --ink: #14241C;
  --muted: #55675D;
  --green: #1D5B45;
  --green-hover: #17503C;
  --green-deep: #123B2D;
  --red: #C3352B;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1180px;
  --margin-col: 112px;
  --gutter: 36px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(36px, 5.2vw, 62px); line-height: 1.04; letter-spacing: -0.03em; }
h2 { font-size: clamp(27px, 3.2vw, 38px); line-height: 1.12; margin-bottom: 20px; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 600; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 248, 245, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.logo svg { width: 32px; height: 32px; flex: none; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--green); text-decoration: underline; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px; border-radius: 8px;
  background: var(--green); color: #fff;
  font: 600 17px/1.2 var(--font); text-decoration: none;
  border: 0; cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--green-hover); color: #fff; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-small { padding: 10px 16px; font-size: 15px; }
.btn-small svg { width: 17px; height: 17px; }
.btn-light { background: #fff; color: var(--green-deep); }
.btn-light:hover { background: #E8F1EB; color: var(--green-deep); }

/* ---------- Учётная книга: полевая колонка и красная двойная линия ---------- */
.ledger { position: relative; padding-left: calc(var(--margin-col) + var(--gutter)); }
.ledger::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: calc(24px + var(--margin-col));
  width: 5px;
  border-left: 1px solid var(--red); border-right: 1px solid var(--red);
  opacity: .7; pointer-events: none;
}
.wrap.ledger { padding-left: calc(24px + var(--margin-col) + var(--gutter)); }

.section { padding: 76px 0; border-top: 1px solid var(--rule); }
.section-intro { max-width: 40em; color: var(--muted); margin-bottom: 36px; }

/* ---------- Первый экран ---------- */
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; padding: 72px 0 84px; }
.hero-text h1 { max-width: 13ch; }
.lead { font-size: 20px; line-height: 1.55; color: var(--muted); max-width: 34em; margin: 26px 0 34px; }
.hero-note { margin: 18px 0 0; font-size: 15px; color: var(--muted); }

/* Дерево конфигурации */
.tree {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 24px 48px -32px rgba(18, 59, 45, .45);
  overflow: hidden;
  font-size: 15px;
}
.tree-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--rule-soft);
  border-bottom: 1px solid var(--rule);
  font-weight: 600; font-size: 14px;
}
.tree-bar .tree-root-icon { width: 14px; height: 14px; border-radius: 3px; background: var(--green); }
.tree-body { padding: 10px 10px 14px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 21px; border-left: 1px dotted #A9C3B3; }
.tree li { animation: tree-row .38s ease both; animation-delay: calc(var(--i, 0) * 55ms + 150ms); }
@keyframes tree-row { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.tree summary, .tree .leaf {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px; border-radius: 5px;
  line-height: 1.35; color: var(--ink); text-decoration: none;
}
.tree summary { cursor: pointer; list-style: none; font-weight: 600; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before {
  content: "+"; flex: none;
  display: inline-grid; place-items: center;
  width: 13px; height: 13px;
  border: 1px solid #8DAE9A; border-radius: 2px;
  font-size: 11px; line-height: 1; font-weight: 600; color: var(--green);
  background: #fff;
}
.tree details[open] > summary::before { content: "−"; }
.tree summary:hover, .tree a.leaf:hover { background: var(--rule-soft); }
.tree .leaf { font-weight: 400; padding-left: 12px; }
.tree .leaf::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); opacity: .55; }
.tree a.leaf:hover::before { opacity: 1; }

/* ---------- Список услуг строками книги ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row {
  position: relative;
  display: grid; grid-template-columns: minmax(210px, 1fr) 2fr auto; gap: 28px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.row:hover { background: #EDF4EF; box-shadow: -16px 0 0 #EDF4EF, 16px 0 0 #EDF4EF; }
.row h3 a { color: var(--ink); text-decoration: none; }
.row h3 a::after { content: ""; position: absolute; inset: 0; }
.row p { margin: 0; color: var(--muted); }
.row .more { font-size: 15px; font-weight: 600; color: var(--green); white-space: nowrap; }
.row:hover .more { text-decoration: underline; }

/* ---------- Абзац-позиция ---------- */
.statement { font-size: 21px; line-height: 1.6; max-width: 36em; }
.statement p:last-child { margin-bottom: 0; }

/* ---------- Шаги: номера в полевой колонке ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 22px 0; border-bottom: 1px solid var(--rule); max-width: 46em; }
.step:first-child { border-top: 1px solid var(--rule); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 18px;
  left: calc(-1 * (var(--margin-col) + var(--gutter)));
  width: var(--margin-col); padding-right: 22px; text-align: right;
  font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }

/* ---------- Перечни ---------- */
.cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; border-top: 1px solid var(--rule); }
.cols li { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.defs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 52em; }
.defs li { display: grid; grid-template-columns: 15em 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.defs b { font-weight: 600; }
.defs span { color: var(--muted); }
.plain { margin: 0; padding-left: 1.2em; max-width: 46em; }
.plain li { margin-bottom: 8px; }
.prose { max-width: 42em; }

/* ---------- Вопросы ---------- */
.faq { border-top: 1px solid var(--rule); max-width: 50em; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 600; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-weight: 500; font-size: 24px; line-height: 1; color: var(--green); }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 0 22px; color: var(--muted); max-width: 42em; }
.faq .answer p:last-child { margin: 0; }

/* ---------- Блок связи ---------- */
.contact {
  background: var(--green-deep); color: #E3EEE7;
  border-radius: 16px; padding: 52px 48px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
}
.contact h2 { color: #fff; }
.contact p { color: #C3D6CA; margin: 0; max-width: 32em; }
.contact .contact-action { justify-self: start; }
.contact .contact-hint { margin-top: 14px; font-size: 14px; color: #A9C2B2; }

/* ---------- Страницы услуг ---------- */
.crumbs { padding: 26px 0 0; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.page-hero { padding: 36px 0 64px; }
.page-hero h1 { max-width: 18ch; font-size: clamp(34px, 4.6vw, 54px); }
.related { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.related a { font-weight: 600; }

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 76px; padding: 40px 0 48px; font-size: 15px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h3 { font-size: 15px; color: var(--ink); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--green); }
.footer-mail { font-size: 14px; }
.copy { margin-top: 28px; font-size: 13px; }

/* ---------- 404 ---------- */
.notfound { padding: 96px 0; max-width: 34em; }
.notfound p { color: var(--muted); font-size: 19px; margin: 20px 0 30px; }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
  :root { --margin-col: 56px; --gutter: 24px; }
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 52px 0 64px; }
  .contact { grid-template-columns: 1fr; padding: 40px 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .header-inner .btn { margin-left: auto; }
}
@media (max-width: 680px) {
  :root { --margin-col: 0px; --gutter: 22px; }
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .wrap.ledger { padding-left: calc(18px + 22px); }
  .ledger::before { left: 18px; width: 4px; }
  .lead, .statement { font-size: 18px; }
  .section { padding: 56px 0; }
  .row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .row:hover { box-shadow: -10px 0 0 #EDF4EF, 10px 0 0 #EDF4EF; }
  .step { padding-left: 42px; }
  .step::before { left: 0; width: auto; padding: 0; font-size: 24px; top: 20px; }
  .cols { grid-template-columns: 1fr; }
  .defs li { grid-template-columns: 1fr; gap: 4px; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 12px; }
  .header-inner .btn span { display: none; }
  .header-inner .btn { padding: 10px; }
  .contact { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
