/* Каркас лендинга поверх theme.css (это app.css панели): палитры, темы,
   карточки, кнопки, бейджи и чипы берутся оттуда. Здесь только то, чего в
   панели нет: широкая колонка сайта, шапка-навигация, сетки и попап оформления. */

.site {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 600px) {
  .site {
    padding: 0 16px 40px;
  }
}

/* Шапка, содержимое и подвал — колонка .site; обёртка <main> повторяет её
   раскладку, иначе отступы между секциями поменяются. */
.site__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html {
  scroll-behavior: smooth;
}

/* ------------------------------------------------------------------ шапка */

.site__nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}

.site__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site__brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accent-ring);
  object-fit: cover;
}

.site__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  flex: 1;
  min-width: 0;
}

.site__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
}

.site__links a:hover {
  color: var(--accent);
}

.site__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.btn--icon {
  padding: 6px 9px;
  line-height: 1;
}

/* Попап оформления под иконкой: аватар, палитра и тема. Якорь — сама шапка
   (.site__nav sticky, то есть уже позиционирован): у иконки справа стоит
   «Войти», и попап шириной 300 px, привязанный к ней, на узком экране ушёл бы
   за левый край. */
.site__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(300px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.site__menu[hidden] {
  display: none;
}

/* Образцы аватара из панели (72 px) в попап не влезают — уменьшаем. */
.site__menu .mascot-picker {
  gap: 6px;
}

.site__menu .mascot-picker__item {
  padding: 8px 4px;
  gap: 4px;
}

.site__menu .mascot-picker__img {
  width: 56px;
  height: 56px;
}

.site__menu .mascot-picker__name {
  font-size: 10px;
}

.site__menu .palette {
  gap: 10px;
}

.site__menu .palette__dot {
  width: 34px;
  height: 34px;
}

@media (max-width: 860px) {
  .site__links {
    display: none;
  }

  .site__nav {
    justify-content: space-between;
  }
}

/* ------------------------------------------------------------------ hero */

.site__hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 0 8px;
}

@media (min-width: 900px) {
  .site__hero {
    flex-direction: row;
    align-items: center;
    gap: 32px;
    padding: 56px 0 16px;
  }

  .site__hero-text {
    flex: 1;
    min-width: 0;
  }

  .site__hero-art {
    flex: 0 0 340px;
  }
}

.site__hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.site__lead {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
  /* last-line minimisation: без него короткий «хвост» из одного-двух слов */
  text-wrap: pretty;
}

/* Вступительный абзац раздела: 70ch держали текст на половине колонки и рвали
   его на короткие строки. Карточки и таблица ниже идут во всю ширину .site —
   абзац тоже, иначе блок выглядит обрезанным слева. */
.site__lead--tight {
  margin: 0 0 20px;
  max-width: none;
}

.site__hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.site__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.site__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* ------------------------------------------------------------------ секции */

.site__section {
  padding: 56px 0;
  border-top: 1px solid var(--border-soft);
  /* Липкая шапка иначе накрывает заголовок раздела при переходе по #ссылке. */
  scroll-margin-top: 68px;
}

.site__h2 {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 680;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.site__h3 {
  font-size: 15px;
  font-weight: 650;
  color: var(--accent);
  margin: 28px 0 12px;
}

.site__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.site__p {
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0;
}

.site__inline-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.site__inline-cta .site__p {
  margin: 0;
}

/* Верхний блок «протестируйте до оплаты»: без линии сверху — он продолжает герой,
   а не начинает новый раздел. Карточки одной высоты, кнопки прижаты вниз. */
.site__section--lead {
  border-top: 0;
  padding-top: 24px;
}

.site__offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.site__offer .card__title {
  font-size: 17px;
  line-height: 1.3;
}

/* Бейдж в карточке — не на всю ширину: .card__head — flex-колонка. */
.site__offer .badge {
  align-self: flex-start;
}

.site__offer .site__inline-cta {
  margin-top: auto;
}

.site__offer .row__hint {
  margin: 0;
  max-width: 34ch;
}

/* ------------------------------------------------------------------ аккордеон */

.site__settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site__details {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 14px;
}

.site__details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}

.site__details summary::-webkit-details-marker {
  display: none;
}

.site__details summary::after {
  content: "▾";
  float: right;
  color: var(--dim);
  transition: transform 0.15s ease;
}

.site__details[open] summary::after {
  transform: rotate(180deg);
}

.site__details .features,
.site__details .card__desc {
  margin-top: 10px;
}

.site__details .card__desc {
  white-space: normal;
}

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

.plans {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.plans__table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13.5px;
}

/* Первый столбец закреплён: при горизонтальной прокрутке подписи строк и
   заголовок группы остаются слева, иначе непонятно, что за строка. */
.plans__corner {
  width: 34%;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.plans__corner-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.plans__head {
  padding: 16px 14px;
  text-align: left;
  vertical-align: top;
  font-weight: 500;
  border-left: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border);
}

.plans__head--pick {
  background: var(--accent-glow);
  border-bottom-color: var(--accent);
}

.plans__head .badge {
  align-self: flex-start;
  margin-bottom: 8px;
}

/* Пустые места под бейдж и сроки: держат колонки на одной высоте. */
.plans__badge--empty {
  visibility: hidden;
}

.plans__terms {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.plans__term {
  white-space: nowrap;
}

.plans__term--save {
  color: var(--accent);
}

.plans__title {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 6px;
}

.plans__price {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.plans__price small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.plans__cta {
  margin-top: 12px;
  padding: 8px 12px;
  font-size: 13px;
}

.plans__group th {
  padding: 18px 14px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

/* Заголовок группы — sticky внутри ячейки на всю ширину таблицы: при
   прокрутке он остаётся у левого края, как и подписи строк. */
.plans__group-title {
  position: sticky;
  left: 14px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
}

.plans__label {
  padding: 9px 14px;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  left: 0;
  /* Ячейки идут в разметке после подписи и легли бы поверх неё при
     прокрутке — подпись поднимаем над ними. */
  z-index: 1;
  background: var(--surface);
}

.plans__cell {
  padding: 9px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
  border-left: 1px solid var(--border-soft);
}

.plans__table tbody tr:last-child .plans__label,
.plans__table tbody tr:last-child .plans__cell {
  border-bottom: none;
}

.plans__col--pick {
  background: var(--accent-glow);
}

.plans__yes {
  color: var(--success);
  font-weight: 700;
}

.plans__no {
  color: var(--dim);
}

.plans__value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plans__table tbody tr:hover .plans__label {
  color: var(--text);
}

.plans__error {
  padding: 18px;
}

.plans__hint {
  display: none;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--dim);
}

@media (max-width: 760px) {
  .plans__hint {
    display: block;
  }

  /* Узкий первый столбец: на телефоне широкий закреплённый угол съел бы
     половину экрана. */
  .plans__corner,
  .plans__label {
    width: 150px;
    min-width: 150px;
  }
}

/* ------------------------------------------------------------------ шаги */

.site__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  color: var(--muted);
}

.site__steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* ------------------------------------------------------------------ финал и подвал */

.site__final {
  align-items: flex-start;
}

.site__final .site__cta {
  margin-top: 4px;
}

.site__footer {
  margin-top: 24px;
  padding: 40px 0 28px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--muted);
}

/* Колонки: описательная шире, ссылочные уже. */
.site__footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.site__footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 34ch;
}

/* Название и заголовки колонок — одна строка одинаковой высоты: без этого
   описание слева и ссылки справа встают на разной линии. */
.site__footer-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 18px;
  color: var(--text);
}

.site__footer-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.site__footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site__footer-title {
  margin: 0;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.site__footer-col a {
  width: fit-content;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site__footer-col a:hover {
  color: var(--accent);
}

.site__footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--dim);
}

.site__footer-bottom a {
  color: var(--muted);
  text-decoration: none;
}

.site__footer-bottom a:hover {
  color: var(--accent);
}

/* Реквизиты исполнителя: ЮKassa требует их на сайте. Строка скрыта, пока
   владелец не задал значения в окружении. */
.site__footer-legal {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}

.site__footer-legal a {
  color: var(--muted);
  text-decoration: none;
}

.site__footer-legal a:hover {
  color: var(--accent);
}

/* На телефоне бренд во всю ширину, ссылочные колонки — в две рядом. */
@media (max-width: 760px) {
  .site__footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .site__footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }
}

/* ------------------------------------------------------------------ кабинет */

#view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
}

.row__label .badge {
  margin-left: 8px;
  vertical-align: middle;
}

/* .btn в панели — это <button>; на сайте те же кнопки бывают ссылками,
   поэтому снимаем подчёркивание и держим их по центру текста. */
a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

/* .card — flex-колонка: кнопка внутри иначе растянется на всю ширину. */
#view .card > .btn,
.site__details + .btn {
  align-self: flex-start;
}

/* В панели 4 плитки умещаются в 620px; на телефоне сайта — две в ряд. */
@media (max-width: 560px) {
  .kpi {
    grid-template-columns: repeat(2, 1fr);
  }
}

.site__login-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

.site__error {
  color: var(--danger);
  font-size: 13px;
}

.site__stat-locked {
  opacity: 0.55;
}

.chart-wrap {
  position: relative;
  height: 160px;
  margin-top: 4px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--accent);
  overflow: visible;
}

.site__chart-label {
  font-size: 10.5px;
  color: var(--dim);
}

.site__actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.site__date {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.site__date input {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
}

/* ---------------------------------------------------------- рисунки блоков */

/* Иллюстрации карточек «Что работает уже сейчас»: полоса-рисунок в шапке
   карточки. Рисунок — inline SVG, спрайт с <symbol> лежит в index.html, поэтому
   файлов-картинок под 6 палитр × 2 темы нет, а syncArt() его не трогает. */
.art-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.card--art {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.card__art {
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}

.card__art svg {
  display: block;
  width: 100%;
  height: auto;
}

.card--art .card__head {
  padding: 13px 16px 0;
}

.card--art .card__desc {
  padding: 8px 16px 16px;
}