/* ===== Hero ===== */

.hero {
  padding-block: 28px 8px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 22ch;
}

.hero-answer {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-72);
  max-width: 56ch;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 38px;
    max-width: 26ch;
  }

  .hero-answer {
    font-size: 17px;
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 44px;
  }
}

/* ===== Section headings ===== */

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .section-head h2 {
    font-size: 28px;
  }
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

#instruction {
  /* небольшой отступ сверху при переходе по кнопке "Смотреть инструкцию" */
  scroll-margin-top: 24px;
  /* Уже, чем стандартный section-padding: на мобильном весь блок
     (заголовок + мокап + описание шага с кнопками) должен помещаться
     на одном экране без скролла. */
  padding-block: 24px 28px;
}

#instruction .section-head {
  margin-bottom: 14px;
}

/* ===== Instruction section layout ===== */

.instruction-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.instruction-panel {
  width: 100%;
  max-width: 340px;
  order: 2;
}

.instruction-mockup {
  order: 1;
  width: 100%;
  /* Мокап ограничен по высоте (в vh), а не только по ширине, чтобы вместе
     с заголовком и панелью шага помещаться в один экран на мобильном —
     на невысоких экранах картинка сама уменьшается. dvh учитывает
     схлопывание адресной строки браузера; vh — фолбэк для браузеров без
     поддержки dvh. */
  max-width: min(220px, 44vw, 23vh);
  max-width: min(220px, 44vw, 23dvh);
  margin-inline: auto;
}

@media (min-width: 900px) {
  #instruction {
    padding-block: 56px;
  }

  #instruction .section-head {
    margin-bottom: 24px;
  }

  .instruction-layout {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 64px;
  }

  .instruction-panel {
    order: 1;
    max-width: 360px;
  }

  .instruction-mockup {
    order: 2;
    max-width: 320px;
    flex-shrink: 0;
  }
}

@media (min-width: 1024px) {
  #instruction {
    padding-block: 72px;
  }
}

/* ===== Calculator section layout ===== */

#calculator {
  /* небольшой отступ сверху при переходе по кнопкам "Рассчитать iCloud"
     из инструкции (тот же приём, что и у #instruction). */
  scroll-margin-top: 24px;
}

.calculator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(20px);
}

@media (min-width: 640px) {
  .calculator-card {
    padding: 28px;
  }
}

.field-group {
  margin-bottom: 22px;
}

.field-label {
  display: block;
  font-size: 14px;
  color: var(--text-60);
  margin-bottom: 10px;
}

.custom-months-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.stepper button {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.stepper button:hover {
  background: var(--surface-hover);
}

.stepper output {
  min-width: 64px;
  text-align: center;
  font-size: 15px;
  color: var(--text);
}
