/* Посадочная страница: макет 1 (десктоп 1440×900) и макет 6 (телефон 390×844). */

.landing {
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-header {
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.landing-header__side {
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-header__short {
  display: none;
}

.landing-header__note {
  font-size: 14px;
  color: var(--ink3);
}

.landing-main {
  flex-grow: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: 1fr auto;
  column-gap: 72px;
  row-gap: 28px;
  align-items: center;
}

/* ---------- Кнопка открытия формы ---------- */
.open-apply {
  font-family: inherit;
}

/* ---------- «Помощь» в шапке ---------- */
/* Второстепенная кнопка: белая с тонкой рамкой, текст приглушён — не спорит с основной CTA. */
.help-link {
  height: 40px;
  padding: 0 16px 0 12px;
  gap: 8px;
  font-size: 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink2);
  box-shadow: inset 0 0 0 1px var(--line2);
  transition: color .15s, box-shadow .15s;
}

.help-link svg {
  color: var(--emerald);
}

.help-link:hover {
  color: var(--acc);
  box-shadow: inset 0 0 0 1px var(--title-muted);
}

.open-apply--hero,
.open-apply--sticky {
  background: var(--acc);
  color: var(--on-acc);
  box-shadow: var(--shadow-btn);
}

.open-apply--hero {
  height: 64px;
  padding: 0 8px 0 28px;
  gap: 20px;
  font-size: 17px;
  border-radius: 20px;
}

.open-apply__arrow {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Наведение на главную кнопку (решение владельца 16.09): кнопка раскрывается вправо —
   растёт промежуток между текстом и блоком со стрелкой (+16 px), левый край и текст на месте;
   блок становится светлым кругом цвета фона, стрелка — Teal того же размера (18 px, без scale). */
.open-apply--hero {
  --cta-ease: cubic-bezier(.22, 1, .36, 1);
  transition: gap .28s var(--cta-ease), box-shadow .28s var(--cta-ease);
}

.open-apply--hero .open-apply__arrow {
  transition:
    border-radius .28s var(--cta-ease),
    background-color .28s var(--cta-ease),
    color .28s var(--cta-ease),
    box-shadow .28s var(--cta-ease);
}

@media (hover: hover) {
  .open-apply--hero:hover {
    gap: 36px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 1px 2px rgba(0, 29, 36, .22), 0 14px 30px -14px rgba(0, 29, 36, .6);
  }

  .open-apply--hero:hover .open-apply__arrow {
    border-radius: 50%;
    background: var(--bg);
    color: var(--acc);
    box-shadow: inset 0 0 0 1px rgba(16, 63, 69, .12);
  }
}

/* ---------- Первый экран ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pill {
  height: 32px;
  padding: 0 14px 0 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
}

.pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--emerald);
}

/* Заголовки — Manrope 700: в макете вес 600, у Manrope в дизайн-системе 500/700/800. */
.hero__title {
  margin-top: 28px;
  max-width: 700px;
  font-family: var(--font-heading);
  font-size: 72px;
  line-height: 76px;
  font-weight: 700;
  letter-spacing: -.042em;
}

.hero__title-muted {
  color: var(--title-muted);
}

.hero__lead {
  margin-top: 24px;
  max-width: 500px;
  font-size: 20px;
  line-height: 31px;
  color: var(--ink2);
  text-wrap: pretty;
}

.hero__cta {
  margin-top: 40px;
}

/* ---------- «Как это работает» ---------- */
.how {
  justify-self: end;
  width: 100%;
  max-width: 460px;
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: 32px;
  /* После удаления «Кому подходит» в панели только шаги — поля одинаковые со всех сторон. */
  padding: 36px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 40px 80px -48px rgba(0, 29, 36, .6);
}

.how__cap {
  color: var(--dark-muted);
}

.how__steps {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
}

.how__step {
  position: relative;
  display: flex;
  gap: 18px;
  padding-bottom: 26px;
}

.how__step:last-child {
  padding-bottom: 0;
}

.how__step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 4px;
  width: 1px;
  background: var(--dark-line);
}

.how__num {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(244, 242, 242, .22);
  color: var(--dark-muted);
}

/* Первый шаг — emerald; цифра Obsidian Deep (контраст 6:1, белая дала бы 2.9:1). */
.how__num--first {
  background: var(--emerald);
  color: var(--brand-deep);
  box-shadow: none;
}

.how__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 5px;
}

.how__title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.how__desc {
  font-size: 14px;
  line-height: 20px;
  color: var(--dark-muted);
}

/* ---------- Преимущества ---------- */
.benefits {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line2);
}

.benefit {
  display: flex;
  gap: 14px;
  align-items: center;
}

.benefit__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(16, 63, 69, .06);
}

.benefit__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.benefit__title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.benefit__desc {
  font-size: 14px;
  color: var(--ink3);
}

/* ---------- Подвал ---------- */
.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--ink4);
}

.landing-footer a {
  color: var(--ink3);
}

.sticky-cta {
  display: none;
}

/* Промежуточные ширины не отрисованы в макете — сохраняем раскладку, ужимая крупные элементы. */
@media (max-width: 1199px) and (min-width: 900px) and (min-height: 501px), (max-width: 1199px) and (min-width: 1025px) {
  .landing {
    padding: 28px 40px;
  }

  .landing-main {
    column-gap: 40px;
  }

  .hero__title {
    font-size: 56px;
    line-height: 60px;
  }

  .how {
    padding: 28px;
  }
}

/* ---------- Телефон (макет 6) ---------- */
/* Телефон; невысокий горизонтальный экран до 1024 px — тоже мобильная раскладка. */
@media (max-width: 899px), (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) {
  .landing {
    padding: 0;
    gap: 0;
  }

  .landing-header {
    height: 60px;
    padding: 16px 20px 0;
  }

  .landing-header .logo {
    height: 40px;
  }

  .help-link {
    height: 40px;
    padding: 0 14px 0 10px;
  }

  /* На телефоне подпись «Карта продуктов» сокращается до «Продукты», иначе кнопки не помещаются. */
  .landing-header__full {
    display: none;
  }

  .landing-header__short {
    display: inline;
  }

  .landing-header__note,
  .how,
  .hero__cta {
    display: none;
  }

  .landing-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 28px 20px 0;
    /* Первый экран — как в макете; подвал уходит ниже сгиба. */
    min-height: calc(100svh - 60px - 128px);
  }

  .hero {
    max-width: 560px;
  }

  .pill {
    height: 28px;
    padding: 0 12px 0 10px;
    border-radius: 14px;
    gap: 7px;
    font-size: 12px;
  }

  .hero__title {
    margin-top: 20px;
    font-size: 36px;
    line-height: 40px;
    letter-spacing: -.04em;
  }

  .hero__lead {
    margin-top: 16px;
    font-size: 17px;
    line-height: 26px;
  }

  .benefits {
    align-self: stretch;
    margin-top: 28px;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px 16px;
    border-top: 0;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(16, 63, 69, .05);
  }

  .benefit {
    padding: 12px 0;
  }

  .benefit:not(:last-child) {
    border-bottom: 1px solid var(--line);
  }

  .benefit__icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--emerald-wash);
    box-shadow: none;
  }

  .benefit__icon svg {
    width: 18px;
    height: 18px;
  }

  .benefit__text {
    gap: 1px;
  }

  .benefit__title {
    font-size: 15px;
    letter-spacing: 0;
  }

  .benefit__desc {
    font-size: 13px;
  }

  .landing-footer {
    flex-direction: column;
    padding: 28px 20px 24px;
  }

  .sticky-cta {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }

  .open-apply--sticky {
    width: 100%;
    max-width: 560px;
    height: 56px;
    border-radius: 18px;
    justify-content: space-between;
    padding: 0 8px 0 22px;
  }

  .open-apply--sticky .open-apply__arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .sticky-cta__note {
    font-size: 12px;
    color: var(--ink3);
  }
}

/* ---------- Появление при загрузке ---------- */
/* Тот же мягкий подъём, что у страницы «Помощь», — продукт выглядит цельным. */
.hero,
.how,
.benefits {
  animation: landing-rise .55s cubic-bezier(.2, .8, .2, 1) both;
}

.how {
  animation-delay: .08s;
}

.benefits {
  animation-delay: .16s;
}

@keyframes landing-rise {
  from { opacity: 0; transform: translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
  .open-apply--hero,
  .open-apply--hero .open-apply__arrow {
    transition: none;
  }

  .hero,
  .how,
  .benefits {
    animation: none;
  }
}

/* ---------- Телефон в горизонтальной ориентации (568–1024 × до 500 px) ----------
   Закреплённая снизу кнопка на невысоком экране перекрывает первый экран — здесь CTA
   возвращается в поток под текстом, компактная; нижняя панель скрыта. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1024px) {
  .landing-header {
    height: 56px;
    padding: 12px 24px 0;
  }

  .landing-header .logo {
    height: 36px;
  }

  .landing-header__side,
  .landing-header__note {
    display: flex;
  }

  .landing-header__side {
    gap: 16px;
  }

  .landing-main {
    min-height: 0;
    padding: 20px 24px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
    column-gap: 32px;
    align-items: start;
  }

  .hero {
    max-width: none;
  }

  .hero__title {
    margin-top: 14px;
    font-size: 32px;
    line-height: 36px;
  }

  .hero__lead {
    margin-top: 12px;
    font-size: 16px;
    line-height: 24px;
  }

  .hero__cta {
    display: block;
    margin-top: 20px;
  }

  .open-apply--hero {
    height: 52px;
    padding: 0 6px 0 22px;
    gap: 16px;
    font-size: 16px;
    border-radius: 16px;
  }

  .open-apply--hero .open-apply__arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  @media (hover: hover) {
    .open-apply--hero:hover {
      gap: 28px;
    }
  }

  /* Преимущества — справа от первого экрана, а не под ним. */
  .benefits {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-top: 6px;
  }

  .landing-footer {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 24px 24px 20px;
  }

  .sticky-cta {
    display: none;
  }
}

/* Узкий горизонтальный экран: подпись в шапке не помещается рядом с кнопками. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 719px) {
  .landing-header__note {
    display: none;
  }
}
