/* styles.css — edfind.ru. Палитра раздела 3 ТЗ. Mobile-first ≥360px. Один акцент (фиолетовый),
   без градиентов/свечений/эмодзи. Радиусы 8–16px, мягкие тени. */

:root {
  --accent: #7B2FBE;
  --accent-hover: #5f1f97;
  --ink: #1A1A2E;
  --ink-2: #3a3a52;
  --ink-3: #8a8a98;
  --line: #e7e4ee;
  --lilac: #f6f1fb;
  --bg: #ffffff;
  --bg-alt: #fafafd;
  --ok-text: #1f9d6b;
  --ok-bg: #eef6f1;
  --shadow: 0 4px 24px rgba(26, 26, 46, .06);
  --r-btn: 9px;
  --r-card: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

h1, h2, h3 { letter-spacing: -0.01em; margin: 0; }
h1 { font-weight: 800; font-size: 2rem; line-height: 1.12; }
h2 { font-weight: 800; font-size: 1.5rem; line-height: 1.18; margin-bottom: 10px; }
h3 { font-weight: 700; font-size: 1.06rem; }
p { margin: 0 0 10px; }

a { color: inherit; }

.overline {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 8px;
}

/* ── Кнопки ── */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  font-family: inherit;
  border: none;
  border-radius: var(--r-btn);
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}
.btn:hover, .btn:active { background: var(--accent-hover); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

.link-secondary {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: .95rem;
}
.link-secondary:hover { text-decoration: underline; }

/* ── Hero ── */
.hero { padding: 44px 0 36px; }
.pill {
  display: inline-block;
  background: var(--lilac);
  color: var(--accent);
  font-weight: 600;
  font-size: .82rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-sub { color: var(--ink-2); font-size: 1.08rem; max-width: 640px; margin: 14px 0 22px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 18px; }
.hero-note { color: var(--accent); font-size: .9rem; font-weight: 600; margin: 0 0 14px; }
.hero-fine { color: var(--ink-3); font-size: .85rem; max-width: 560px; }

/* ── Секции ── */
.section { padding: 48px 0; }
.section.alt { background: var(--bg-alt); }
.section-sub { color: var(--ink-2); font-size: 1.02rem; max-width: 680px; margin-bottom: 24px; }

/* Шаги */
.steps, .cards-3 { display: grid; gap: 16px; }
.step-card, .info-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
  box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--lilac); color: var(--accent);
  font-weight: 800; margin-bottom: 12px;
}
.step-card h3, .info-card h3 { margin-bottom: 8px; }
.step-card p, .info-card p { color: var(--ink-2); font-size: .94rem; margin: 0; }

/* Превью результата */
.preview-grid { display: grid; gap: 28px; }
.bullets { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.bullets li { color: var(--ink-2); font-size: .96rem; line-height: 1.5; }
.bullets strong { color: var(--ink); display: block; }
.preview-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px;
  box-shadow: var(--shadow);
}
.preview-card-title { font-weight: 800; font-size: 1.05rem; margin-bottom: 16px; }

/* Полосы топ-3 (общие для превью и результата) */
.bar-row { margin-bottom: 14px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bar-name { font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.bar-row.lead .bar-name { color: var(--accent); font-weight: 700; }
.bar-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; background: var(--lilac); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: #c9b6e2; border-radius: 999px; transition: width .9s ease; }
.bar-fill.lead { background: var(--accent); }

/* Блок разбора */
.analysis-box { background: var(--lilac); border-radius: 12px; padding: 16px; margin-top: 16px; }
.analysis-title { font-weight: 700; color: var(--accent); font-size: .9rem; margin: 0 0 6px; }
.analysis-text { color: var(--ink-2); font-size: .92rem; margin: 0; }

/* Чипы */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; font-size: .88rem; color: var(--ink-2);
}

/* Цифры */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat { text-align: center; padding: 14px; }
.stat-num { display: block; font-weight: 800; font-size: 2rem; color: var(--accent); letter-spacing: -0.02em; }
.stat-cap { display: block; color: var(--ink-3); font-size: .85rem; margin-top: 4px; }

/* Финальный CTA */
.final-cta { text-align: center; background: var(--bg-alt); }
.final-cta .section-sub { margin-left: auto; margin-right: auto; }

/* ── Футер ── */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; background: var(--bg); }
.footer-inner p { color: var(--ink-3); font-size: .85rem; margin: 0 0 8px; }
.offer { margin: 18px 0 0; padding: 16px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px; }
.offer-title { color: var(--ink-2) !important; font-weight: 700; }
.offer-req { font-size: .78rem !important; }

/* ── Оверлеи (тест / расчёт / результат) ── */
.overlay-view {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Тест */
.test-shell { max-width: 640px; margin: 0 auto; padding: 32px 16px 60px; min-height: 100%; }
.progress { height: 8px; background: var(--lilac); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.step-label { color: var(--ink-3); font-size: .82rem; margin: 14px 0 4px; }
.question-text { font-weight: 800; font-size: 1.4rem; line-height: 1.25; margin-bottom: 22px; }

.answers { display: grid; gap: 12px; }
.answer {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--bg); border: 1.5px solid var(--line);
  border-radius: var(--r-btn); padding: 16px 18px;
  font-family: inherit; font-size: 1rem; color: var(--ink);
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.answer:hover { border-color: var(--accent); background: var(--lilac); }
.marker {
  flex: 0 0 20px; width: 20px; height: 20px;
  border: 2px solid var(--line); border-radius: 50%;
  transition: border-color .15s ease;
}
.answer:hover .marker { border-color: var(--accent); }
.answer-text { flex: 1; }

.test-nav { margin-top: 22px; }
.test-nav.center { text-align: center; }
.back-btn {
  background: none; border: none; color: var(--accent);
  font-family: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; padding: 8px 4px;
}
.back-btn:hover { text-decoration: underline; }

/* Расчёт */
/* :not([hidden]) — иначе ID-селектор перебивает [hidden] и спиннер виден на загрузке */
.overlay-view[hidden] { display: none; }
#calc-view:not([hidden]) { display: flex; align-items: center; justify-content: center; }
.calc-shell { text-align: center; padding: 24px; }
.spinner {
  width: 42px; height: 42px; margin: 0 auto 20px;
  border: 4px solid var(--lilac); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.calc-main { font-weight: 800; font-size: 1.25rem; margin-bottom: 6px; }
.calc-sub { color: var(--ink-3); font-size: .9rem; margin: 0; }

/* Результат */
.result-shell { max-width: 640px; margin: 0 auto; padding: 32px 16px 60px; animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-h2 { font-size: 1.6rem; margin-bottom: 20px; }
.result-h3 { margin-bottom: 12px; }
.bars { margin-bottom: 24px; }
.result-block { margin: 24px 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--ok-bg); color: var(--ok-text); border-radius: 8px; padding: 6px 12px; font-size: .85rem; font-weight: 600; }

.start-list { margin: 0; padding-left: 18px; color: var(--ink-2); }
.start-list li { margin-bottom: 8px; font-size: .94rem; }

.course-card { background: var(--lilac); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; margin: 26px 0; }
.course-title { margin: 4px 0 10px; }
.course-meta { color: var(--ink-2); font-size: .9rem; margin-bottom: 4px; }
.course-price { color: var(--ink-2); font-size: .9rem; margin-bottom: 16px; }
.course-btn { display: inline-block; }

.disclaimer { color: var(--ink-3); font-size: .8rem; }
.result-disclaimer { margin-top: 18px; }

/* ── Десктоп ── */
@media (min-width: 720px) {
  h1 { font-size: 2.9rem; }
  h2 { font-size: 1.9rem; }
  .hero { padding: 72px 0 56px; }
  .steps, .cards-3 { grid-template-columns: 1fr 1fr 1fr; }
  .preview-grid { grid-template-columns: 1.05fr 1fr; align-items: start; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
