:root {
  --bg: #fff7f2;
  --hero: #fceaf2;
  --card: #ffffff;
  --ink: #0f3640;
  --muted: #36545c;
  --muted-2: #6a7b7f;
  --line: #f2d9e5;
  --accent: #18b7e2;
  --accent-soft: #e6f6fb;
  --pink: #f7a1c5;
  --blue: #1aa9e6;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px 120px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.section-title {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 32px;
  margin: 0 0 16px;
}

.hero {
  background: var(--hero);
  border-radius: 16px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 44px;
  line-height: 1.05;
  margin: 0 0 12px;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 8px;
}

.hero-meta {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

.btn-secondary {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}

.cta-micro {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 10px;
}

.cover {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff7f2;
  border: 1px solid var(--line);
  width: 100%;
  aspect-ratio: 2 / 3;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
}

.icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.icon-sparkles {
  background: #e6f6fb;
  color: #18b7e2;
}

.icon-check {
  background: #fdeaf3;
  color: #e85c9b;
}

.icon-layers {
  background: #eaf7f0;
  color: #2e9c6a;
}

.review-stars {
  color: #f2b94b;
  font-size: 13px;
}

.link {
  color: var(--accent);
  text-decoration: underline;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.preview-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  min-height: 280px;
}

.tag {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-num {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: 24px;
  color: var(--accent);
}

/* FAQ as clean cards (question + answer in the same card) */
.faq {
  display: grid;
  gap: 14px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

/* Subtle highlight when opened */
.faq-item[open] {
  border-color: rgba(24, 183, 226, 0.45);
  box-shadow: 0 10px 28px rgba(15, 54, 64, 0.08);
}

.faq-q {
  list-style: none;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  user-select: none;
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-q::after {
  content: "+";
  font-weight: 600;
  color: var(--muted-2);
  opacity: 0.8;
  transition: opacity 180ms ease;
}

.faq-item[open] .faq-q::after {
  content: "–";
  opacity: 0.9;
}

/* Override the UA rule that hides details content when closed */
.faq-item > .faq-answer {
  display: block;
}

/* Animated answer reveal */
.faq-answer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;

  /* start collapsed */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 20px;

  transition:
    max-height 320ms ease,
    opacity 180ms ease,
    padding 320ms ease;
}

.faq-item[open] .faq-answer {
  /* enough room for short answers; increase later if needed */
  max-height: 260px;
  opacity: 1;
  padding: 14px 20px 18px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .faq-item,
  .faq-q::after,
  .faq-answer {
    transition: none !important;
  }
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

/* Tablet */
@media (max-width: 1024px) {
  .container {
    padding: 64px 24px 96px;
    gap: 64px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 32px;
    text-align: center;
  }

  .hero-ctas {
    justify-content: center;
  }

  .section-title {
    text-align: center;
    font-size: 28px;
  }

  .cards-3,
  .preview-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .container {
    padding: 40px 20px 80px;
    gap: 56px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-sub {
    font-size: 14px;
  }

  .hero-meta {
    font-size: 12px;
  }

  .section-title {
    font-size: 24px;
  }

  /* Full-width only for the main hero CTA buttons on mobile */
  .hero-ctas .btn {
    width: 100%;
  }

  .footer-links {
    gap: 10px;
  }

  .faq-q {
    font-size: 18px;
    padding: 14px 16px;
  }

  .faq-answer {
    font-size: 15px;
    padding: 0 16px;
  }

  .faq-item[open] .faq-answer {
    padding: 12px 16px 14px;
  }
}

/* ==== Mobile/Tablet center + no horizontal wander ==== */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;          /* гасит “гуляние” */
}

body {
  margin: 0;
  /* На некоторых браузерах прыжки из-за скроллбаров */
  scrollbar-gutter: stable both-edges;
}

/* Гарантированно центрируем основной контейнер */
.container {
  width: 100%;
  max-width: 980px;            /* можно оставить твой max-width, если уже есть */
  margin-left: auto;
  margin-right: auto;
}

/* Чтобы padding не “раздувал” ширину */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Медиа/картинки никогда не выходят за контейнер */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==== PDF viewer: keep centered & responsive ==== */
.pdf-viewer {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.pdf-viewer__body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;  /* важный анти-скролл */
  justify-items: center;
}

/* Перебиваем inline-style, который выставляет JS */
.pdf-canvas {
  display: block;
  margin: 0 auto;
  width: 100% !important;      /* ключ! */
  max-width: 980px;
  height: auto !important;     /* ключ! */
}

/* Center PDF viewer controls on tablet/mobile */
.pdf-viewer__bar,
.viewer__bar {
  width: 100%;
  max-width: 100%;
}

/* If your viewer uses these blocks, keep them centered */
.pdf-viewer__controls,
.viewer__controls {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pdf-viewer__left,
.pdf-viewer__right,
.viewer__left,
.viewer__right {
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 1024px) {
  .pdf-viewer__bar,
  .viewer__bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .pdf-viewer__left,
  .pdf-viewer__right,
  .viewer__left,
  .viewer__right {
    width: 100%;
    justify-content: center;
  }

  .pdf-viewer__controls,
  .viewer__controls {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  /* On small screens: keep controls perfectly centered in 1 row */
  .pdf-viewer__controls,
  .viewer__controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    justify-items: center;
    grid-auto-rows: auto;
  }

  /* Make buttons fill their grid cell for a clean alignment */
  .pdf-viewer__controls .btn,
  .viewer__controls .btn {
    width: 100%;
    min-width: 0;
  }

  /* Center info labels */
  .pdf-viewer__controls .viewer__info,
  .viewer__controls .viewer__info,
  #pageInfo {
    justify-self: center;
    align-self: center;
    text-align: center;
    white-space: nowrap;
  }

  /* Place remaining controls in first row */
  #btnPrev { grid-column: 1; grid-row: 1; }
  #pageInfo { grid-column: 2; grid-row: 1; }
  #btnNext { grid-column: 3; grid-row: 1; }

  /* Download button area stays centered */
  .pdf-viewer__right .btn,
  .viewer__right .btn {
    width: min(320px, 100%);
  }
}
