:root {
  --blue: #005bff;
  --blue-dark: #0047cc;
  --purple: #6a11f0;
  --purple-dark: #5a0fd4;
  --text: #1a1a1a;
  --text-muted: #5f6676;
  --bg: #ffffff;
  --bg-soft: #f3f4f6;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-pill: 999px;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.header-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.header-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.header-tagline {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

main {
  padding-top: 84px;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Hero */
.hero {
  padding: 48px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: start;
}

.hero-title {
  margin: 0 0 28px;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.hero-title .accent {
  color: var(--blue);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  padding: 0 36px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
  animation: pulse-btn 2s ease-in-out infinite;
}

.btn-primary:hover {
  background: var(--blue-dark);
  transform: scale(1.02);
}

@keyframes pulse-btn {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.hero-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
  margin: 32px 0;
}

.benefit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 16px;
  color: var(--text);
}

.benefit-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  position: relative;
}

.benefit-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid var(--blue);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 28px 32px;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
}

.stat-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.stat-label {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
}

.hero-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 3/4;
}

.hero-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
  padding: 20px 22px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.hero-card-name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-card-role {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sections */
.section {
  padding: 56px 0;
}

.section-title {
  margin: 0 0 32px;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.15;
}

.section-title .accent {
  color: var(--blue);
}

/* Help cards */
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.help-card {
  background: #f1f2f4;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
}

.help-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
}

.help-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.help-card h3 {
  margin: 0 0 6px;
  font-size: 36px;
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.1;
}

.help-card p {
  margin: 0;
  color: #31343f;
  font-size: 32px;
  font-size: clamp(18px, 1.7vw, 30px);
  line-height: 1.2;
}

/* Niches carousel (restored) */
.niches-gallery {
  padding-top: 12px;
}

.niches-wrap {
  position: relative;
}

.niches-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.niches-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.niches-track::-webkit-scrollbar {
  display: none;
}

.niche-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
}

.niche-img {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  pointer-events: none;
}

.niche-label {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 500;
  max-width: 200px;
}

.niches-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--blue);
  font-size: 20px;
  cursor: pointer;
}

.nav-btn:hover {
  background: #e5e7eb;
}

/* Process */
.process-box {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.process-title {
  max-width: 920px;
}

.process-box-source {
  padding: 22px;
}

.process-step {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.process-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.process-step-top {
  min-height: 142px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
}

.process-step-bottom {
  max-width: 720px;
  margin: 0 auto;
}

.process-step-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.process-arrow {
  color: #57a4ef;
  font-size: 30px;
  font-weight: 500;
}

.process-step p {
  margin: 0;
  font-size: clamp(20px, 1.7vw, 30px);
  line-height: 1.25;
  color: #1f2937;
}

.process-arrows {
  display: none;
}

/* CTA banners */
.zoom-banner {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  padding: 16px;
  background: var(--blue);
  border-radius: var(--radius-lg);
  color: #fff;
}

.zoom-preview {
  width: 100%;
  height: 100%;
  min-height: 270px;
  border-radius: 24px;
  object-fit: contain;
  background: #fff;
}

.zoom-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.zoom-content h3 {
  margin: 0;
  font-size: clamp(30px, 3vw, 52px);
  line-height: 1.05;
  text-transform: uppercase;
  font-weight: 700;
  max-width: 600px;
}

.zoom-content p {
  margin: 18px 0 20px;
  font-size: clamp(18px, 1.5vw, 28px);
  line-height: 1.25;
  max-width: 640px;
}

.zoom-content .btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 320px;
  min-height: 64px;
  padding: 0 40px;
  text-align: center;
  line-height: 1.2;
}

.btn-white {
  flex-shrink: 0;
  min-height: 56px;
  padding: 0 32px;
  border: none;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--blue);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-white:hover {
  opacity: 0.95;
}


/* Sources */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.source-card {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  min-height: 160px;
  position: relative;
}

.source-icon-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 16px;
}

.source-card p {
  margin: 0;
  font-size: clamp(22px, 1.7vw, 32px);
  line-height: 1.2;
  font-weight: 400;
  max-width: 220px;
}

.source-dot {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
}

.sources-note {
  margin: 24px 0 0;
  padding: 14px 36px;
  background: #005bff;
  border-radius: 999px;
  color: #fff;
  font-size: clamp(15px, 1.35vw, 24px);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .sources-note {
    white-space: normal;
    border-radius: 28px;
    padding: 16px 24px;
  }
}

/* CRM */
.crm-section {
  text-align: center;
}

.crm-row {
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.crm-logo {
  color: #1f2937;
}

.crm-amo {
  color: #2f7ed8;
  font-size: clamp(30px, 3.2vw, 54px);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.crm-bitrix {
  color: #1493d8;
  font-size: clamp(26px, 3vw, 50px);
  font-weight: 600;
}

.crm-sheets {
  color: #3f3f46;
  font-size: clamp(22px, 2.1vw, 36px);
  font-weight: 600;
}

.crm-more {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 16px 22px;
  text-align: left;
  font-size: 30px;
  font-size: clamp(16px, 1.6vw, 28px);
  line-height: 1.2;
}

.crm-more-sub {
  color: #2f855a;
}

/* Testimonials */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.review-card {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 28px;
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-head h3 {
  margin: 0;
  color: #1d4ed8;
  font-size: clamp(20px, 1.8vw, 34px);
  font-weight: 500;
}

.review-head img {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  object-fit: cover;
}

.review-card p {
  margin: 0;
  font-size: clamp(13px, 0.95vw, 16px);
  line-height: 1.4;
  color: var(--text);
}

/* Bottom CTA */
.bottom-cta {
  padding-bottom: 80px;
}

.bottom-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cta-blue {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: center;
  padding: 40px;
  background: var(--blue);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: #fff;
  position: relative;
  z-index: 1;
}

.cta-blue h2 {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 800;
  text-transform: uppercase;
}

.phone-mockup {
  width: 240px;
  border-radius: 32px;
  background: #1a1a1a;
  padding: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.phone-screen {
  background: linear-gradient(180deg, #2a2a2a, #111);
  border-radius: 24px;
  padding: 24px 16px;
  text-align: center;
  min-height: 320px;
}

.phone-screen img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
}

.phone-screen .caller {
  font-weight: 600;
  font-size: 14px;
}

.phone-screen .sub {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}

.form-purple {
  width: 100%;
  background: var(--purple);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 48px 40px 40px;
  color: #fff;
  position: relative;
  z-index: 2;
  margin: 0;
  text-align: center;
}

.form-purple h2 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-purple p {
  margin: 0 0 24px;
  opacity: 0.9;
}

.form-purple input {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 16px;
  display: block;
  padding: 18px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 18px;
  text-align: center;
}

.form-purple-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.form-purple .btn-submit {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--purple);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.form-purple .btn-submit:hover {
  opacity: 0.95;
}

.btn-form-messenger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.btn-form-messenger:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Cookie */
.cookie-popup {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 560px;
  width: calc(100% - 40px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 24px 48px 24px 28px;
  font-size: 14px;
  z-index: 1000;
}

.cookie-popup.visible {
  display: block;
}

.cookie-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  font-size: 18px;
}

/* Lead popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  padding: 20px;
}

.popup-overlay.visible {
  display: flex;
}

.popup-card {
  width: min(720px, 100%);
  background: #fff;
  color: #1a1a1a;
  border-radius: 40px;
  padding: 44px 40px 36px;
  position: relative;
  text-align: left;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.popup-card h2 {
  margin: 0 0 12px;
  padding-right: 36px;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
}

.popup-card p {
  margin: 0 0 24px;
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.35;
  color: #1a1a1a;
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 18px;
  color: #333;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-form-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.lead-form-row .js-phone-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-pill);
  padding: 16px 22px;
  font-size: 18px;
  text-align: left;
  background: #ebebeb;
  color: #1a1a1a;
}

.btn-popup-call {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 28px;
  min-height: 52px;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-popup-messenger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: var(--radius-pill);
  background: #f3f4f6;
  color: var(--blue);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.btn-popup-messenger:hover {
  background: #e8ecf5;
}

@media (max-width: 640px) {
  .popup-card {
    padding: 32px 22px 24px;
    border-radius: 28px;
  }

  .lead-form-row {
    flex-direction: column;
  }

  .btn-popup-call {
    width: 100%;
  }
}

/* Responsive — телефоны, Z Fold (cover ~390px, inner ~620–880px) */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 400px;
    margin: 0 auto;
  }

  .process-row {
    grid-template-columns: 1fr;
  }

  .sources-grid,
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .cta-blue {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .phone-mockup {
    margin: 0 auto;
  }
}

/* Планшет / раскрытый Z Fold: компактная сетка Zoom */
@media (min-width: 600px) and (max-width: 1024px) {
  .zoom-banner {
    grid-template-columns: minmax(200px, 36%) 1fr;
    gap: 20px;
    padding: 20px;
    align-items: center;
  }

  .zoom-preview {
    min-height: 0;
    max-height: 280px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top center;
  }

  .zoom-content h3 {
    font-size: clamp(22px, 3.2vw, 36px);
  }

  .zoom-content p {
    font-size: clamp(16px, 2vw, 22px);
    margin: 12px 0 16px;
  }

  .zoom-content .btn-white {
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    min-height: 56px;
    padding: 0 28px;
  }
}

/* Узкий телефон и внешний экран Fold */
@media (max-width: 599px) {
  .container {
    width: min(var(--container), calc(100% - 32px));
  }

  .section {
    padding: 40px 0;
  }

  .hero {
    padding: 32px 0 48px;
  }

  .btn-primary {
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    font-size: 18px;
  }

  .zoom-banner {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
  }

  .zoom-preview {
    min-height: 0;
    max-height: 200px;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top center;
    border-radius: 16px;
  }

  .zoom-content {
    align-items: center;
    text-align: center;
  }

  .zoom-content h3 {
    font-size: clamp(22px, 6vw, 28px);
    max-width: none;
  }

  .zoom-content p {
    font-size: 16px;
    margin: 12px 0 16px;
    max-width: none;
  }

  .zoom-content .btn-white {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 56px;
    padding: 0 20px;
    font-size: 16px;
  }

  .cta-blue {
    padding: 28px 20px;
    border-radius: 20px 20px 0 0;
  }

  .cta-blue h2 {
    font-size: clamp(18px, 5vw, 24px);
  }

  .form-purple {
    padding: 32px 20px 28px;
    border-radius: 0 0 20px 20px;
  }

  .form-purple h2 {
    font-size: clamp(22px, 6vw, 28px);
  }

  .form-purple-actions,
  .form-purple input {
    max-width: 100%;
  }

  .sources-note {
    font-size: 15px;
    padding: 14px 18px;
  }

  .cookie-popup {
    width: calc(100% - 24px);
    padding: 20px 40px 20px 20px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  .hero-benefits {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .stat-value {
    font-size: 34px;
  }

  .process-box-source {
    padding: 14px;
  }

  .niche-img {
    width: 168px;
    height: 168px;
  }

  .review-head img {
    width: 72px;
    height: 72px;
  }
}

/* Очень узкий экран (часть Fold, старые Android) */
@media (max-width: 380px) {
  .container {
    width: min(var(--container), calc(100% - 24px));
  }

  .header-name {
    font-size: 15px;
  }

  .header-tagline {
    font-size: 13px;
  }

  .zoom-preview {
    max-height: 170px;
  }
}
