/* ============================================================
   ПОТОЛКИ42 — components.css
   Шапка, hero + слайдер до/после, бегущая строка,
   «как это работает», две ветки, квалификация
   ============================================================ */

/* ================= Шапка ================= */
.header {
  position: fixed; inset-inline: 0; top: 0; z-index: 90;
  transition: background var(--tr), box-shadow var(--tr), transform .3s ease;
  /* Подложка из фона темы (var(--bg-rgb)), а не захардкоженный
     зелёновато-белый rgba(244,248,247): с пресетом типа «Лазурь»
     шапка и мобильное меню отдавали старым зелёным оттенком */
  background: rgba(var(--bg-rgb, 244, 248, 247), .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header.is-scrolled { background: rgba(var(--surface-rgb, 255, 255, 255), .9); box-shadow: var(--sh-sm); }
.header__inner {
  display: flex; align-items: center; gap: 18px;
  height: 76px;
  /* Шапке нужен больше места, чем контентной колонке: иначе кнопка
     «Рассчитать потолок» выталкивается за край и обрезается */
  max-width: 1600px;
  min-width: 0;
}
.header.is-scrolled .header__inner { height: 66px; }
.header__inner, .header.is-scrolled .header__inner { transition: height var(--tr); }

.logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; }
.logo__mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 4px 10px rgba(var(--brand-rgb), .35)); }
.logo__text { font-family: var(--f-display); font-size: 18px; letter-spacing: -.01em; }
.logo__text b { color: var(--brand-deep); }
/* Иконка логотипа: градиент и «солнышко» следуют теме (stop-color через CSS) */
.logo__mark .lg-a { stop-color: var(--brand); }
.logo__mark .lg-b { stop-color: var(--cyan); }
.logo__mark .lg-sun { stroke: var(--accent-on-dark); }
.logo__mark .lg-dot { fill: var(--accent-on-dark); }
.logo__city { display: block; font-family: var(--f-body); font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; margin-top: 1px; }

.nav { display: flex; gap: 2px; margin-inline: auto; }
.nav__link {
  position: relative; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  padding: 9px 11px; border-radius: 10px; transition: color var(--tr), background var(--tr);
  white-space: nowrap;
}
.nav__link:hover { color: var(--brand-ink); background: var(--brand-soft); }
.nav__link.is-active { color: var(--brand-ink); }

.header__phone {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 15px; white-space: nowrap;
}
.header__phone svg { width: 17px; height: 17px; color: var(--brand); }
.header__phone:hover { color: var(--brand-deep); }

.header .btn { flex: none; }
.header .btn--sm { padding: 13px 20px; }

/* Телефон в шапке — только на широких экранах (появляется >1420px) */
@media (max-width: 1420px) {
  .header__phone { display: none; }
}
/* Компактная навигация на средних ширинах */
@media (max-width: 1260px) {
  .nav__link { padding: 9px 8px; font-size: 13.5px; }
}

.burger {
  display: none; width: 46px; height: 46px; border-radius: 12px;
  place-content: center; background: var(--surface); box-shadow: var(--sh-sm);
}
.burger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: var(--tr); }
.burger span + span { margin-top: 5px; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mnav {
  position: fixed; inset: 0; z-index: 89; padding: 100px 22px 30px;
  background: rgba(var(--bg-rgb, 244, 248, 247), .97); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
  overflow-y: auto;
}
.mnav.is-open { opacity: 1; pointer-events: auto; }
.mnav__link { font-family: var(--f-display); font-size: 21px; padding: 13px 6px; border-bottom: 1px solid var(--line); }
.mnav .btn { margin-top: 18px; }
.mnav__phone { margin-top: 12px; font-weight: 800; font-size: 18px; color: var(--brand-deep); }

/* Прогресс чтения */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 95;
  background: var(--grad-brand); border-radius: 0 3px 3px 0;
  transition: width .1s linear;
}

/* ================= Hero ================= */
.hero { position: relative; padding: 150px 0 40px; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--hero-tint, #EAF6F3) 0%, var(--bg) 78%); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(28px, 4vw, 56px); align-items: center;
}

.hero__chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.hero__title {
  font-family: var(--f-display);
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 600; letter-spacing: -.015em; line-height: 1.14;
}
.hero__title .accent { position: relative; white-space: nowrap; }
.hero__title .accent svg {
  position: absolute; left: 0; right: 0; bottom: -10px; width: 100%; height: 12px;
  color: var(--accent);
}
.hero__sub { margin-top: 22px; font-size: clamp(16.5px, 1.6vw, 19.5px); color: var(--ink-2); max-width: 540px; }
.hero__sub b { color: var(--ink); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }
.hero__cta .btn svg { transition: transform var(--tr); }
.hero__cta .btn:hover svg { transform: translateX(4px); }

.hero__trust { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }

/* Слайдер до/после */
.ba {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--sh-lg); background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .6);
  touch-action: pan-y; user-select: none;
}
.ba__img { width: 100%; height: auto; display: block; }
.ba__after {
  position: absolute; inset: 0; overflow: hidden;
}
.ba__after img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  background: #fff; transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(var(--ink-rgb), .35);
  cursor: ew-resize; z-index: 3;
}
.ba__knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; display: grid; place-content: center;
  color: var(--ink); font-weight: 800;
  transition: transform var(--tr);
}
.ba__knob svg { width: 22px; height: 22px; }
.ba__handle:active .ba__knob, .ba__handle:focus-visible .ba__knob { transform: translate(-50%, -50%) scale(1.1); }
.ba__label {
  position: absolute; top: 16px; z-index: 2;
  font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 14px; border-radius: var(--r-pill);
  backdrop-filter: blur(6px); background: rgba(var(--ink-rgb), .45); color: #fff;
}
.ba__label--before { left: 16px; }
.ba__label--after { right: 16px; background: rgba(var(--brand-rgb), .85); }

/* Плавающие мини-бейджи над слайдером */
.hero__badges { position: relative; }
.hero__badges .float-badge { position: absolute; z-index: 4; }
.fb {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--sh-md);
  padding: 12px 16px; font-size: 13.5px; font-weight: 700; line-height: 1.25;
}
.fb svg { width: 20px; height: 20px; color: var(--brand); flex: none; }
.fb small { display: block; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.fb--1 { top: -40px; right: 14px; }
.fb--2 { bottom: -18px; left: 22px; }
.fb--2 svg { color: var(--accent-deep); }

/* Статы под hero */
.stats {
  margin-top: clamp(40px, 6vw, 64px);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 24px;
  box-shadow: var(--sh-sm); transition: var(--tr-slow);
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.stat__num {
  font-family: var(--f-display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 600;
  color: var(--brand-deep); display: flex; align-items: baseline; gap: 4px;
}
.stat__num small { font-size: .55em; font-weight: 600; }
.stat__label { margin-top: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }

/* ================= Бегущая строка =================
   Обёртка с overflow:hidden отрезает вылеты rotate+scale,
   чтобы полоса не создавала горизонтальный скролл.
   Паддинг оставляет место тени и углам наклона. */
.marquee-clip {
  overflow: hidden;
  padding-block: 30px;
  margin-block: -4px;
}
.marquee-section {
  padding-block: 22px; background: var(--grad-ink); color: var(--on-dark-text-dim, #CFE8E2);
  transform: rotate(-1.2deg) scale(1.02);
  box-shadow: var(--sh-md);
}
.marquee-section .marquee__item { font-family: var(--f-display); font-size: 14.5px; letter-spacing: .02em; }
.marquee-section .marquee__item::after { color: var(--accent); }

/* ================= Как это работает ================= */
.steps { position: relative; }
.steps__grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  position: relative; z-index: 1;
}
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px 20px; position: relative;
}
.step__num {
  font-family: var(--f-display); font-size: 13px; font-weight: 700;
  color: var(--brand-deep); background: var(--brand-soft);
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-content: center;
  margin-bottom: 40px;
}
.step .icon-tile { position: absolute; top: 62px; left: 20px; }
.step__title { font-size: 16.5px; font-weight: 800; margin-top: 66px; line-height: 1.3; }
.step__text { margin-top: 9px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.step__tag {
  position: absolute; top: 18px; right: 16px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-deep);
}

/* Классика vs новая модель */
.vs {
  margin-top: clamp(36px, 5vw, 52px);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch;
}
.vs__col {
  border-radius: var(--r-lg); padding: 26px 28px;
}
.vs__col--old { background: var(--surface-2); border: 1.5px dashed var(--line-2); color: var(--muted); }
.vs__col--new { background: var(--grad-ink); color: var(--on-dark-text, #E9F5F1); box-shadow: var(--sh-lg); position: relative; overflow: hidden; }
.vs__col--new::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(var(--brand-rgb), .35), transparent 70%);
}
.vs__title { font-family: var(--f-display); font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.vs__title svg { width: 20px; height: 20px; }
.vs__flow { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; }
.vs__flow i {
  font-style: normal; padding: 6px 12px; border-radius: var(--r-pill); font-size: 13px;
  background: rgba(var(--ink-rgb), .05); border: 1px solid var(--line-2);
}
.vs__col--new .vs__flow i { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .18); color: #fff; }
.vs__flow b { opacity: .5; font-weight: 700; }
.vs__note { margin-top: 14px; font-size: 13px; opacity: .8; }
.vs__divider { display: grid; place-content: center; }
.vs__divider span {
  width: 54px; height: 54px; border-radius: 50%; background: var(--surface);
  box-shadow: var(--sh-md); display: grid; place-content: center;
  font-family: var(--f-display); font-weight: 700; font-size: 13px; color: var(--accent-deep);
}

/* ================= Две ветки ================= */
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.branch {
  position: relative; border-radius: var(--r-xl); padding: clamp(26px, 3vw, 38px);
  overflow: hidden; display: flex; flex-direction: column; gap: 18px;
  transition: transform var(--tr-slow), box-shadow var(--tr-slow);
}
.branch:hover { transform: translateY(-6px); }
.branch--a { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-sm); }
.branch--b { background: linear-gradient(160deg, var(--brand-soft) 0%, var(--cyan-soft) 100%); border: 1px solid var(--line-2); box-shadow: var(--sh-md); }
.branch__top { display: flex; align-items: center; gap: 16px; }
.branch__kicker {
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.branch--b .branch__kicker { color: var(--brand-deep); }
.branch__title { font-family: var(--f-display); font-size: clamp(19px, 2vw, 24px); margin-top: 4px; }
.branch__text { color: var(--ink-2); font-size: 15.5px; }
.branch__list { display: flex; flex-direction: column; gap: 10px; }
.branch__list li { display: flex; gap: 11px; font-size: 14.5px; color: var(--ink-2); align-items: flex-start; }
.branch__list svg { width: 19px; height: 19px; color: var(--brand); flex: none; margin-top: 1px; }
.branch .btn { align-self: flex-start; margin-top: auto; }
.branch__decor {
  position: absolute; right: -34px; bottom: -34px; width: 150px; height: 150px; opacity: .07;
  transform: rotate(-12deg); pointer-events: none;
}
.branch__decor svg { width: 100%; height: 100%; }

/* Квалификация */
.qualify {
  margin-top: 26px; border-radius: var(--r-xl);
  background: var(--surface); border: 1.5px dashed var(--line-2);
  padding: 22px 28px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.qualify__icon { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-content: center; flex: none; }
.qualify__icon svg { width: 26px; height: 26px; }
.qualify__text { flex: 1 1 300px; }
.qualify__title { font-weight: 800; font-size: 16.5px; }
.qualify__sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

/* ================= Адаптив ================= */
@media (max-width: 1120px) {
  .nav { display: none; }
  .burger { display: grid; margin-left: auto; }
  .header .btn { display: none; }
}
@media (max-width: 1080px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero { padding-top: 120px; }
  .steps__grid { grid-template-columns: repeat(2, 1fr); }
  /* Декоративную прогресс-линию на планшетах/телефонах убираем, но НЕ сам
     блок: .steps-line — класс контейнера «Как это работает» (div.steps),
     и display:none на нём прятал ВСЕ этапы целиком (скрытый баг,
     этапов не было видно на мобильных вообще) */
  .steps-line::before,
  .steps-line .steps-line__fill { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .vs { grid-template-columns: 1fr; }
  .vs__divider { padding-block: 4px; }
  .branches { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header__phone { display: none; }
  .steps__grid { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
  .step__num { grid-row: 1 / 3; margin-bottom: 0; }
  .step .icon-tile { display: none; }
  .step__title { margin-top: 0; }
  .fb--1 { right: 8px; top: -26px; }
  .fb--2 { left: 8px; }
  .hero__cta .btn { width: 100%; }
  .qualify { padding: 20px; }
}
