/* ============ Выставил — дизайн-система ============
   Светлый премиум: много воздуха, один акцент (индиго), крупная типографика.
   Никакого фреймворка: токены + компоненты, mobile-first. */

:root {
  --accent: #2C46C7;
  --accent-hover: #2338A6;
  --accent-soft: #EDF0FC;
  --ok: #1F9D61;
  --ok-soft: #E7F6EE;
  --warn: #B4540A;
  --warn-soft: #FCF0E4;
  --danger: #C0392B;
  --danger-soft: #FBEAE8;
  --ink: #171B26;
  --ink-2: #4A5061;
  --ink-3: #6C7285;
  --line: #E5E7EF;
  --bg: #FFFFFF;
  --bg-soft: #F6F7FB;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 10px 34px rgba(23, 27, 38, .08);
  --shadow-s: 0 2px 10px rgba(23, 27, 38, .06);
  --font: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65;
  color: var(--ink); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
body.menu-open { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5.4vw, 46px); }
h2 { font-size: clamp(23px, 3.4vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: var(--radius-s);
  font: 600 15.5px var(--font); cursor: pointer; text-decoration: none !important;
  border: 1.5px solid transparent; transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 8px 22px rgba(44, 70, 199, .30); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-yandex { background: #FC3F1D; color: #fff; }
.btn-yandex:hover { background: #E03113; box-shadow: 0 8px 22px rgba(252, 63, 29, .28); }
.btn-lg { min-height: 54px; padding: 14px 30px; font-size: 17px; border-radius: 12px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---------- Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 26px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font: 800 20px var(--font); color: var(--ink); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 22px; margin-left: 6px; }
.nav a { color: var(--ink-2); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--accent); text-decoration: none; }
.header-cta { margin-left: auto; display: flex; gap: 10px; }
.burger { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }
.mobile-menu { display: none; }

@media (max-width: 860px) {
  .nav, .header-cta { display: none; }
  .burger { display: block; }
  .menu-open .mobile-menu { display: flex; flex-direction: column; border-top: 1px solid var(--line); background: #fff; padding: 8px 20px 16px; }
  .mobile-menu a { padding: 11px 0; border-bottom: 1px solid var(--bg-soft); color: var(--ink); font-size: 16px; }
  .menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .burger span:nth-child(2) { opacity: 0; }
  .menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Крошки, флеши ---------- */
.crumbs { padding: 14px 0 0; font-size: 13.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--accent); }
.crumbs-sep { color: var(--line); }
.flash { margin: 14px 0 0; padding: 13px 18px; border-radius: var(--radius-s); font-weight: 500; }
.flash-success { background: var(--ok-soft); color: #14603C; }
.flash-error { background: var(--danger-soft); color: #8E2A1F; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero .lead { font-size: 19px; color: var(--ink-2); max-width: 30em; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0 26px; }
.badge { background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 13.5px; color: var(--ink-3); margin-top: 12px; }

/* карточка-стартер: ИНН → организация → в генератор */
.starter { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.starter h3 { margin-bottom: 4px; }
.starter .hint { color: var(--ink-3); font-size: 14px; margin-bottom: 14px; }
.starter-row { display: flex; gap: 10px; }
.starter-row input { flex: 1; }
.starter-found { margin-top: 14px; padding: 13px 16px; border-radius: var(--radius-s); background: var(--ok-soft); color: #14603C; font-size: 14.5px; display: none; }
.starter-found.on { display: block; }
.starter-found b { display: block; font-size: 15.5px; }
.starter-demo { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- Формы ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-s); font: 400 15.5px var(--font); color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,70,199,.12); }
.field { margin-bottom: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-s); }
.form-section-title { font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inn-row { display: flex; gap: 10px; align-items: flex-end; }
.inn-row .field { flex: 1; margin-bottom: 0; }

/* ---------- Секции лендинга ---------- */
.section { padding: 54px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin-bottom: 34px; }
.section-head p { color: var(--ink-2); font-size: 17px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .cards-3 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-s); }
.card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.card h3 { font-size: 17.5px; margin-bottom: 6px; }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 22px 22px 22px 64px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 20px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 15px; }
.step b { display: block; margin-bottom: 4px; }
.step span { color: var(--ink-2); font-size: 14.5px; }

/* ---------- Тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
.plan { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.plan-hot { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.plan-hot .plan-tag { position: absolute; top: -13px; left: 24px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.plan h3 { font-size: 20px; }
.plan-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.plan-price small { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.plan-sub { color: var(--ink-3); font-size: 14px; margin-bottom: 18px; }
.plan ul { list-style: none; margin: 0 0 22px; padding: 0; flex: 1; }
.plan li { padding: 7px 0 7px 28px; position: relative; font-size: 15px; color: var(--ink-2); }
.plan li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 15px; height: 15px;
  background: var(--ok-soft) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231F9D61" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="m5 13 4 4 10-11"/></svg>') center/9px no-repeat; border-radius: 50%; }
.plan li.no::before { background: var(--bg-soft) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="%237A8093" stroke-width="3" stroke-linecap="round"><path d="M6 12h12"/></svg>') center/9px no-repeat; }
.plan li.no { color: var(--ink-3); }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 10px; background: #fff; }
.faq-item summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative; padding-right: 46px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--ink-3); transition: transform .15s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--accent); }
.faq-item p { padding: 0 20px 16px; margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---------- Таблицы (кабинет, блог) ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); }
table.list th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
table.list td { padding: 13px 16px; border-bottom: 1px solid var(--bg-soft); font-size: 15px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #FAFBFE; }
.table-wrap table:not(.list) { border-collapse: collapse; margin: 0 0 1.2em; }
.table-wrap table:not(.list) th, .table-wrap table:not(.list) td { border: 1px solid var(--line); padding: 8px 13px; font-size: 15px; text-align: left; }
.table-wrap table:not(.list) th { background: var(--bg-soft); }

.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.tag-draft { background: var(--bg-soft); color: var(--ink-2); }
.tag-sent { background: var(--accent-soft); color: var(--accent); }
.tag-paid { background: var(--ok-soft); color: var(--ok); }
.tag-overdue { background: var(--danger-soft); color: var(--danger); }
.tag-cancelled { background: var(--bg-soft); color: var(--ink-3); }

/* ---------- Кабинет ---------- */
.lk-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 28px 0 20px; }
.lk-head h1 { font-size: 28px; margin: 0; }
.lk-head .btn { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; max-width: 560px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.kpi b { display: block; font-size: 24px; letter-spacing: -.01em; }
.kpi span { color: var(--ink-3); font-size: 13.5px; }
.kpi.bad b { color: var(--danger); }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-2); background: var(--bg-soft); border-radius: var(--radius); }
.empty h3 { margin-bottom: 8px; }

/* позиции счёта */
.items-editor { width: 100%; border-collapse: collapse; }
.items-editor th { font-size: 12.5px; color: var(--ink-3); text-align: left; padding: 4px 8px 6px 0; font-weight: 600; }
.items-editor td { padding: 4px 8px 4px 0; vertical-align: top; }
.items-editor input, .items-editor select { min-height: 42px; }
.item-del { background: none; border: 0; color: var(--ink-3); font-size: 20px; cursor: pointer; padding: 8px 4px; }
.item-del:hover { color: var(--danger); }
.items-total { text-align: right; font-size: 17px; margin: 12px 0 0; }
.items-total b { font-size: 21px; }

/* ---------- Блог ---------- */
.post-list { display: grid; gap: 16px; max-width: 780px; }
.post-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.post-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow-s); }
.post-card h2 { font-size: 19px; margin-bottom: 6px; color: var(--ink); }
.post-card p { color: var(--ink-2); font-size: 15px; margin: 0 0 8px; }
.post-date { color: var(--ink-3); font-size: 13px; }
.article { max-width: 740px; }
.article h1 { margin: 24px 0 10px; }
.article-body h2 { margin-top: 1.6em; }
.article-body h3 { margin-top: 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body blockquote { margin: 1.2em 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.article-body blockquote p { margin: 0; }
.article-cta { margin: 34px 0; padding: 24px 26px; background: var(--accent-soft); border-radius: var(--radius); }
.article-cta b { font-size: 17px; }
.article-cta p { color: var(--ink-2); margin: 6px 0 14px; font-size: 15px; }

/* ---------- Auth ---------- */
.auth-card { max-width: 420px; margin: 48px auto; }
.auth-card .form-card { padding: 32px; }
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-or { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--ink-2); }
.w100 { width: 100%; }

/* ---------- Футер ---------- */
.site-footer { margin-top: 70px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; padding: 40px 20px 26px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-h { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.footer-grid a { display: block; color: var(--ink-2); font-size: 14.5px; padding: 4px 0; }
.footer-grid a:hover { color: var(--accent); }
.footer-note { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; }
.logo-footer { font-size: 18px; }
.footer-bottom { padding: 0 20px 26px; color: var(--ink-3); font-size: 13px; }

@media (max-width: 860px) {
  .hero { padding: 34px 0 10px; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .section { padding: 40px 0; }
}

/* ---------- Мобильные фиксы (приёмка 31.08) ---------- */
@media (max-width: 700px) {
  /* iOS Safari зумит при фокусе, если шрифт < 16px */
  input[type=text], input[type=email], input[type=password], input[type=date], select, textarea { font-size: 16px; }

  /* Редактор позиций: таблица → карточки. Ввод денег в горизонтальном скролле — брак. */
  .items-editor, .items-editor tbody { display: block; width: 100%; }
  .items-editor thead { display: none; }
  .items-editor tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px;
    padding: 14px 0 16px; border-bottom: 1px solid var(--line); position: relative;
  }
  .items-editor td { display: block; width: auto !important; padding: 0; }
  .items-editor td:nth-child(1) { grid-column: 1 / -1; }              /* наименование во всю ширину */
  .items-editor td:nth-child(2)::before { content: "Кол-во"; }
  .items-editor td:nth-child(3)::before { content: "Ед. изм."; }
  .items-editor td:nth-child(4)::before { content: "Цена (с НДС)"; }
  .items-editor td:nth-child(5)::before { content: "НДС"; }
  .items-editor td::before { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
  .items-editor td:nth-child(6) { position: absolute; top: 10px; right: 0; }
  .item-del { font-size: 24px; }
}
@media (max-width: 480px) {
  .starter { padding: 20px; }
  .starter-row { flex-direction: column; }
  .starter-row .btn { width: 100%; }
  .form-card { padding: 16px; }
  .inn-row { flex-direction: column; align-items: stretch; }
  .inn-row .field { margin-bottom: 8px; }
}
@media (max-width: 860px) {
  .mobile-menu a.mm-cta {
    margin-top: 10px; border: 0; border-radius: var(--radius-s); background: var(--accent);
    color: #fff; text-align: center; padding: 13px; font-weight: 600;
  }
}
