/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent:       #f4a261;
  --accent-dark:  #e08844;
  --accent-light: #fef5ec;
  --bg:           #ffffff;
  --text:         #333333;
  --text-muted:   #777777;
  --border:       #e5e7eb;
  --radius:       10px;
  --shadow:       0 2px 16px rgba(0,0,0,0.07);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Top Banner ── */
.top-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 1rem;
  letter-spacing: 0.01em;
}

.top-banner strong {
  font-weight: 700;
}

/* ── Header ── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-home {
  color: var(--text);
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-home:hover {
  opacity: 1;
  text-decoration: none;
}

.nav-left a:not(.nav-home) {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  text-decoration: none;
}

.nav-left a:not(.nav-home):hover {
  color: var(--text);
  text-decoration: none;
}

.btn-login {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-login:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Hero Section ── */
.hero {
  background: #fff;
  padding: 0;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 93px);
}

/* Left column */
.hero-left {
  padding: 4rem 3rem 4rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-left h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 460px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.tab {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Form */
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 460px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--accent);
}

.form-group input[type="text"] {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 162, 97, 0.15);
}

.form-group input[type="text"]::placeholder {
  color: #bdbdbd;
}

/* Gender Toggle */
.gender-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.gender-btn {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.gender-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gender-btn span {
  display: block;
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.gender-btn:not(:first-child) span {
  border-left: 1.5px solid var(--border);
}

.gender-btn:has(input:checked) span {
  background: var(--accent);
  color: #fff;
}

.gender-btn:hover span {
  background: var(--accent-light);
}

.gender-btn:has(input:checked):hover span {
  background: var(--accent-dark);
}

/* Row of two selects */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
  background: #fff;
  outline: none;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color 0.2s;
}

.form-select:focus {
  border-color: var(--accent);
}

/* Submit button */
.btn-calc {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
  margin-top: 4px;
}

.btn-calc:hover {
  background: var(--accent-dark);
}

.btn-calc:active {
  transform: scale(0.98);
}

.form-note {
  font-size: 0.74rem;
  color: #aaa;
  text-align: center;
  line-height: 1.5;
}

/* Right column (hero image) */
.hero-right {
  position: relative;
  overflow: hidden;
}

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

/* ── Features Section ── */
.features-section {
  background: #fafafa;
  border-top: 1px solid var(--border);
  padding: 6rem 2rem;
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.features-left h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2rem;
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.features-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.5;
}

.check-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: #d1fae5;
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.features-right {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: 600px;
}

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

/* ── Footer ── */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ── Preview Page ── */
.preview-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

/* Greeting */
.result-greeting {
  text-align: center;
  margin-bottom: 2.5rem;
}

.result-greeting h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.result-greeting-sub {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 520px;
  margin: 0 auto;
}

/* Cards */
.result-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 2.5rem;
}

.result-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  padding: 24px;
  border: 1px solid var(--border);
}

.result-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-light);
}

.result-block {
  margin-bottom: 1.1rem;
}

.result-block:last-child {
  margin-bottom: 0;
}

.result-block-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.result-block-text {
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.7;
}

/* CTA block */
.result-cta {
  text-align: center;
  background: var(--accent-light);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(244,162,97,0.25);
}

.result-cta-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.1rem;
  line-height: 1.5;
}

.btn-pay {
  display: inline-block;
  padding: 14px 40px;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.btn-pay:hover {
  background: var(--accent-dark);
}

.btn-pay:active {
  transform: scale(0.98);
}

/* Error state */
.result-error {
  text-align: center;
  padding: 3rem 1.5rem;
}

.result-error-icon {
  width: 48px;
  height: 48px;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 auto 1rem;
}

.result-error h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.result-error p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.97rem;
}

.btn-back {
  display: inline-block;
  padding: 10px 24px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.btn-back:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  /* Скрываем большую фоновую картинку на мобильных —
     пользователь сразу попадает на форму без прокрутки */
  .hero-right {
    display: none;
  }

  .hero-left {
    padding: 2.5rem 1.5rem;
  }

  .features-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .features-right {
    order: -1;
    max-height: 300px;
  }
}

@media (max-width: 600px) {
  .tabs {
    gap: 5px;
  }

  .tab {
    padding: 5px 12px;
    font-size: 0.78rem;
  }

  .hero-left h1 {
    font-size: 1.45rem;
  }

  .features-section {
    padding: 3.5rem 1.25rem;
  }
}

/* ── Accordion Paywall ── */

/* Отступ снизу чтобы content не перекрывался sticky-баром */
.preview-page {
  padding-bottom: 110px;
}

/* Контейнер аккордеона */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.5rem;
}

/* Базовый элемент */
.accordion-item {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}

/* Бесплатный раздел */
.accordion-item--free {
  border-color: rgba(244, 162, 97, 0.35);
  box-shadow: 0 4px 16px rgba(244, 162, 97, 0.1);
}

/* Бейдж «Бесплатный фрагмент» */
.free-badge {
  background: #d1fae5;
  color: #059669;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(5, 150, 105, 0.12);
}

/* Шапка бесплатного раздела */
.accordion-header--free {
  padding: 16px 20px 8px;
}

/* Элемент аккордеона (заблокированный) — обёртка details */
details.accordion-item--locked {
  cursor: pointer;
}

details.accordion-item--locked:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Строка summary */
.accordion-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: background 0.15s;
}

.accordion-summary::-webkit-details-marker { display: none; }
.accordion-summary::marker              { display: none; }

details[open] > .accordion-summary {
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

/* Иконка замка */
.lock-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  line-height: 1;
}

/* Заголовок раздела */
.accordion-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

/* Шеврон + / × */
.accordion-chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  color: #6b7280;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 300;
  transition: transform 0.22s ease, background 0.15s;
  margin-left: auto;
}

.accordion-chevron::before {
  content: '+';
}

details[open] > .accordion-summary .accordion-chevron {
  transform: rotate(45deg);
  background: var(--accent-light);
  color: var(--accent);
}

/* Тело (контент) */
.accordion-body {
  padding: 0 20px 22px;
  animation: acFadeIn 0.18s ease;
}

@keyframes acFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Тело бесплатного раздела */
.accordion-item--free .accordion-body {
  padding-top: 4px;
}

/* Тело с тизером (закрытые разделы) */
.accordion-body--teaser {
  padding-top: 16px;
}

.teaser-text {
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.68;
  margin-bottom: 0.6rem;
}

.teaser-locked {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px 12px;
  background: #fef3e2;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  display: inline-block;
}

/* ── Sticky CTA ── */
.paywall-cta-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.09);
  z-index: 300;
  padding: 10px 1.25rem 14px;
}

.paywall-cta-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.paywall-cta-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.btn-pay--full {
  width: 100%;
  max-width: 440px;
}

/* iOS home-bar safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .paywall-cta-sticky {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

/* ── Accordion responsive ── */
@media (max-width: 600px) {
  .accordion-title {
    font-size: 0.95rem;
  }

  .accordion-summary {
    padding: 14px 16px;
    gap: 8px;
  }

  .accordion-body {
    padding: 0 16px 18px;
  }

  .accordion-body--teaser {
    padding-top: 14px;
  }

  .accordion-header--free {
    padding: 14px 16px 8px;
  }

  .free-badge {
    font-size: 0.69rem;
    padding: 5px 14px;
  }

  .paywall-cta-hint {
    font-size: 0.8rem;
  }

  .result-greeting h1 {
    font-size: 1.4rem;
  }
}
