/* =====================================================================
   Платформа 3FSOFT — базовые компоненты на СЕМАНТИЧЕСКИХ токенах.
   Используются Go-HTML (публичка/styleguide); те же классы/токены — основа
   для JSX-компонентов (Radix+Tailwind) в lk./admin.
   Компоненты ссылаются ТОЛЬКО на семантику (--brand/--surface/...), не на рампы.
   ===================================================================== */

/* ---------- Кнопки (тач-таргет ≥44px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px; border-radius: var(--radius);
  font: inherit; font-weight: 600; font-size: 15px; border: 1px solid transparent;
  cursor: pointer; transition: all var(--dur) var(--ease); white-space: nowrap;
  text-decoration: none;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); transform: translateY(-1px); }
.btn--accent { background: var(--accent); color: #1a1205; }
.btn--accent:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-text); }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }

/* ---------- Пилюли / бейджи ---------- */
.pill {
  display: inline-flex; align-items: center; padding: 6px 14px;
  border-radius: var(--radius-full); background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text);
}
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--radius-full); font-size: 12px; font-weight: 700; }
.badge--brand   { background: var(--brand-tint);   color: var(--brand-text); }
.badge--accent  { background: var(--accent);        color: #1a1205; }
.badge--success { background: var(--success-tint);  color: var(--success); }
.badge--warning { background: var(--warning-tint);  color: var(--warning); }
.badge--danger  { background: var(--danger-tint);   color: var(--danger); }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .card { backdrop-filter: blur(8px); }

/* ---------- Иконки (Lucide-стиль: currentColor, stroke 2) ---------- */
.ic { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic--sm { width: 18px; height: 18px; } .ic--lg { width: 28px; height: 28px; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.label { font-weight: 600; font-size: 14px; }
.input {
  min-height: 46px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; outline: none; transition: border-color var(--dur) var(--ease);
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.help { font-size: 13px; color: var(--text-muted); }
.error-text { font-size: 13px; color: var(--danger); }

/* ---------- Типизированные callout-блоки (БЗ) ---------- */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  border-left: 4px solid var(--border); background: var(--surface-2); margin: 16px 0; }
.callout--info    { border-left-color: var(--brand);   background: var(--brand-tint); }
.callout--warning { border-left-color: var(--warning); background: var(--warning-tint); }
.callout--danger  { border-left-color: var(--danger);  background: var(--danger-tint); }

/* ---------- Шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar__inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800;
  font-size: 18px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo__mark { width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px; }
.spacer { flex: 1; }

/* ---------- Переключатель темы ---------- */
.theme-toggle { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); display: grid; place-items: center;
  cursor: pointer; transition: all var(--dur) var(--ease); flex: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--brand); }
.theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

/* ---------- Сетки / секции ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.section { padding: 56px 0; }
.section__title { font-size: var(--fs-h2); font-weight: 700; }

/* ---------- Пусто-состояние ---------- */
.empty { text-align: center; padding: 36px 20px; }
.empty__ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; font-size: 28px; }

/* ---------- Hero (маркетинг) ---------- */
.hero { padding: 64px 0; }
.hero h1 { max-width: 18ch; }
.hero__sub { font-size: 19px; color: var(--text-muted); max-width: 52ch; margin-bottom: 28px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Лендинг ---------- */
.section__sub { text-align: center; color: var(--text-muted); max-width: 640px; margin: 8px auto 0; }
.section.lp-alt { background: var(--surface-2); }
/* мягкий hover карточек только на маркетинге (не трогает кабинет) */
body.page-marketing .section .card { transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
body.page-marketing .section .card:hover { transform: translateY(-3px); border-color: var(--brand); }

/* Hero */
.lp-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.lp-checks { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; }
.lp-checks li { display: flex; gap: 10px; align-items: flex-start; }
.lp-checks li .ic { color: var(--accent); flex: none; margin-top: 1px; }

/* Hero-мокап: плавающие бейджи + свечение на тёмном */
.lp-hero__mock { position: relative; padding: 8px 8px 8px 0; }
[data-theme="dark"] .lp-hero__mock::before { content: ""; position: absolute; inset: 6%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--brand) 30%, transparent), transparent 72%);
  filter: blur(26px); z-index: 0; }
.lp-mock { position: relative; z-index: 1; background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-lg); }
.lp-mock__dots { display: flex; gap: 7px; margin-bottom: 14px; }
.lp-mock__dots span { width: 11px; height: 11px; border-radius: 50%; }
.lp-mock__dots span:nth-child(1){ background: var(--danger); }
.lp-mock__dots span:nth-child(2){ background: var(--accent); }
.lp-mock__dots span:nth-child(3){ background: var(--success); }
.lp-mock__row { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.lp-mock__row:last-of-type { border-bottom: 0; }
.lp-mock__row .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.lp-mock__row .v { font-weight: 700; }
.lp-mock__row .v.accent { color: var(--accent); }
.lp-float { position: absolute; z-index: 2; display: inline-flex; gap: 6px; align-items: center;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; }
.lp-float .ic { width: 16px; height: 16px; }
.lp-float--1 { top: 0; right: -2%; color: var(--accent); }
.lp-float--2 { top: 44%; right: -8%; color: var(--brand-text); }
.lp-float--3 { bottom: 4%; right: 6%; color: var(--success); }
@media (prefers-reduced-motion: no-preference) {
  .lp-float { animation: lp-bob 4s ease-in-out infinite; }
  .lp-float--2 { animation-delay: -1.3s; } .lp-float--3 { animation-delay: -2.6s; }
}
@keyframes lp-bob { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-6px); } }

/* «номерок» в карточках workflow */
.lp-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 10px; }
[data-theme="dark"] .lp-num { box-shadow: 0 0 16px color-mix(in oklab, var(--brand) 40%, transparent); }

/* Боль → Решение: карточки с иконками и янтарной стрелкой */
.pains { display: grid; gap: 14px; margin-top: 28px; }
.pain { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 14px; align-items: center; }
.pain__card { display: flex; gap: 12px; align-items: center; padding: 16px 18px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.pain__card--bad { border-left: 3px solid var(--danger); }
.pain__card--good { border-left: 3px solid var(--success); }
.pain__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.pain__ic--bad { background: var(--danger-tint); color: var(--danger); }
.pain__ic--good { background: var(--success-tint); color: var(--success); }
.pain__arrow { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-raised); border: 1px solid var(--border); color: var(--accent); flex: none; margin: 0 auto; }
[data-theme="dark"] .pain__arrow { border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  box-shadow: 0 0 18px color-mix(in oklab, var(--accent) 40%, transparent); }

.lp-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lp-hero .lp-chips { justify-content: flex-start; margin-top: 22px; }
a.pill { text-decoration: none; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
a.pill:hover { border-color: var(--brand); color: var(--brand-text); }

.lp-video { aspect-ratio: 16/9; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-top: 8px; overflow: hidden; }
.lp-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* FAQ на <details> (ноль JS) */
.lp-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; padding: 0 18px; transition: border-color var(--dur) var(--ease); }
.lp-faq details[open] { border-color: var(--brand); }
.lp-faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--brand); font-weight: 800; font-size: 20px; line-height: 1; }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq details p { margin: 0 0 16px; color: var(--text-muted); }

.lead-msg { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; }
.lead-msg--ok { background: var(--success-tint); color: var(--success); }
.lead-msg--err { background: var(--danger-tint); color: var(--danger); }

/* Scroll-reveal — только при включённом JS; без анимации при reduce */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .tariffs { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .lp-hero { grid-template-columns: 1fr; gap: 28px; }
  .lp-hero__mock { max-width: 460px; padding: 8px; }
  .lp-hero .lp-chips { justify-content: center; }
  .lp-float--1 { right: 2%; } .lp-float--2 { right: 0; }
  .pain { grid-template-columns: 1fr; gap: 8px; }
  .pain__arrow { transform: rotate(90deg); margin: 2px auto; }
  :root { --fs-h1: 34px; --fs-h2: 26px; }
}

/* ---------- Doc / инструкции / поддержка / оферта ---------- */
.doc { padding: 40px 0 64px; }
.doc__inner { max-width: 820px; margin: 0 auto; }
.doc h1 { font-size: var(--fs-h2); }
.doc h2 { font-size: var(--fs-h3); margin-top: 1.4em; }
.doc h3 { font-size: var(--fs-h4); margin-top: 1.2em; }
.doc p, .doc li { line-height: 1.6; }
.breadcrumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--text-muted); }

/* Нумерованные шаги настройки */
.steps-list { list-style: none; counter-reset: step; padding: 0; margin: 20px 0; display: grid; gap: 14px; }
.steps-list > li { counter-increment: step; position: relative; padding: 16px 18px 16px 56px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps-list > li::before { content: counter(step); position: absolute; left: 16px; top: 16px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* Пошаговые блоки: номер слева, текст и его скриншоты — справа (как в оригинале) */
.step-list { display: grid; gap: 22px; margin: 22px 0; counter-reset: step; }
.step-row { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; }
.step-row__num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.step-row__body > :first-child { margin-top: 3px; }
.step-row__body p { margin: 0 0 .5em; }

/* Скриншоты-инструкции */
.shot { margin: 12px 0 4px; }
.shot img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: block; }
.shot figcaption { font-size: 13px; color: var(--text-muted); margin-top: 6px; text-align: center; }

/* Карточка поддержки */
.support-card { margin: 22px 0; }
.support-card__row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Прайсинг (тарифы) */
.tariffs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 20px 0; }
.tariff { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.tariff--featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tariff__price { font-size: 26px; font-weight: 800; margin: 6px 0 12px; }
.tariff ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tariff li { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; }
.tariff li::before { content: "✓"; color: var(--success); font-weight: 800; flex: none; }
.trial-note { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius);
  background: var(--brand-tint); color: var(--brand-text); font-weight: 600; font-size: 14px; }

/* Калькулятор Авито */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin: 20px 0; }
.calc__field { margin-bottom: 18px; }
.calc__field label { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.calc__field input[type="range"] { width: 100%; accent-color: var(--brand); height: 6px; }
.calc__out { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline; margin-top: 8px;
  padding-top: 16px; border-top: 1px solid var(--border); }
.calc__result { font-size: 24px; font-weight: 800; color: var(--brand-text); }

/* Реквизиты-футер сайта */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); margin-top: 48px; padding: 32px 0; }
.site-footer__inner { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 24px; align-items: start; }
.site-footer__req p { margin: 0 0 4px; font-size: 13px; line-height: 1.5; }
.site-footer__links { display: flex; flex-direction: column; gap: 8px; }
.site-footer__links a { color: var(--brand-text); font-size: 14px; }

@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .tariffs { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; }
  :root { --fs-h1: 34px; --fs-h2: 26px; }
}

/* --- База знаний /baza/ (P1) --- */
.kb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.kb-card { display: block; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); text-decoration: none; color: var(--text);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.kb-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.kb-card__title { font-size: var(--fs-h4); margin: 0 0 6px; }
.kb-card__desc { margin: 0; font-size: 14px; }

.kb-toc { list-style: none; padding: 0; margin: 24px 0 0; }
.kb-toc__item { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.kb-toc__item + .kb-toc__item { margin-top: 8px; }
.kb-toc__link { font-weight: 600; }
.kb-toc__desc { display: block; font-size: 13px; margin-top: 4px; }

.kb-article { line-height: 1.65; }
.kb-article > :first-child { margin-top: 0; }
.kb-article h1 { font-size: var(--fs-h2); margin: 0 0 .5em; }
.kb-article h2 { font-size: var(--fs-h3); margin: 1.6em 0 .5em; padding-top: .5em; border-top: 1px solid var(--border); }
.kb-article h3 { font-size: var(--fs-h4); margin: 1.3em 0 .4em; }
.kb-article p, .kb-article li { line-height: 1.65; }
.kb-article ul, .kb-article ol { padding-left: 1.4em; }
.kb-article li { margin: .3em 0; }
.kb-article a { color: var(--brand-text); }
.kb-article code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.kb-article pre { background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; }
.kb-article pre code { background: none; padding: 0; }
.kb-article blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--brand);
  background: var(--brand-tint); border-radius: 0 var(--radius) var(--radius) 0; }
.kb-article blockquote p { margin: .3em 0; }
.kb-article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; display: block; overflow-x: auto; }
.kb-article th, .kb-article td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.kb-article th { background: var(--surface-2); font-weight: 600; }

.kb-install { margin: 20px 0; }
