/* ============================================================
   RUNGEL «Стартовый разбор бегуна» — стили раздела сайта.

   Собственных цветов у раздела нет: внутренние переменные — это
   псевдонимы токенов дизайн-системы из tokens.css темы. Поэтому смена
   палитры на сайте меняет и разбор, а второго набора цветов в проекте
   не появляется.
   ============================================================ */

:root {
  --bg:       var(--rg-bg);
  --ink:      var(--rg-ink);
  --accent:   var(--rg-moss);
  --accent-2: var(--rg-taiga);
  --cta:      linear-gradient(100deg, var(--rg-taiga), var(--rg-moss));
  --card:     var(--rg-surface);
  --line:     var(--rg-line);
  --line-2:   var(--rg-line-soft);
  --muted:    var(--rg-muted);
  --muted-2:  var(--rg-faint);
  --muted-3:  var(--rg-faint);
  --ink-soft: var(--rg-text);
  --radius:   var(--rg-r-lg);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--rg-font-text);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--rg-surface); }
input, textarea, button { font-family: inherit; }
button { cursor: pointer; }

/* ---- keyframes ---- */
@keyframes cardIn   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes runDot   { 0% { left: 0; } 100% { left: calc(100% - 16px); } }
@keyframes pulseWord{ 0%,100% { opacity: .35; letter-spacing: .14em; } 50% { opacity: 1; letter-spacing: .2em; } }
@keyframes floatBlob{ 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(12px,-16px) scale(1.06); } }
@keyframes softIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes stepIn   { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- screens ---- */
/* Экран — это шаг раздела, а не окно браузера: сверху шапка сайта, снизу
   подвал. Высоту первого экрана задаёт компонент темы `.rg-hero`. */
.screen { width: 100%; position: relative; overflow-x: hidden; }
.screen[hidden] { display: none !important; }
.quiz, .loading, .result, .error { min-height: min(76vh, 900px); }

.brand { font-weight: 800; letter-spacing: .16em; }
.brand span { color: var(--accent); }

/* Реальный логотип RUNGEL (прозрачный PNG, чёрный артворк) */
.brand-logo { display: block; height: 30px; width: auto; max-width: 62%; }
.brand-logo--hero { height: 90px; }   /* интро — крупно */
.brand-logo--step { height: 60px; }   /* шапка опроса */
.brand-logo--result { height: 60px; } /* шапка результата */
.brand-logo--on-dark { filter: brightness(0) invert(1); } /* чёрный → белый на тёмном фоне */

.eyebrow {
  font-size: 12.5px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}

/* ---- buttons ----
   Форма кнопок общая с сайтом: капсула (`--rg-r-pill`). Раньше здесь
   было своё скругление 14–16 px, и разбор выглядел отдельным продуктом. */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 17px 30px; border: 0; border-radius: var(--rg-r-pill);
  background: var(--cta); color: var(--rg-surface); font-size: 17px; font-weight: 800; letter-spacing: .01em;
  text-decoration: none;
  box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--rg-moss) 90%, transparent);
  transition: transform .14s ease, box-shadow .14s ease, opacity .15s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -14px color-mix(in srgb, var(--rg-moss) 90%, transparent); }
.btn-primary:active { transform: translateY(0); }
.btn-primary .arrow { font-size: 19px; line-height: 1; }
.btn-primary.is-disabled { opacity: .4; pointer-events: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px; border-radius: var(--rg-r-pill); border: 1.5px solid var(--rg-line);
  background: var(--rg-surface); color: var(--ink); font-size: 15px; font-weight: 700;
  transition: border-color .15s;
}
.btn-secondary:hover { border-color: color-mix(in srgb, var(--rg-ink) 22%, var(--rg-line)); }

/* ============ ПЕРВЫЙ ЭКРАН ============ */
/* Сам экран — компонент темы `.rg-hero--start`: фотография, градиент
   и типографика там же, где у главной и лендинга партнёрской программы.
   Здесь только то, чего в теме нет. */

.start-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--rg-s-3);
  padding: var(--rg-section) var(--rg-gutter);
}

/* Раньше в карточке было два слова и много воздуха — читалось как
   недоделанный черновик. Номер в кружке держит порядок, второе
   предложение отвечает на вопрос «а что именно вы спросите». */
.start-fact {
  display: flex;
  flex-direction: column;
  gap: var(--rg-s-3);
  padding: clamp(22px, 2.4vw, 30px);
  background: var(--rg-surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--rg-moss);
  border-radius: var(--rg-r-lg);
  transition: transform var(--rg-ease), box-shadow var(--rg-ease);
}
.start-fact:hover { transform: translateY(-2px); box-shadow: var(--rg-shadow-card); }

/* Номер шага кружком: три карточки перестают быть просто текстом,
   и порядок «портрет → план → гели» читается до чтения. */
.start-fact__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rg-moss) 14%, transparent);
  color: var(--rg-taiga);
  font-family: var(--rg-font-mono);
  font-size: var(--rg-body-sm);
  font-weight: 600;
  letter-spacing: .04em;
}
.start-fact__h {
  margin: 0;
  font-family: var(--rg-font-display);
  font-size: var(--rg-h3);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.start-fact__p {
  margin: 0;
  font-size: var(--rg-body-sm);
  line-height: 1.6;
  color: var(--rg-text);
  text-wrap: pretty;
}


/* ============ ОПРОС ============ */
/* Подпись раздела над шагами опроса. */
.topbar__tag {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted-2);
}

.quiz { display: flex; flex-direction: column; background: var(--bg); }
.quiz__top {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--rg-bg) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--rg-line-soft);
}
.quiz__top-inner { max-width: 600px; margin: 0 auto; padding: 16px 22px 0; }
.quiz__meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.quiz__meta .brand { font-size: 16px; }
.quiz__step-count { font-size: 12.5px; font-weight: 700; color: var(--muted-2); letter-spacing: .04em; }
.progress { height: 6px; border-radius: 999px; background: var(--rg-surface-muted); overflow: hidden; margin-bottom: 14px; }
.progress__bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--rg-moss), var(--rg-taiga));
  width: 0; transition: width .45s cubic-bezier(.2,.7,.2,1); }

.quiz__body {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 26px 22px 20px; max-width: 600px; width: 100%; margin: 0 auto;
}
.step { animation: stepIn .32s cubic-bezier(.2,.7,.2,1) both; }
.step.is-back { animation-name: stepInBack; }
.step.no-anim { animation: none; }
.step__block { margin-bottom: 12px; }
.step__title {
  font-size: clamp(26px, 7vw, 34px); line-height: 1.08; font-weight: 800;
  letter-spacing: -.02em; margin: 0 0 8px;
}
.step__hint { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 26px; line-height: 1.45; }
.step__hint:empty { display: none; }

.choices { display: flex; flex-direction: column; gap: 11px; }
.chip {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px;
  border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--rg-surface);
  font-size: 16px; font-weight: 600; color: var(--ink); text-align: left; line-height: 1.3;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.chip:hover { border-color: color-mix(in srgb, var(--rg-moss) 45%, transparent); transform: translateY(-1px); }
.chip.is-selected {
  border-color: var(--accent); background: color-mix(in srgb, var(--rg-moss) 6%, transparent);
  box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--rg-moss) 85%, transparent);
}
.chip.is-selected:hover { transform: translateY(-1px); }
.chip:active { transform: scale(.99); }
.chip__emoji { font-size: 22px; flex: 0 0 auto; width: 26px; text-align: center; }
.chip__label { flex: 1; text-align: left; line-height: 1.35; }
.chip__mark {
  flex: 0 0 auto; width: 26px; height: 26px; border: 2px solid var(--rg-line);
  display: flex; align-items: center; justify-content: center; color: var(--rg-surface);
  font-size: 14px; font-weight: 800; transition: all .15s; border-radius: 50%;
}
.chip--multi .chip__mark { border-radius: 8px; }
.chip.is-selected .chip__mark { border-color: var(--accent); background: var(--accent); }

.measure { display: flex; gap: 12px; }
.measure__field {
  flex: 1; background: var(--rg-surface); border: 1.5px solid var(--line-2); border-radius: 16px; padding: 14px 16px; display: block;
}
.measure__field span {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
.measure__field input {
  border: 0; outline: none; width: 100%; font-size: 26px; font-weight: 800; color: var(--ink); background: transparent;
}

.note { background: var(--rg-surface); border: 1.5px solid var(--line-2); border-radius: 16px; padding: 14px 16px; }
.note textarea {
  border: 0; outline: none; width: 100%; resize: none; font-size: 16px; line-height: 1.5; color: var(--ink); background: transparent;
}
.note__count { text-align: right; font-size: 12px; font-weight: 700; color: var(--rg-faint); }

.recap { background: var(--rg-surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.recap__title { font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 12px; }
.recap__rows { display: flex; flex-direction: column; gap: 9px; }
.recap-row { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.recap-row span:first-child { color: var(--muted-2); font-weight: 600; }
.recap-row span:last-child { font-weight: 700; text-align: right; }
.consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 2px; }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
.consent span { font-size: 14.5px; line-height: 1.5; color: var(--rg-text); font-weight: 500; }

.quiz__footer {
  position: sticky; bottom: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rg-bg) 0%, transparent), var(--rg-bg) 26%);
  padding: 14px 22px calc(18px + env(safe-area-inset-bottom));
}
.quiz__footer-inner { max-width: 600px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.nav-back {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: var(--rg-r-pill); border: 1.5px solid var(--rg-line);
  background: var(--rg-surface); color: var(--ink); font-size: 22px; font-weight: 800; transition: border-color .15s;
}
.nav-back:hover { border-color: color-mix(in srgb, var(--rg-ink) 22%, var(--rg-line)); }
.nav-skip {
  flex: 1; height: 56px; border-radius: var(--rg-r-pill); border: 1.5px solid var(--rg-line); background: var(--rg-surface);
  color: var(--rg-text); font-size: 16px; font-weight: 700; transition: border-color .15s;
}
.nav-skip:hover { border-color: color-mix(in srgb, var(--rg-ink) 22%, var(--rg-line)); }
.nav-primary {
  flex: 1; height: 56px; border: 0; border-radius: var(--rg-r-pill); background: var(--cta); color: var(--rg-surface);
  font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--rg-moss) 85%, transparent); transition: transform .14s, opacity .15s;
}
.nav-primary:hover { transform: translateY(-2px); }
.nav-primary.is-disabled { opacity: .4; pointer-events: none; box-shadow: none; }
.nav-primary .arrow { font-size: 19px; line-height: 1; margin-left: 4px; }

/* ============ LOADING ============ */
.loading {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center;
  background: radial-gradient(120% 80% at 50% 30%, color-mix(in srgb, var(--rg-moss) 8%, var(--rg-bg)), var(--rg-bg));
}
.loading__logo { display: block; height: 48px; width: auto; margin-bottom: 44px; animation: pulseWord 1.6s ease-in-out infinite; }
.loading__track { position: relative; width: min(320px, 80vw); height: 4px; border-radius: 999px; background: var(--rg-surface-muted); margin-bottom: 38px; }
.loading__dot {
  position: absolute; top: -6px; left: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--cta); box-shadow: 0 0 18px 2px color-mix(in srgb, var(--rg-moss) 55%, transparent);
  animation: runDot 1.5s cubic-bezier(.65,0,.35,1) infinite alternate;
}
.loading__text { font-size: 19px; font-weight: 700; color: var(--rg-ink-2); min-height: 26px; animation: softIn .4s both; }
.loading__sub { font-size: 13.5px; color: var(--muted-3); font-weight: 600; margin-top: 10px; }

/* ============ RESULT ============ */
.result { min-height: 100dvh; background: var(--bg); padding-bottom: 40px; }
.result__hero {
  background: linear-gradient(150deg, var(--rg-ink), var(--rg-taiga-deep)); color: var(--rg-surface);
  padding: 26px 22px 34px; position: relative; overflow: hidden;
}
.result__hero-blob {
  position: absolute; top: -80px; right: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rg-moss) 40%, transparent), transparent); pointer-events: none;
}
.result__hero-inner { max-width: 640px; margin: 0 auto; position: relative; }
.result__top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px;
}
.result__top .brand span { color: var(--rg-moss-light); }
.result__top .tag { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.result__greeting {
  font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rg-moss-light); margin-bottom: 14px; animation: fadeUp .5s both;
}
.result__snapshot {
  font-size: clamp(19px, 5vw, 24px); line-height: 1.4; font-weight: 600; margin: 0;
  letter-spacing: -.01em; animation: fadeUp .5s .08s both;
}
.result__body { max-width: 640px; margin: 0 auto; padding: 0 22px; }

.section { margin-top: 32px; }
.section__label { margin-bottom: 14px; }
.summary { margin-top: 26px; animation: cardIn .5s .05s both; }
.summary .section__label { margin-bottom: 10px; }
.summary p { font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); font-weight: 500; margin: 0; }

.plan { display: flex; flex-direction: column; gap: 12px; }
.plan-card {
  background: var(--rg-surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px;
  animation: cardIn .5s both;
}
.plan-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.plan-card__badge {
  font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: color-mix(in srgb, var(--rg-moss) 10%, transparent); color: var(--accent); padding: 5px 11px; border-radius: 999px;
}
.plan-card__focus { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.plan-card__details { font-size: 15px; line-height: 1.55; color: var(--rg-text); font-weight: 500; }

.tips { display: flex; flex-direction: column; gap: 10px; }
.tip { display: flex; gap: 12px; align-items: flex-start; background: var(--rg-surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tip__dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; }
.tip span:last-child { font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); font-weight: 500; }

.nutri {
  margin-top: 36px; background: var(--rg-surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 22px; box-shadow: 0 20px 46px -30px rgba(0,0,0,.3);
}
.nutri__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.nutri__badge {
  display: inline-flex; align-items: baseline; gap: 5px; background: var(--cta); color: var(--rg-surface);
  padding: 6px 13px; border-radius: 999px;
}
.nutri__badge b { font-size: 18px; font-weight: 800; line-height: 1; }
.nutri__badge small { font-size: 12px; font-weight: 700; }
.nutri__logic { font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); font-weight: 500; margin: 0 0 12px; }
.nutri__when { display: flex; gap: 10px; align-items: flex-start; background: var(--rg-bg-soft); border-radius: 14px; padding: 13px 15px; margin-bottom: 20px; }
.nutri__when b { font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: .05em; text-transform: uppercase; flex: 0 0 auto; margin-top: 2px; }
.nutri__when span { font-size: 14.5px; line-height: 1.5; color: var(--rg-ink-2); font-weight: 600; }
.prods { display: flex; flex-direction: column; gap: 11px; }
.prod { display: flex; gap: 14px; align-items: flex-start; background: var(--rg-bg-soft); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; animation: cardIn .5s both;
  text-decoration: none; color: inherit; transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease; }
.prod:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--rg-moss) 40%, var(--rg-line)); box-shadow: 0 10px 24px -18px rgba(0,0,0,.4); }
.prod__go { align-self: center; flex: 0 0 auto; font-size: 18px; font-weight: 800; color: var(--rg-faint); transition: transform .15s ease, color .15s ease; }
.prod:hover .prod__go { color: var(--accent); transform: translateX(3px); }
.prod__dot {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; color: var(--rg-surface);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
}
.prod__body { flex: 1; min-width: 0; }
.prod__name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.prod__name { font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; }
.prod__badge { font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--rg-surface); padding: 4px 10px; border-radius: 999px; }
.prod__reason { font-size: 14px; line-height: 1.5; color: var(--rg-text); font-weight: 500; margin-top: 4px; }

.kit {
  margin-top: 14px; background: linear-gradient(150deg, var(--rg-ink), var(--rg-taiga-deep)); color: var(--rg-surface);
  border-radius: 22px; padding: 24px; position: relative; overflow: hidden;
}
.kit__blob {
  position: absolute; bottom: -70px; right: -50px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rg-moss-light) 35%, transparent), transparent 70%); pointer-events: none;
}
.kit__inner { position: relative; }
.kit__label { color: var(--rg-moss-light); margin-bottom: 12px; }
.kit__row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.kit__set { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.kit__price { font-size: 24px; font-weight: 800; color: var(--rg-moss-light); }
.kit__note { font-size: 14.5px; line-height: 1.5; color: rgba(255,255,255,.7); font-weight: 500; margin-bottom: 20px; }
.kit__cta { width: 100%; padding: 17px; }

.motivation {
  margin-top: 28px; text-align: center; padding: 6px 4px;
  font-size: clamp(22px, 6vw, 28px); line-height: 1.25; font-weight: 800; letter-spacing: -.02em;
  background: var(--cta); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.disclaimer { margin: 26px 0 22px; font-size: 12.5px; line-height: 1.5; color: var(--rg-faint); text-align: center; font-weight: 500; }
.result__actions { display: flex; gap: 12px; }
.result__actions .btn-secondary { flex: 1; }

/* ============ ERROR ============ */
.error {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center;
}
.error__icon {
  width: 72px; height: 72px; border-radius: 20px; background: var(--rg-surface); border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 34px; margin-bottom: 24px;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.3);
}
.error h2 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 10px; }
.error p { font-size: 16px; line-height: 1.5; color: var(--rg-text); font-weight: 500; max-width: 340px; margin: 0 0 28px; }
.error__retry { padding: 16px 30px; font-size: 17px; }


/* ============================================================
   ШАПКА САЙТА

   Раздел «Стартовый разбор» — часть сайта, а не отдельное приложение:
   сверху те же разделы, что и в шапке магазина, и с любого экрана
   опроса можно вернуться назад.

   Оформление шапки лежит в теме (`assets/css/header.css`) и подключается
   отсюда как есть: вторая копия неизбежно разошлась бы с сайтом.
   ============================================================ */

/* Экраны опроса занимали всю высоту окна; теперь над ними шапка. */
.screen { min-height: calc(100dvh - var(--rg-header-h)); }
}
