/* ==========================================================================
   TG Lead Radar — публичный лендинг (public/index.php).

   Подключается ПОСЛЕ app.css и только дополняет его: токены, сброс, кнопки
   и поля живут там. Здесь нет ни одного «сырого» hex-цвета кроме локальных
   переменных этого файла — всё остальное берётся из :root дизайн-системы.

   CSP: inline-стилей нет нигде, поэтому любые состояния (появление секций,
   открытое меню, «прилипшая» шапка) переключаются классами из landing.js.
   ========================================================================== */

.lp-body {
  --lp-header-h: 74px;          /* высота липкой шапки, нужна для scroll-margin */
  --lp-gutter: 20px;
  --lp-max: 1288px;             /* 1248 контента + отступы, как в макете */
  --lp-cta-ink: rgba(255, 255, 255, .82);

  background: var(--surface);
  /* Страховка от горизонтального скролла. Именно clip, а не hidden:
     hidden сделал бы <body> контейнером прокрутки и сломал липкую шапку. */
  overflow-x: clip;
}

html { scroll-behavior: smooth; }

/* --------------------------------------------------------------------------
   Раскладка
   -------------------------------------------------------------------------- */

.lp-container {
  width: 100%;
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: 0 var(--lp-gutter);
}

/* landing.js прячет ссылку «Войти» атрибутом hidden — display из медиазапросов
   не должен его перебивать. */
.lp-body [hidden] { display: none !important; }

.lp-section {
  padding: 96px 0;
  background: var(--surface);
}

.lp-section--muted { background: var(--surface-muted); }

/* Якорная прокрутка не должна прятать заголовок под шапкой. */
.lp-section,
.lp-facts,
.lp-cta,
#top { scroll-margin-top: calc(var(--lp-header-h) + 18px); }

.lp-head {
  max-width: 720px;
  margin: 0 auto 52px;
  text-align: center;
}

.lp-head h2 {
  margin: 12px 0 14px;
  font-size: clamp(24px, 3.1vw, 30px);
  letter-spacing: -.02em;
}

.lp-head__sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.6;
}

.lp-grid {
  display: grid;
  gap: 20px;
}

.lp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --------------------------------------------------------------------------
   Skip-link
   -------------------------------------------------------------------------- */

.lp-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: top var(--t) var(--ease);
}

.lp-skip:focus { top: 12px; color: #fff; text-decoration: none; }

/* Цель skip-link фокусируема программно; рамка вокруг всего <main> не нужна. */
#main:focus { outline: none; }

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */

.lp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.lp-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-xs);
}

.lp-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--lp-header-h);
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
  flex: 0 0 auto;
}

.lp-brand:hover { color: var(--ink); text-decoration: none; }

.lp-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(35, 140, 223, .3);
}

.lp-brand__name { font-size: 17px; }

.lp-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.lp-nav__link,
.lp-nav__login {
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  transition: color var(--t-fast) var(--ease);
}

.lp-nav__link:hover,
.lp-nav__login:hover { color: var(--brand); text-decoration: none; }

.lp-nav__login { color: var(--ink); }

.lp-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.lp-header__cta { padding: 10px 18px; }

/* Короткая подпись кнопки — только для узких экранов. */
.lp-header__cta .lp-cta-short { display: none; }

.lp-burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.lp-burger:hover { background: var(--surface-muted); color: var(--ink); box-shadow: none; }
.lp-burger__icon--close { display: none; }

/* --------------------------------------------------------------------------
   Герой
   -------------------------------------------------------------------------- */

.lp-hero {
  padding: 76px 0 96px;
  background: linear-gradient(135deg, var(--brand-softer) 0%, var(--brand-soft) 100%);
  border-bottom: 1px solid var(--line);
}

.lp-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: center;
}

.lp-pill-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  box-shadow: var(--shadow-xs);
}

.lp-pill-live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: lr-pulse-ring 2.4s var(--ease) infinite;
}

.lp-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(31px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.lp-hero__line { display: block; }

.lp-hero__sub {
  margin: 0 0 32px;
  max-width: 52ch;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.62;
}

.lp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.lp-btn-lg {
  padding: 13px 22px;
  font-size: 15px;
  border-radius: var(--r-md);
  min-height: 48px;
}

.lp-hero__trust {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Макет продукта. Чистая вёрстка: никаких данных с сервера. */
.lp-hero__figure { margin: 0; }

.lp-mock {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.lp-mock__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 4px 16px;
}

.lp-mock__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.lp-mock__dot--red   { background: var(--red); }
.lp-mock__dot--amber { background: var(--orange); }
.lp-mock__dot--green { background: var(--green); }

.lp-mock__title {
  margin-left: 8px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-mock__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.lp-mock__metric {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-sunken);
}

.lp-mock__value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.lp-mock__label {
  display: block;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 11px;
}

.lp-mock__leads {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.lp-mock__lead {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.lp-mock__lead:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.lp-mock__leadText { min-width: 0; flex: 1 1 auto; }

.lp-mock__leadMsg {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.lp-mock__leadMeta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.lp-mark {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.lp-score {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.lp-hero__caption {
  margin: 14px 2px 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Карточки (возможности, шаги, сценарии)
   -------------------------------------------------------------------------- */

.lp-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease);
}

.lp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.lp-card h3 { margin: 0 0 10px; font-size: 18px; }

.lp-card__text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
}

.lp-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

/* Шаги 01/02/03 */
.lp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lp-step {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--r-xl);
}

.lp-step__num {
  display: block;
  margin-bottom: 18px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.lp-step__bar {
  display: block;
  height: 8px;
  margin-top: auto;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
}

.lp-step:nth-child(1) .lp-step__bar { width: 34%; }
.lp-step:nth-child(2) .lp-step__bar { width: 67%; }
.lp-step:nth-child(3) .lp-step__bar { width: 100%; }

/* Сценарии */
.lp-scenario {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--r-xl);
}

.lp-scenario__label {
  margin: 0 0 16px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lp-scenario--muted .lp-scenario__label { color: var(--ink-faint); }

.lp-scenario__quote {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -.01em;
}

.lp-scenario__tag { margin: 0 0 14px; }

/* --------------------------------------------------------------------------
   Тёмная полоса с числами
   -------------------------------------------------------------------------- */

.lp-facts {
  padding: 84px 0;
  background: var(--night);
  color: #fff;
}

.lp-facts__title {
  margin: 0 0 48px;
  text-align: center;
  font-size: clamp(23px, 3vw, 30px);
  color: #fff;
}

.lp-facts__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
}

.lp-fact { padding-left: 16px; border-left: 2px solid var(--night-line); }

.lp-fact__value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #fff;
}

.lp-fact__label {
  margin: 8px 0 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.lp-fact__note {
  display: block;
  margin-top: 5px;
  color: var(--night-ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Тарифы
   -------------------------------------------------------------------------- */

.lp-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.lp-plan {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: var(--r-xl);
}

.lp-plan--accent {
  border-color: var(--brand);
  box-shadow: 0 18px 44px rgba(35, 140, 223, .16);
}

.lp-plan__kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lp-plan h3 { margin: 0 0 6px; font-size: 22px; }

.lp-plan__price {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.lp-plan__price--soft { font-size: 17px; color: var(--ink-muted); font-weight: 600; }

.lp-plan__priceNote {
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 600;
}

.lp-plan__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 13px;
}

.lp-plan__list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  line-height: 1.5;
}

.lp-plan__list svg { flex: 0 0 auto; margin-top: 1px; color: var(--brand); }

.lp-plan__note { margin: 0 0 22px; }

.lp-plan__cta { align-self: flex-start; margin-top: auto; }

/* --------------------------------------------------------------------------
   CTA-полоса
   -------------------------------------------------------------------------- */

.lp-cta {
  padding: 92px 0;
  background: var(--brand-deep);
  color: #fff;
}

.lp-cta__inner {
  max-width: 760px;
  text-align: center;
}

.lp-cta__title {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(24px, 3.2vw, 32px);
}

.lp-cta__sub {
  margin: 0 0 30px;
  color: var(--lp-cta-ink);
  font-size: 16px;
  line-height: 1.6;
}

.lp-cta .lp-cta__btn {
  background: #fff;
  color: var(--brand-deep);
  border-color: #fff;
}

.lp-cta .lp-cta__btn:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.lp-cta__note {
  margin: 18px 0 0;
  color: var(--lp-cta-ink);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */

.lp-footer {
  padding: 72px 0 40px;
  background: var(--night);
  color: var(--night-ink);
}

.lp-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 48px;
}

.lp-brand--dark { color: #fff; }
.lp-brand--dark:hover { color: #fff; }
.lp-brand--dark .lp-brand__mark { box-shadow: none; }

.lp-footer__tagline {
  margin: 18px 0 0;
  max-width: 34ch;
  color: var(--night-ink);
  font-size: 13px;
  line-height: 1.6;
}

.lp-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.lp-footer__colTitle {
  margin: 0 0 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lp-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.lp-footer__col a {
  color: var(--night-ink);
  font-size: 14px;
  transition: color var(--t-fast) var(--ease);
}

.lp-footer__col a:hover { color: #fff; text-decoration: none; }

.lp-footer__divider {
  margin: 44px 0 24px;
  border-top-color: var(--night-line);
}

.lp-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  justify-content: space-between;
}

.lp-footer__copy,
.lp-footer__legal {
  margin: 0;
  color: var(--night-ink);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Появление секций при скролле.
   Классы навешивает landing.js; без JS и при prefers-reduced-motion
   контент виден сразу, потому что правила действуют только внутри .lp-anim.
   -------------------------------------------------------------------------- */

.lp-anim .reveal { opacity: 0; }

.lp-anim .reveal.is-visible {
  animation: lr-fade-up var(--t-slow) var(--ease-out) both;
}

/* Ступенчатая задержка — максимум шесть шагов по 50 мс. */
.lp-anim .lp-stagger > .reveal:nth-child(1).is-visible { animation-delay: 0ms; }
.lp-anim .lp-stagger > .reveal:nth-child(2).is-visible { animation-delay: 50ms; }
.lp-anim .lp-stagger > .reveal:nth-child(3).is-visible { animation-delay: 100ms; }
.lp-anim .lp-stagger > .reveal:nth-child(4).is-visible { animation-delay: 150ms; }
.lp-anim .lp-stagger > .reveal:nth-child(5).is-visible { animation-delay: 200ms; }
.lp-anim .lp-stagger > .reveal:nth-child(6).is-visible { animation-delay: 250ms; }

/* --------------------------------------------------------------------------
   Адаптив: 1180 / 900 / 640 из брифа плюс правка героя на планшете.
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .lp-nav { gap: 20px; }
  .lp-hero__inner { gap: 36px; }
  .lp-section { padding: 80px 0; }
}

@media (max-width: 1000px) {
  .lp-hero { padding: 56px 0 72px; }

  .lp-hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .lp-hero__sub { max-width: none; }
  .lp-hero__figure { max-width: 640px; }
}

@media (max-width: 900px) {
  .lp-body { --lp-header-h: 62px; }

  /* Компактная шапка: якоря уезжают в выпадающее меню. */
  .lp-burger { display: inline-flex; }

  .lp-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--lp-gutter) 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--t) var(--ease), transform var(--t) var(--ease),
                visibility var(--t) var(--ease);
  }

  .lp-nav-open .lp-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .lp-nav__link,
  .lp-nav__login {
    display: flex;
    align-items: center;
    min-height: 46px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }

  .lp-nav__login { border-bottom: 0; color: var(--brand); }

  .lp-nav-open .lp-burger__icon--open { display: none; }
  .lp-nav-open .lp-burger__icon--close { display: block; }

  .lp-section { padding: 64px 0; }
  .lp-head { margin-bottom: 40px; }
  .lp-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-facts { padding: 64px 0; }
  .lp-facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .lp-plans { grid-template-columns: minmax(0, 1fr); }
  .lp-cta { padding: 72px 0; }

  .lp-footer__top { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 640px) {
  .lp-body { --lp-gutter: 16px; }

  .lp-hero { padding: 40px 0 56px; }
  .lp-hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .lp-hero__line { display: inline; }   /* на телефоне текст ломается сам */
  .lp-hero__sub { font-size: 15px; }

  .lp-hero__actions { flex-direction: column; align-items: stretch; }
  .lp-hero__actions .lp-btn-lg { width: 100%; }

  .lp-mock { padding: 14px; }
  .lp-mock__metrics { gap: 8px; }
  .lp-mock__metric { padding: 11px; }
  .lp-mock__value { font-size: 21px; }
  .lp-mock__lead { padding: 12px; gap: 10px; }
  .lp-mock__leadMsg { font-size: 13px; }

  .lp-section { padding: 52px 0; }
  .lp-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .lp-card { padding: 22px; }
  .lp-step, .lp-scenario, .lp-plan { padding: 24px; }
  .lp-plan__cta { align-self: stretch; }

  .lp-facts__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lp-fact__value { font-size: 34px; }

  .lp-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .lp-footer { padding: 52px 0 32px; }
}

@media (max-width: 460px) {
  /* Самый узкий сценарий (360px): в шапке остаётся короткая подпись кнопки. */
  .lp-header__inner { gap: 10px; }
  .lp-brand__name { font-size: 15px; }
  .lp-header__cta { padding: 9px 14px; font-size: 13px; }
  .lp-header__cta .lp-cta-full { display: none; }
  .lp-header__cta .lp-cta-short { display: inline; }

  .lp-footer__cols { grid-template-columns: minmax(0, 1fr); }

  /* На экранах уже 360px (старые Android, iPhone SE в увеличенном шрифте)
     название бренда обязано ужиматься, иначе шапка выносит страницу вбок. */
  .lp-brand { min-width: 0; flex: 0 1 auto; }
  .lp-brand__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
