/* Стили ИИ-подбора для лендинга longcatcrm.com.
   Сгенерировано tools/extract-ai-css.mjs из public/styles/global.css —
   руками не править, правки вносить в global.css и перегенерировать.
   Разметка и логика подбора общие с longcatdev, тут только оформление. */

:root {
  --font-body: "PT Sans", Arial, sans-serif;
  --green: #05b86d;
  --text: #444444;
  --muted: #999999;
  --radius: 12px;
}

/* Кнопки на сайте КВАДРАТНЫЕ (решение владельца 22.07.2026) —
   пилюль нет нигде, даже там, где у Тильды был радиус 30px */
.button-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 44px;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease-in-out;
}

.button-green:hover {
  background: #069a5c;
}

/* кнопки и плитки кейсов внутри колонки — не текстовые ссылки */
.article__body a.button-green,
.article__body a.outline-button,
.article__body a.case-tile {
  text-decoration: none;
}

.article__body a.button-green {
  color: #fff;
}

@supports not selector(::-webkit-scrollbar) {
.toc,
  .ai-match__result {
    scrollbar-width: thin;
    scrollbar-color: #c9c9cd transparent;
  }
}

.cta718__agree {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 18px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}

.cta718__agree input {
  margin-top: 2px;
  accent-color: var(--green);
}

.cta718__agree a {
  color: inherit;
  text-decoration: underline;
}

/* После успешной отправки от формы остаётся только зелёная плашка:
   поля, подпись и галочка согласия прячутся классом is-sent (атрибут
   hidden не работал — его перебивал display: flex строки полей) */
.ai-match__lead.is-sent .ai-match__contact-row,
.ai-match__lead.is-sent .ai-match__lead-hint,
.ai-match__lead.is-sent .ai-match__agree {
  display: none;
}

/* Тот же непропускаемый успех у формы контактов в ИИ-подборе */
.ai-match__note.is-done:not(:empty) {
  background: var(--green);
  border-left-color: #059357;
  color: #fff;
  font-weight: 600;
}

.ai-match__note.is-done:not(:empty)::before {
  content: '✓ ';
}

/* Приглашение к ИИ-подбору: чистый текст без подложки + зелёная кнопка */
.ai-match-invite {
  margin-bottom: 32px;
}

.ai-match-invite__text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
}

/* Кликабельная фраза-подсказка: открывает попап с видео-примером.
   Именно <a>, не <button>: кнопка — атомарный inline-блок, и запятая
   после неё отрывается на новую строку. */
.ai-match-invite__hl {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dotted var(--green);
  cursor: pointer;
}

.ai-match-invite__hl:hover {
  border-bottom-style: solid;
}

.ai-match-invite__hl sup {
  font-size: 10px;
  font-weight: 700;
  margin-left: 1px;
}

/* Попап с видео-примером */
.ai-example {
  width: min(920px, calc(100vw - 40px));
  padding: 32px 36px;
  border: 0;
  border-radius: var(--radius);
  border-left: 4px solid var(--green);
}

.ai-example::backdrop {
  background: rgba(17, 17, 17, 0.55);
}

.ai-example__title {
  font-size: 22px;
  margin-bottom: 8px;
}

.ai-example__text {
  margin: 0 0 18px;
  font-size: 14.5px;
  opacity: 0.75;
}

.ai-example__video {
  display: block;
  width: 100%;
  border-radius: 10px;
  background: #111;
}

.ai-match-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.ai-match-btn svg {
  flex-shrink: 0;
}

.ai-match-btn:hover {
  background: #069a5c;
}

/* Модалка ИИ-подбора */
.ai-match {
  width: min(640px, calc(100vw - 40px));
  /* попап целиком помещается в окно; длинный результат скроллится внутри */
  max-height: calc(100vh - 64px);
  padding: 32px 36px;
  border: 0;
  border-radius: var(--radius);
  border-left: 4px solid var(--green);
  display: flex;
  flex-direction: column;
}

.ai-match:not([open]) {
  display: none;
}

.ai-match__result {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.ai-match::backdrop {
  background: rgba(17, 17, 17, 0.55);
}

.ai-match__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
}

.ai-match__close:hover {
  color: var(--text);
}

.ai-match__title {
  font-size: 24px;
  margin-bottom: 12px;
}

.ai-match__disclaimer {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.55;
  opacity: 0.75;
}

.ai-match__form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}

.ai-match__form textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  border-color: var(--green);
}

/* Галочки «где искать»: по кейсам / по материалам */
.ai-match__scope {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 14px;
}

.ai-match__scope-label {
  color: var(--muted);
}

.ai-match__scope-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  cursor: pointer;
}

.ai-match__scope-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
}

.ai-match__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

.ai-match__fast {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Галочка согласия в закреплённой форме подбора: компактнее, чем в CTA,
   потому что форма закреплена вверху результата и каждый пиксель высоты
   отнимает место у подборки */
.ai-match__agree {
  margin: 8px 0 0;
}

/* Сообщение об отказе или лимите. Пока текста нет, блока нет вовсе;
   с текстом это заметная плашка, а не строчка мелким шрифтом внизу формы */
.ai-match__note:not(:empty) {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--green);
  background: #f1f8f4;
  font-size: 14px;
  color: var(--text);
}

.ai-match__note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--green);
}

/* Ловушка для ботов: поле есть в разметке, но недоступно человеку */
.form-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Пока модель думает: пиксельный лоадер + смена статусов */
.ai-match__progress {
  padding: 48px 0;
  text-align: center;
}

.pixel-loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.pixel-loader i {
  width: 16px;
  height: 16px;
  background: var(--green);
  animation: pixel-blink 1.2s steps(1) infinite;
}

.pixel-loader i:nth-child(2) { animation-delay: 0.4s; }

.pixel-loader i:nth-child(3) { animation-delay: 0.8s; }

/* Результат подбора */
.ai-match__result-label {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 12px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.ai-match__result h3 {
  font-size: 18px;
  margin: 22px 0 8px;
}

.ai-match__result p,
.ai-match__result li {
  font-size: 14.5px;
  line-height: 1.55;
}

.ai-match__result ul {
  margin: 0;
  padding-left: 20px;
}

.ai-match__result li {
  margin: 8px 0;
}

.ai-match__result li::marker {
  color: var(--green);
}

.ai-match__result a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Контакты закреплены вверху результата: подборка листается под ними */
.ai-match__lead {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 16px;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
}

.ai-match__lead-title {
  /* не наезжаем на крестик закрытия в углу окна */
  max-width: calc(100% - 44px);
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.ai-match__lead-hint {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.7;
}

.ai-match__lead-hint a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Ответ формы: появляется только после отправки, поэтому без отступа впустую */
.ai-match__note:empty {
  margin: 0;
}

/* Подсказка, что подборка продолжается: затухание у нижнего края окна */
.ai-match__fade {
  position: sticky;
  bottom: -1px;
  height: 36px;
  margin-top: -36px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}

.ai-match__again {
  margin: 26px 0 40px; /* нижний отступ — чтобы затухание не легло на кнопку */
  padding: 11px 22px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--green);
  cursor: pointer;
}

.ai-match__again:hover {
  background: var(--green);
  color: #fff;
}

.ai-match__contact-row {
  display: flex;
  gap: 10px;
}

.ai-match__contact-row input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  height: 46px;
  border: 1px solid #d9d9d9;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 14px;
}

.ai-match__contact-row input:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
  border-color: var(--green);
}

.ai-match__contact-row .button-green {
  height: 46px;
  padding: 0 24px;
  flex-shrink: 0;
}

.button-green--small {
  height: 44px;
  padding: 0 26px;
}

/* Слева — тёмная карточка ИИ-подбора (все страницы, кроме /blog) */
.float-ai {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 95;
  max-width: 300px;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: #222;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.float-ai[hidden] {
  display: none;
}

.float-ai__text {
  margin: 0 18px 12px 0;   /* справа место под крестик */
  font-size: 13.5px;
  line-height: 1.45;
}

.float-ai .ai-match-invite__hl {
  border-bottom-color: var(--green);
}

/* Кнопка во всю ширину карточки, чтобы блок не выглядел скособоченным */
.float-ai .ai-bar__btn {
  display: block;
  width: 100%;
}

.float-ai__close {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 6px;
  border: 0;
  background: none;
  color: #8a8a8a;
  font-size: 14px;
  cursor: pointer;
}

.float-ai__close:hover {
  color: #fff;
}

/* Свёрнутое состояние: маленькая тёмная кнопка на месте карточки */
.float-ai-mini {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 95;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: #222;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: background 0.2s;
}

.float-ai-mini[hidden] {
  display: none;
}

.float-ai-mini:hover {
  background: #333;
}

.ai-bar__btn {
  flex-shrink: 0;
  padding: 10px 22px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-bar__btn:hover {
  background: #069a5c;
}

.aside-cta .button-green {
  display: block;
  text-align: center;
}

@media (max-width: 900px) {
/* На телефоне слева остаётся только кнопка подбора: карточке с текстом
     не хватает места рядом с кнопкой цены */
  .float-ai { padding: 0; background: none; box-shadow: none; left: 12px; bottom: 12px; }
.float-ai__text { display: none; }
/* Карточки на телефоне нет — крестику сворачивать нечего */
  .float-ai__close { display: none; }
.float-ai .ai-bar__btn { width: auto; padding: 13px 18px; font-size: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); }
.float-ai-mini { left: 12px; bottom: 12px; }
}

.button-green, .outline-button { white-space: nowrap; }

.price-invite .button-green { justify-self: start; margin-top: 10px; }

/* Кнопка в тёмной карточке сайдбара: display: block из базового правила
   ломал флекс-центровку текста (текст прилипал к верху), а поля 44px
   выталкивали «Рассчитать стоимость» за края узкой колонки */
.aside-cta .button-green {
  display: flex;
  padding-left: 16px;
  padding-right: 16px;
}

/* --- поправки под старый CSS лендинга (см. tools/extract-ai-css.mjs) --- */

.ai-match[open] {
  position: fixed;
  inset: 0;
  margin: auto;
}

.ai-match,
.ai-match input,
.ai-match textarea,
.ai-match button,
.float-ai,
.float-ai-mini {
  font-family: var(--font-body);
}

/* Пока виден баннер про cookie (fixed к низу, z-index 1000), карточка
   ИИ-подбора и её свёрнутая кнопка поднимаются над ним. Класс и высоту
   ставит скрипт баннера в CrmFooter. */
body.has-cookie-banner .float-ai,
body.has-cookie-banner .float-ai-mini {
  bottom: calc(var(--cookie-banner-height, 70px) + 16px);
}
