/* Посадочная «Запуск CRM-маркетинга с нуля» (макет Димы, Figma 633:514).
   Шапка, футер и блок кейсов берутся из styles.css — здесь только то,
   что есть на этой странице. Все значения (46/24/20/16, радиус 12,
   отступы 180/80) сняты с макета. */

.crm {
  --crm-radius: 12px;
  --crm-gradient: linear-gradient(270deg, #F29333 20.155%, #F9B440 100%);
  --crm-sec-pad: 90px;
  /* соседние секции дают 180px между блоками, как в макете */
  --crm-head-gap: 80px;
  /* отступ от блока с цифрами до темной секции — в макете 120 */
  --crm-dark-gap: 120px;
  /* темная секция уже держит свой нижний паддинг, поэтому следующая
     секция отбивается целиком, а не половиной */
  --crm-after-dark: 180px;
  /* CTA-баннер в макете прижат к «Форматам» ближе обычного */
  --crm-cta-gap: 80px;
}

/* ==================== ОБЩЕЕ ==================== */

.crm-h2 {
  font-size: 46px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  color: #000;
}

.crm-h2--light {
  color: #fff;
}

.crm-h2--left {
  text-align: left;
}

/* Оранжевый градиент по тексту — тот же, что в хиро главной. */
.crm-grad {
  background: var(--crm-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.crm-card {
  background: #fff;
  border-radius: var(--crm-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  overflow: hidden;
}

.crm-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crm-card__title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
  color: #000;
}

.crm-card__text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  color: rgba(0, 0, 0, .5);
}

.crm-ico {
  width: 36px;
  height: 36px;
  flex: none;
}

.crm-cards {
  display: grid;
  gap: 16px;
}

.crm-cards--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ==================== КНОПКИ ==================== */

.crm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.05;
  border: none;
  border-radius: var(--crm-radius);
  padding: 16px 32px;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease, filter .15s ease;
}

.crm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(29, 45, 44, .18);
}

.crm-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: none;
}

.crm-btn--dark {
  background: #0B0B0B;
  color: #fff;
}

.crm-btn--dark:hover {
  background: #232323;
}

.crm-btn--grad {
  background: linear-gradient(90deg, #F29333 0%, #F9B440 100%);
  color: #fff;
  padding: 28px 48px;
}

.crm-btn--grad:hover {
  filter: brightness(1.04);
}

.crm-btn--yellow {
  background: #F4B022;
  color: #000;
  font-weight: 500;
  border-radius: 8px;
  min-width: 410px;
  min-height: 87px;
}

.crm-btn--yellow:hover {
  background: #f7bb3d;
}

.crm-btn--block {
  width: 100%;
}

/* ==================== ХИРО ==================== */

.crm-hero {
  padding-top: 100px;
  padding-bottom: 81px;
}

.crm-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.crm-hero__title {
  font-size: 54px;
  font-weight: 600;
  line-height: 1.05;
  max-width: 800px;
}

/* Иллюстрация — экспорт группы из Figma (2052:181) с ромбовидным паттерном,
   который растворяется к краям, а не режется по прямоугольнику: на мобилке
   кроп по содержимому давал видимый край подложки. Сам ноутбук с монетами
   занимает 416px по ширине и лежит в кадре с полями 50px сверху и 88px снизу,
   поэтому внешние отступы (в макете 70/81) уменьшены на эти поля. */
.crm-hero__img {
  width: 675px;
  max-width: 100%;
  height: auto;
  margin: 20px 0 -7px;
}

.crm-hero__sub {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
  max-width: 800px;
}

.crm-hero__sub+.crm-btn {
  margin-top: 36px;
}

/* ==================== КОГДА CRM НЕ ВЫСТРОЕН ==================== */

.crm-loss {
  padding: var(--crm-sec-pad) 0 var(--crm-dark-gap);
}

.crm-loss .crm-cards {
  margin-top: var(--crm-head-gap);
}

.crm-loss .crm-card__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-loss .crm-card__title {
  line-height: 1.35;
}

.crm-stat {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.35;
}

.crm-loss__note {
  margin-top: 80px;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  color: rgba(0, 0, 0, .5);
}

/* ==================== ТЁМНЫЙ БЛОК ==================== */

.crm-dark {
  position: relative;
  padding: 120px 0 179px;
  background: #150E06 url(/assets/services/dark-bg.webp) center/cover no-repeat;
  color: #fff;
}

.crm-trust__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  margin-top: var(--crm-head-gap);
}

/* В карточках доверия заголовок крупнее, чем в остальных, и отбит сильнее. */
.crm-trust__grid .crm-card__title {
  font-size: 24px;
}

.crm-trust__grid .crm-card__body {
  gap: 24px;
}

/* Первый ряд — две широкие карточки, второй — три равные. */
.crm-trust__grid> :nth-child(-n+2) {
  grid-column: span 3;
}

.crm-trust__grid> :nth-child(n+3) {
  grid-column: span 2;
}

.crm-results {
  margin-top: 180px;
}

.crm-results .cases__head {
  margin: var(--crm-head-gap) 0 40px;
}

.crm-results .eyebrow {
  color: rgba(255, 255, 255, .5);
}

/* Карточки кейсов белые, а секция вокруг них светлым по темному: без этого
   .case-stat наследует белый от .crm-dark и пропадает на белом фоне. */
.crm-results .case-card {
  color: var(--ink);
}

.crm-results__cta {
  display: flex;
  justify-content: center;
  margin-top: 80px;
}

/* ==================== КОМУ ПОДХОДИТ ==================== */

.crm-fit {
  padding: var(--crm-after-dark) 0 var(--crm-sec-pad);
}

.crm-fit .crm-cards {
  margin-top: var(--crm-head-gap);
}

/* ==================== ВЫ ПОЛУЧАЕТЕ ==================== */

.crm-gains {
  padding: var(--crm-sec-pad) 0;
}

.crm-gains__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: var(--crm-head-gap);
}

.crm-gain {
  position: relative;
  border-radius: var(--crm-radius);
  overflow: hidden;
  aspect-ratio: 338 / 228;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.crm-gain__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crm-gain__text {
  position: relative;
  padding: 0 24px;
}

.crm-gain__title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  background: var(--crm-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.crm-gain__sub {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  color: #fff;
}

/* ==================== ПОНЯТНЫЙ ПРОЦЕСС ==================== */

.crm-process {
  padding: var(--crm-sec-pad) 0;
}

.crm-process__row {
  display: grid;
  grid-template-columns: 569px 1fr;
  gap: 24px;
  align-items: start;
}

.crm-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* сброс для ol: в styles.css обнулен только ul */
  margin: 0;
  padding: 0;
  list-style: none;
}

.crm-step {
  background: #fff;
  border-radius: var(--crm-radius);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.crm-step__num {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid #F29333;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
}

.crm-step__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crm-step__title {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  color: #000;
}

/* ==================== ФОРМАТЫ ЗАПУСКА ==================== */

.crm-formats {
  padding: var(--crm-sec-pad) 0 var(--crm-cta-gap);
}

.crm-formats .crm-cards {
  margin-top: var(--crm-head-gap);
}

.crm-format {
  gap: 24px;
  text-align: center;
}

/* Обложка собирается так же, как в макете: черная подложка, текстура на 84%
   прозрачности и оранжевый градиент в режиме наложения color. Текст живой,
   а не запеченный в картинку, — иначе он не масштабируется и не индексируется. */
.crm-format__cover {
  position: relative;
  isolation: isolate;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 408 / 228;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-format__tex {
  position: absolute;
  left: 0.245%;
  top: -72.81%;
  width: 116.67%;
  height: 282.46%;
  object-fit: cover;
  opacity: .84;
  transform: scaleX(-1);
}

.crm-format__cover::after {
  content: "";
  position: absolute;
  left: -166.67%;
  top: -419.3%;
  width: 392.65%;
  height: 910.53%;
  background: linear-gradient(270deg, #F29333 20.155%, #F9B440 100%);
  mix-blend-mode: color;
}

.crm-format__title {
  position: relative;
  z-index: 1;
  padding: 0 20px;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
  color: #fff;
}

.crm-format__text {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  color: #000;
}

/* ==================== CTA-БАННЕР ==================== */

.crm-cta {
  padding: 0 0 var(--crm-sec-pad);
}

.crm-cta__banner {
  background: #242424;
  border-radius: var(--crm-radius);
  padding: 30px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.crm-cta__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 751px;
}

.crm-cta__title {
  font-size: 36px;
  font-weight: 500;
  line-height: 1.15;
}

.crm-cta__sub {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
  color: #fff;
}

/* ==================== FAQ ==================== */

.crm-faq {
  padding: var(--crm-sec-pad) 0;
}

.crm-faq__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: var(--crm-head-gap);
}

/* .faq-item из styles.css переопределяется под макет посадочной:
   те же 24px внутри и круглая кнопка-шеврон вместо плюса. */
.crm-faq__item {
  padding: 24px;
  border-radius: var(--crm-radius);
}

.crm-faq__item summary {
  padding: 0;
  gap: 24px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.crm-faq__ic {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #F1F1F1;
  position: relative;
}

.crm-faq__ic::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: 10px;
  height: 10px;
  border-right: 1.6px solid #111;
  border-bottom: 1.6px solid #111;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: transform .2s ease;
}

.crm-faq__item[open] .crm-faq__ic::after {
  transform: translate(-50%, -25%) rotate(225deg);
}

.crm-faq__item .faq-body {
  padding: 16px 0 0;
  max-width: none;
}

.crm-faq__item .faq-body p {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 400;
  color: #1D2D2C;
}

.crm-footer {
  padding: var(--crm-sec-pad) 0 151px;
}

/* ==================== МОДАЛКА С ФОРМОЙ ==================== */

.crm-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.crm-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.crm-modal__dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg);
  border-radius: 20px;
  padding: 32px;
}

.crm-modal__x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #E7E5E1;
  color: #111;
  font-size: 22px;
  line-height: 1;
}

.crm-modal__x:hover {
  background: #dcd9d4;
}

.crm-modal__title {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  margin-right: 40px;
}

.crm-modal__sub {
  margin-top: 8px;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted-2);
}

.crm-modal__form {
  margin-top: 24px;
}

.crm-modal__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted-2);
  cursor: pointer;
}

.crm-modal__check input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: none;
}

.crm-modal__check a {
  text-decoration: underline;
}

.crm-modal .form-error {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  color: #c0392b;
}

/* ==================== АДАПТИВ ==================== */

@media (max-width: 1100px) {
  .crm {
    --crm-sec-pad: 70px;
    --crm-head-gap: 56px;
    --crm-dark-gap: 90px;
    --crm-after-dark: 140px;
    --crm-cta-gap: 70px;
  }

  .crm-hero {
    padding-bottom: 70px;
  }

  .crm-h2 {
    font-size: 38px;
  }

  .crm-hero__title {
    font-size: 44px;
  }

  .crm-cards--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .crm-trust__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .crm-trust__grid> :nth-child(-n+2),
  .crm-trust__grid> :nth-child(n+3) {
    grid-column: span 1;
  }

  .crm-gains__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .crm-results {
    margin-top: 120px;
  }

  .crm-process__row {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .crm-footer {
    padding: 110px 0 60px;
  }
}

@media (max-width: 860px) {
  .crm-cta__banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
  }

  .crm-btn--yellow {
    min-width: 0;
    width: 100%;
    min-height: 72px;
  }
}

@media (max-width: 640px) {
  .crm {
    --crm-sec-pad: 50px;
    --crm-head-gap: 40px;
    --crm-dark-gap: 100px;
    --crm-after-dark: 100px;
    --crm-cta-gap: 60px;
  }

  .crm-h2 {
    font-size: 28px;
  }

  .crm-hero {
    padding-top: 60px;
    padding-bottom: 50px;
  }

  .crm-footer {
    padding-bottom: 72px;
  }

  .crm-hero__title {
    font-size: 36px;
  }

  /* При 100% ширины ноутбук занимает ~200px — как в мобильном макете. Поля
     паттерна (50/88px на 675) ужимаются пропорционально, отступы 40/48
     сведены с ними так же, как на десктопе. */
  .crm-hero__img {
    width: 100%;
    margin: 16px 0 4px;
  }

  .crm-hero__sub {
    font-size: 16px;
  }

  .crm-hero__sub br {
    display: none;
  }

  .crm-hero__sub+.crm-btn {
    margin-top: 24px;
  }

  .crm-btn {
    width: 100%;
  }

  .crm-btn--grad {
    padding: 22px 24px;
  }

  .crm-loss__note {
    margin-top: 40px;
  }

  .crm-dark {
    padding: 60px 0 70px;
  }

  .crm-results {
    margin-top: 80px;
  }

  .crm-results__cta {
    margin-top: 48px;
  }

  .crm-cards--3,
  .crm-trust__grid {
    grid-template-columns: 1fr;
  }

  /* В мобильном макете карточки «Вы получаете» вертикальные, 190×228. */
  .crm-gains__grid {
    gap: 12px;
  }

  .crm-gain {
    aspect-ratio: 190 / 228;
  }

  .crm-gain__text {
    padding: 0 16px;
  }

  .crm-gain__title {
    font-size: 18px;
  }

  .crm-gain__sub {
    font-size: 14px;
  }

  .crm-step__title,
  .crm-faq__item summary {
    font-size: 20px;
  }

  /* В мобильном макете обложка формата ниже (344×228) и заголовок мельче. */
  .crm-format__cover {
    aspect-ratio: 344 / 228;
  }

  .crm-format__title {
    font-size: 28px;
  }

  .crm-faq__ic {
    width: 40px;
    height: 40px;
  }

  .crm-faq__item summary {
    gap: 16px;
  }

  .crm-cta__title {
    font-size: 24px;
  }

  .crm-cta__sub {
    font-size: 16px;
  }

  .crm-modal__dialog {
    padding: 24px;
  }

  /* Карточные ряды в макете мобилки листаются вбок и выезжают за край экрана.
     scroll-padding обязателен: snap ровняет карточку по краю скролл-порта,
     а не по padding, и без него первая карточка прилипает к краю экрана —
     лента стартует со scrollLeft = gutter и отступ страницы съедается. */
  .crm-scroller,
  .crm-trust__grid,
  .crm-results .cases__grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .crm-scroller::-webkit-scrollbar,
  .crm-trust__grid::-webkit-scrollbar,
  .crm-results .cases__grid::-webkit-scrollbar {
    display: none;
  }

  /* Колонка из двух кейсов раскрывается в общий ряд карусели. */
  .crm-results .cases__col {
    display: contents;
  }

  .crm-scroller>*,
  .crm-trust__grid>*,
  .crm-results .cases__grid>*,
  .crm-results .cases__col>* {
    flex: 0 0 284px;
    scroll-snap-align: start;
  }

  /* Карточки кейсов по мобильному макету (Figma 2058:10752): все 284×453,
     одна и та же шапка — логотип, заголовок на две строки, «Читать кейс» —
     и нижний блок 211px: креатив у большого кейса, цифры у остальных.
     Плашки отрасли в мобильном макете нет. Шапке задана фиксированная
     высота, чтобы заголовки и ссылки во всех карточках стояли на одной
     линии, а не разъезжались от space-between десктопной вёрстки. */
  .crm-results .cases__grid>.case-card,
  .crm-results .cases__col>.case-card {
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    min-height: 453px;
    padding: 24px;
  }

  /* Шапка — сетка с фиксированным рядом под логотип: логотипы разной высоты
     (22–30px) прижаты к низу ряда, и заголовки во всех карточках начинаются
     с одной линии. */
  .crm-results .case-card__body {
    display: grid;
    grid-template-rows: 30px;
    grid-auto-rows: auto;
    align-content: start;
    align-items: end;
    flex: 0 0 170px;
    width: 100%;
    padding: 0;
  }

  /* 22px, а не 24 из макета: шрифт на сайте шире фигмовского, и заголовок
     Браво-Оптики при 24px ломается на три строки — ссылка съезжает. */
  .crm-results .case-stat {
    font-size: 22px;
    margin-top: 26px;
    min-height: 56px;
  }

  .crm-results .case-card__body .link-more {
    margin-top: 24px;
  }

  .crm-results .case-tag {
    display: none;
  }

  .crm-results .case-card--big .case-card__phone {
    width: 100%;
    height: 211px;
    margin-top: auto;
    object-fit: cover;
    border-radius: var(--crm-radius);
    background: #F2EFEA;
  }

  /* margin: -4px 0 из десктопной вёрстки здесь не нужен — он сдвигал блок
     с цифрами на 4px относительно креатива в большой карточке. */
  .crm-results .case-metrics {
    width: 100%;
    height: 211px;
    margin: auto 0 0;
  }
}

/* ==================== ПОЯВЛЕНИЕ ПРИ СКРОЛЛЕ ==================== */

.cc-js .crm [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s cubic-bezier(.22, .61, .36, 1),
    transform .55s cubic-bezier(.22, .61, .36, 1);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
  will-change: opacity, transform;
}

.cc-js .crm [data-reveal].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {

  .cc-js .crm [data-reveal] {
    transition: none;
  }

  .crm-btn,
  .crm-faq__ic::after {
    transition: none;
  }

  .crm-btn:hover,
  .crm-btn:active {
    transform: none;
  }
}
