/* ============================================================
   Выходное интервью — оформление
   Палитра красно-серая; значения перекрываются из
   assets/config/settings.json (brand.colors) через JS.
   ============================================================ */

:root {
  --red: #E11B22;
  --red-dark: #B3141A;
  --red-light: #FF3B41;
  --graphite: #16171A;
  --graphite-soft: #1F2126;
  --gray: #6E727C;
  --gray-light: #D7DAE0;
  --surface: #F4F5F7;
  --white: #FFFFFF;

  --ink: var(--graphite);
  --ink-muted: var(--gray);
  --ink-soft: #5F646D;
  --placeholder: #7E838C;
  --line: #E3E6EA;
  --line-soft: #EEF0F3;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 8px rgba(22, 23, 26, .06);
  --shadow: 0 10px 30px rgba(22, 23, 26, .09);
  --shadow-lg: 0 26px 60px rgba(22, 23, 26, .16);
  --shadow-red: 0 12px 30px rgba(225, 27, 34, .28);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --speed: 1;

  --header-h: 74px;
  --wrap: 1120px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Убирает зум по двойному тапу — на телефоне должна работать мобильная вёрстка,
     а не уменьшенная десктопная. */
  touch-action: manipulation;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.022em; font-weight: 800; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--red) 55%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Фон: дышащие красные пятна и сетка ---------- */

.bg-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -20%, #FFFFFF 0%, var(--surface) 55%),
    var(--surface);
}

/* Мягкость даёт сам радиальный градиент. filter: blur() поверх него
   перерисовывал сотни тысяч пикселей каждый кадр и ронял анимации до 1 FPS. */
.orb {
  position: absolute;
  border-radius: 50%;
  opacity: .55;
  will-change: transform;
  transform: translateZ(0);
}
.orb--1 {
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px;
  top: -14vw; left: -10vw;
  background: radial-gradient(circle at 38% 38%, rgba(255, 59, 65, .5) 0%, rgba(225, 27, 34, .22) 42%, rgba(225, 27, 34, .06) 68%, transparent 82%);
  animation: drift-a calc(26s / var(--speed)) var(--ease) infinite alternate;
}
.orb--2 {
  width: 38vw; height: 38vw; min-width: 260px; min-height: 260px;
  top: 32vh; right: -12vw;
  background: radial-gradient(circle at 58% 42%, rgba(110, 114, 124, .34) 0%, rgba(110, 114, 124, .14) 45%, rgba(22, 23, 26, .04) 70%, transparent 84%);
  animation: drift-b calc(32s / var(--speed)) var(--ease) infinite alternate;
}
.orb--3 {
  width: 30vw; height: 30vw; min-width: 220px; min-height: 220px;
  bottom: -14vw; left: 28vw;
  background: radial-gradient(circle at 50% 50%, rgba(225, 27, 34, .3) 0%, rgba(225, 27, 34, .1) 46%, transparent 80%);
  animation: drift-c calc(38s / var(--speed)) var(--ease) infinite alternate;
}

.grid-lines {
  position: absolute;
  inset: 0;
  contain: strict;
  background-image:
    linear-gradient(rgba(22, 23, 26, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 23, 26, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(90% 70% at 50% 30%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(90% 70% at 50% 30%, #000 25%, transparent 78%);
}

/* Движение фона — только там, где оно часть впечатления (главная, финал).
   На экранах ввода, на узких экранах и на слабых устройствах пятна замирают:
   анимация трёх больших градиентов заметно съедает кадры. */
body.bg-still .orb { animation: none; }

@media (max-width: 760px) {
  .orb { animation: none; }
}

@keyframes drift-a { to { transform: translate3d(9vw, 7vh, 0) scale(1.16); } }
@keyframes drift-b { to { transform: translate3d(-11vw, -9vh, 0) scale(1.12); } }
@keyframes drift-c { to { transform: translate3d(7vw, -6vh, 0) scale(.88); } }

/* Тёмный фон — для hero и финального экрана */
body.theme-dark { background: var(--graphite); color: #fff; }
body.theme-dark .bg-field {
  background:
    radial-gradient(130% 90% at 50% -10%, #2A2C32 0%, var(--graphite) 58%),
    var(--graphite);
}
body.theme-dark .grid-lines {
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
}
body.theme-dark .orb { opacity: .62; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 40px);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255, 255, 255, .74);
  border-bottom: 1px solid var(--line-soft);
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
body.theme-dark .site-header {
  background: rgba(22, 23, 26, .62);
  border-bottom-color: rgba(255, 255, 255, .08);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__logo {
  height: 40px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  transition: transform .5s var(--ease-out);
}
.brand:hover .brand__logo { transform: scale(1.04) rotate(-.6deg); }
.brand__name {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.theme-dark .brand__name { color: #fff; border-left-color: rgba(255, 255, 255, .18); }

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}
body.theme-dark .header-meta { color: rgba(255, 255, 255, .62); }

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(225, 27, 34, .09);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
body.theme-dark .step-pill { background: rgba(255, 59, 65, .16); color: #FF7B7F; }

/* ---------- Прогресс ---------- */

.progress-rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(22, 23, 26, .07);
  z-index: 60;
}
body.theme-dark .progress-rail { background: rgba(255, 255, 255, .1); }
.progress-rail__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red-dark), var(--red), var(--red-light));
  box-shadow: 0 0 14px rgba(225, 27, 34, .6);
  transition: width .55s var(--ease-out);
}

/* ---------- Контейнер страниц ---------- */

.view { flex: 1 0 auto; position: relative; }

.page { width: 100%; }

/* Переход между страницами: уходящая уезжает влево, приходящая — снизу */
.page--enter { animation: page-in calc(.52s / var(--speed)) var(--ease-out) both; }
.page--leave { animation: page-out calc(.26s / var(--speed)) var(--ease) both; }
.page--back.page--enter { animation-name: page-in-back; }
.page--back.page--leave { animation-name: page-out-back; }

@keyframes page-in { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }
@keyframes page-out { to { opacity: 0; transform: translate3d(-34px, 0, 0); } }
@keyframes page-in-back { from { opacity: 0; transform: translate3d(-26px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes page-out-back { to { opacity: 0; transform: translate3d(34px, 0, 0); } }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Появление блоков по очереди */
.rise { animation: rise calc(.7s / var(--speed)) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }

/* ---------- Кнопки ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.005em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .32s var(--ease-out), box-shadow .32s var(--ease-out), background-color .25s var(--ease), color .25s var(--ease), opacity .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:active { transform: none; }

.btn--primary {
  background: linear-gradient(135deg, var(--red-light), var(--red) 42%, var(--red-dark));
  color: #fff;
  box-shadow: var(--shadow-red);
}
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.btn--primary:hover:not([disabled]) { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(225, 27, 34, .38); }
.btn--primary:hover:not([disabled])::after { opacity: 1; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--ghost:hover:not([disabled]) { box-shadow: inset 0 0 0 1.5px var(--red); color: var(--red); transform: translateY(-1px); }
body.theme-dark .btn--ghost { color: rgba(255, 255, 255, .9); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .24); }
body.theme-dark .btn--ghost:hover:not([disabled]) { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6); color: #fff; }

.btn--text {
  background: none;
  padding: 12px 16px;
  color: var(--ink-muted);
  font-weight: 600;
  box-shadow: none;
}
.btn--text:hover:not([disabled]) { color: var(--red); }

.btn--lg { padding: 18px 38px; font-size: 16.5px; }
.btn--block { width: 100%; }

/* Волна от клика */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, .45);
  animation: ripple .6s var(--ease-out) forwards;
  pointer-events: none;
}
.btn--ghost .ripple, .btn--text .ripple { background: rgba(225, 27, 34, .18); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

.btn__arrow { transition: transform .35s var(--ease-out); }
.btn:hover:not([disabled]) .btn__arrow { transform: translateX(4px); }

/* ---------- Лендинг: hero ---------- */

.hero {
  position: relative;
  padding: clamp(48px, 9vh, 104px) 0 clamp(56px, 10vh, 108px);
  text-align: center;
  color: #fff;
  background:
    radial-gradient(64% 52% at 16% 8%, rgba(255, 59, 65, .26), transparent 68%),
    radial-gradient(52% 44% at 88% 62%, rgba(120, 124, 134, .20), transparent 70%),
    linear-gradient(180deg, #15161A 0%, #1D1E23 52%, #141519 100%);
}
.hero__inner { max-width: 880px; margin: 0 auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .92);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
/* Пульсация сделана на transform/opacity отдельного кольца.
   Через box-shadow она перерисовывала область каждый кадр и стоила половины FPS. */
.eyebrow__dot {
  position: relative;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red-light);
}
.eyebrow__dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(255, 59, 65, .55);
  transform: scale(1);
  opacity: .8;
  will-change: transform, opacity;
  animation: pulse calc(2.4s / var(--speed)) var(--ease-out) infinite;
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(3.4); opacity: 0; }
  100% { transform: scale(3.4); opacity: 0; }
}

.hero__title {
  margin: 26px 0 0;
  font-size: clamp(38px, 7.2vw, 76px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.02;
}
.hero__title .accent {
  background: linear-gradient(120deg, var(--red-light), var(--red) 55%, #FF8A8E);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Заголовок собирается по словам */
.word { display: inline-block; animation: word-in calc(.85s / var(--speed)) var(--ease-out) both; }
@keyframes word-in {
  from { opacity: 0; transform: translate3d(0, 34px, 0) rotate(3deg); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.hero__subtitle {
  margin: 26px auto 0;
  max-width: 640px;
  font-size: clamp(16px, 2.1vw, 19px);
  line-height: 1.62;
  color: rgba(255, 255, 255, .74);
}

.hero__actions {
  margin-top: 38px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__meta {
  margin-top: 30px;
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, .5);
  font-size: 13.5px;
  font-weight: 500;
}
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Лендинг: карточки ---------- */

.section { padding: clamp(56px, 9vh, 96px) 0; }
.section--light {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  color: var(--ink);
  position: relative;
  box-shadow: 0 -20px 60px rgba(22, 23, 26, .22);
}

.section__head { max-width: 660px; margin: 0 auto clamp(34px, 5vh, 56px); text-align: center; }
.section__label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
}
.section__title { margin-top: 12px; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.03em; }
.section__text { margin-top: 14px; color: var(--ink-muted); font-size: 16.5px; }

.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); }

.card {
  position: relative;
  padding: 32px 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .45s var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--red-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }

.card__icon {
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(225, 27, 34, .12), rgba(255, 59, 65, .05));
  color: var(--red);
  margin-bottom: 20px;
  transition: transform .5s var(--ease-out);
}
.card:hover .card__icon { transform: scale(1.08) rotate(-4deg); }
.card__title { font-size: 18.5px; font-weight: 800; letter-spacing: -.02em; }
.card__text { margin-top: 10px; color: var(--ink-muted); font-size: 15px; line-height: 1.62; }

/* Шаги */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); counter-reset: step; }
.step {
  position: relative;
  padding: 30px 26px 26px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: transform .45s var(--ease-out), background-color .45s var(--ease), border-color .45s var(--ease);
}
.step:hover { transform: translateY(-4px); background: var(--white); border-color: var(--line); box-shadow: var(--shadow); }
.step__num {
  counter-increment: step;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: var(--shadow-red);
  margin-bottom: 18px;
}
.step__num::before { content: counter(step); }
.step__title { font-size: 17.5px; font-weight: 800; }
.step__text { margin-top: 8px; color: var(--ink-muted); font-size: 14.8px; line-height: 1.6; }

.cta-band {
  margin-top: clamp(40px, 6vh, 64px);
  padding: clamp(34px, 6vw, 54px);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--graphite), var(--graphite-soft) 60%, #2C1416);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  right: -140px; top: -190px;
  background: radial-gradient(circle, rgba(225, 27, 34, .45), transparent 66%);
  filter: blur(28px);
}
.cta-band > * { position: relative; }
.cta-band__title { font-size: clamp(24px, 3.6vw, 34px); letter-spacing: -.028em; }
.cta-band__text { margin: 12px auto 26px; max-width: 520px; color: rgba(255, 255, 255, .72); font-size: 16px; }

/* Появление по скроллу */
.reveal { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   Экран вопроса
   ============================================================ */

.q-page {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(30px, 6vh, 60px) clamp(16px, 4vw, 40px) 40px;
}

.q-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

.q-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: .04em;
}
.q-counter__total { color: var(--ink-soft); }

.q-section-tag {
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(22, 23, 26, .05);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.q-optional {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.q-title {
  font-size: clamp(25px, 4.2vw, 38px);
  font-weight: 800;
  letter-spacing: -.032em;
  line-height: 1.16;
}
.q-desc { margin-top: 14px; color: var(--ink-muted); font-size: 16px; line-height: 1.6; max-width: 620px; }

.q-body { margin-top: clamp(26px, 4vh, 38px); }

.q-foot {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.q-foot__spacer { flex: 1 1 auto; }
.q-hint { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.q-hint kbd {
  display: inline-block;
  padding: 2px 7px;
  margin: 0 2px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--white);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* ---------- Варианты: один / несколько ---------- */

.options { display: grid; gap: 11px; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 20px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .3s var(--ease-out), border-color .28s var(--ease), box-shadow .3s var(--ease-out), background-color .28s var(--ease);
  animation: option-in calc(.5s / var(--speed)) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 42ms);
  -webkit-tap-highlight-color: transparent;
}
@keyframes option-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

.option:hover { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); transform: translateX(4px); box-shadow: var(--shadow-sm); }
.option.is-selected {
  border-color: var(--red);
  background: linear-gradient(100deg, rgba(225, 27, 34, .06), rgba(225, 27, 34, .015));
  box-shadow: 0 8px 22px rgba(225, 27, 34, .14);
}
.option input { position: absolute; opacity: 0; pointer-events: none; }

.option__key {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-muted);
  transition: all .3s var(--ease-out);
}
.option.is-selected .option__key {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: transparent;
  color: #fff;
  transform: scale(1.06);
  box-shadow: var(--shadow-red);
}
.option--multi .option__key { border-radius: 9px; }
.option--multi .option__key svg { opacity: 0; transform: scale(.4); transition: opacity .24s var(--ease), transform .3s var(--ease-out); }
.option--multi.is-selected .option__key svg { opacity: 1; transform: none; }

.option__label { flex: 1 1 auto; font-size: 15.8px; font-weight: 550; line-height: 1.45; }
.option.is-selected .option__label { font-weight: 650; }

.option__check {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  opacity: 0;
  transform: scale(.5);
  transition: all .3s var(--ease-out);
  color: var(--red);
}
.option.is-selected .option__check { opacity: 1; transform: scale(1); }

/* Свой вариант */
.other-box { margin-top: 12px; animation: option-in .45s var(--ease-out) both; }
.other-input {
  width: 100%;
  padding: 15px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 15.5px;
  transition: border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.other-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(225, 27, 34, .1); }

/* ---------- Шкала ---------- */

.scale { display: flex; flex-direction: column; gap: 14px; }
.scale__row { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: 1fr; }

.scale__btn {
  position: relative;
  padding: 22px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-muted);
  cursor: pointer;
  transition: transform .3s var(--ease-out), border-color .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), box-shadow .3s var(--ease-out);
  animation: option-in calc(.5s / var(--speed)) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 34ms);
}
.scale__btn:hover { transform: translateY(-4px); border-color: var(--red); color: var(--red); }
.scale__btn.is-selected {
  background: linear-gradient(135deg, var(--red-light), var(--red) 45%, var(--red-dark));
  border-color: transparent;
  color: #fff;
  transform: translateY(-4px) scale(1.04);
  box-shadow: var(--shadow-red);
}

.scale__labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-muted); }

/* Индекс лояльности: 0–10 */
.nps .scale__row { gap: 6px; }
.nps .scale__btn { padding: 18px 4px; font-size: 16.5px; border-radius: 12px; }
.nps-legend { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12.5px; font-weight: 600; }
.nps-legend .neg { color: var(--red); }
.nps-legend .pos { color: #1E8E4A; }

/* ---------- Звёзды ---------- */

.rating { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 12px 0; }
.rating__stars { display: flex; gap: 10px; }
.rating__star {
  width: clamp(46px, 11vw, 62px);
  height: clamp(46px, 11vw, 62px);
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #C2C7CE;
  transition: transform .3s var(--ease-out), color .25s var(--ease);
  animation: option-in .5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.rating__star svg { width: 100%; height: 100%; }
.rating__star:hover { transform: scale(1.18) rotate(-6deg); color: var(--red-light); }
.rating__star.is-on { color: var(--red); animation: star-pop .45s var(--ease-out); }
@keyframes star-pop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
.rating__label { font-size: 17px; font-weight: 750; color: var(--red); min-height: 26px; transition: opacity .25s var(--ease); }

/* ---------- Текстовые поля ---------- */

.field { position: relative; }
.field__input, .field__textarea, .field__select {
  width: 100%;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 16.5px;
  line-height: 1.55;
  transition: border-color .28s var(--ease), box-shadow .28s var(--ease), transform .28s var(--ease-out);
}
.field__textarea { resize: vertical; min-height: 140px; font-family: inherit; }
.field__input:focus, .field__textarea:focus, .field__select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 27, 34, .1);
}
.field__input::placeholder, .field__textarea::placeholder { color: var(--placeholder); }

.field__counter {
  margin-top: 9px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color .25s var(--ease);
}
.field__counter.is-near { color: var(--red); }

.field__select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236E727C' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 20px center; padding-right: 46px; }

/* Да / нет */
.boolean { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.boolean__btn {
  padding: 26px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 17px;
  font-weight: 750;
  cursor: pointer;
  transition: all .3s var(--ease-out);
}
.boolean__btn:hover { transform: translateY(-3px); border-color: var(--red); }
.boolean__btn.is-selected { background: linear-gradient(135deg, var(--red-light), var(--red-dark)); border-color: transparent; color: #fff; box-shadow: var(--shadow-red); }

/* ---------- Экран телефона ---------- */

.phone-page {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(34px, 8vh, 76px) clamp(16px, 4vw, 40px) 50px;
  text-align: center;
}
.phone-card {
  padding: clamp(30px, 5vw, 46px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.phone-icon {
  width: 66px; height: 66px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: var(--shadow-red);
  animation: float-soft calc(3.6s / var(--speed)) var(--ease) infinite alternate;
}
@keyframes float-soft { to { transform: translateY(-8px); } }

.phone-title { font-size: clamp(24px, 4vw, 32px); letter-spacing: -.03em; }
.phone-subtitle { margin-top: 13px; color: var(--ink-muted); font-size: 15.8px; line-height: 1.6; }

.phone-input {
  width: 100%;
  margin-top: 30px;
  padding: 20px 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 750;
  letter-spacing: .04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: all .3s var(--ease-out);
}
.phone-input:focus { outline: none; border-color: var(--red); background: var(--white); box-shadow: 0 0 0 5px rgba(225, 27, 34, .1); }
.phone-input.is-valid { border-color: #1E8E4A; }
.phone-input.is-error { border-color: var(--red); animation: shake .42s var(--ease); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 30%, 70% { transform: translateX(5px); } 50% { transform: translateX(-7px); } }

.phone-hint { margin-top: 14px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.phone-error { margin-top: 12px; font-size: 14px; font-weight: 650; color: var(--red); min-height: 20px; }

.consent {
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 15px 17px;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: background-color .25s var(--ease);
}
.consent:hover { background: #ECEEF1; }
.consent input { position: absolute; opacity: 0; pointer-events: none; }
.consent__box {
  flex: 0 0 auto;
  width: 23px; height: 23px;
  margin-top: 1px;
  border: 1.5px solid #B6BBC3;
  border-radius: 7px;
  background: var(--white);
  display: grid;
  place-items: center;
  color: #fff;
  transition: all .28s var(--ease-out);
}
.consent input:checked + .consent__box { background: var(--red); border-color: var(--red); transform: scale(1.06); }
.consent__box svg { opacity: 0; transform: scale(.4); transition: all .25s var(--ease-out); }
.consent input:checked + .consent__box svg { opacity: 1; transform: scale(1); }
.consent__text { font-size: 14.2px; line-height: 1.5; color: var(--ink-muted); }

/* ---------- Финальный экран ---------- */

.done-page {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(50px, 12vh, 120px) clamp(16px, 4vw, 40px) 70px;
  text-align: center;
  color: #fff;
}
.done-mark { width: 118px; height: 118px; margin: 0 auto 34px; }
.done-mark__circle {
  stroke: var(--red);
  stroke-width: 4;
  fill: none;
  stroke-dasharray: 326;
  stroke-dashoffset: 326;
  animation: draw-circle calc(1s / var(--speed)) var(--ease-out) forwards;
  filter: drop-shadow(0 0 14px rgba(225, 27, 34, .55));
}
.done-mark__tick {
  stroke: #fff;
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  animation: draw-tick calc(.5s / var(--speed)) var(--ease-out) .75s forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-tick { to { stroke-dashoffset: 0; } }

.done-title { font-size: clamp(30px, 5.6vw, 46px); letter-spacing: -.032em; }
.done-subtitle { margin-top: 18px; color: rgba(255, 255, 255, .74); font-size: 17px; line-height: 1.62; }
.done-note {
  margin-top: 30px;
  padding: 16px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 14.5px;
  color: rgba(255, 255, 255, .72);
}

.confetti {
  position: fixed;
  top: -12px;
  width: 9px; height: 15px;
  z-index: 50;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0; } }

/* ---------- Уведомление ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 130%);
  z-index: 90;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--graphite);
  color: #fff;
  font-size: 14.5px;
  font-weight: 650;
  box-shadow: var(--shadow-lg);
  transition: transform .45s var(--ease-out);
  max-width: min(92vw, 460px);
  text-align: center;
}
.toast.is-shown { transform: translate(-50%, 0); }
.toast--error { background: var(--red-dark); }

/* ---------- Подвал ---------- */

.site-footer {
  flex: 0 0 auto;
  padding: 26px clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .5);
}
body.theme-dark .site-footer { border-top-color: rgba(255, 255, 255, .07); background: transparent; color: rgba(255, 255, 255, .42); }
.site-footer .dot { opacity: .45; }

/* ---------- Загрузка ---------- */

.loader { display: grid; place-items: center; min-height: 62vh; gap: 18px; }
.loader__spin {
  width: 42px; height: 42px;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader__text { color: var(--ink-muted); font-size: 14.5px; font-weight: 600; }

.error-box {
  max-width: 560px;
  margin: 10vh auto;
  padding: 34px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.error-box h2 { font-size: 21px; margin-bottom: 10px; }
.error-box p { color: var(--ink-muted); font-size: 15px; }
.error-box code { display: block; margin-top: 14px; padding: 12px; background: var(--surface); border-radius: 8px; font-size: 13px; color: var(--red-dark); word-break: break-word; }

/* ---------- Адаптив ---------- */

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .brand__logo { height: 32px; }
  .brand__name { display: none; }
  .hero { padding-top: 34px; }
  .scale__row { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(5, 1fr); }
  .nps .scale__row { grid-template-columns: repeat(6, 1fr); }
  .q-foot { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--surface) 26%); padding-bottom: 14px; margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px; }
  .q-hint { display: none; }
  .btn { padding: 14px 24px; font-size: 15px; }
  .btn--lg { padding: 16px 28px; font-size: 15.5px; }
  .option { padding: 15px 16px; gap: 12px; }
  .option__label { font-size: 15.2px; }
}

@media (max-width: 420px) {
  .hero__actions .btn { width: 100%; }
  .boolean { grid-template-columns: 1fr; }
  .rating__stars { gap: 6px; }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print { .site-header, .site-footer, .bg-field, .progress-rail { display: none; } }

/* Уходящая страница не должна перехватывать клики во время анимации. */
.page--leave { pointer-events: none; }

/* ---------- Поле с подсказкой из справочника ---------- */

.sg { position: relative; }
.sg__pane[hidden] { display: none; }

.sg__list {
  position: absolute;
  z-index: 30;
  left: 0; right: 0;
  margin-top: 8px;
  max-height: 336px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: sg-in .22s var(--ease-out) both;
}
@keyframes sg-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.sg__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .18s var(--ease);
}
.sg__row:last-child { border-bottom: 0; }
.sg__row:hover, .sg__row.is-active { background: rgba(225, 27, 34, .06); }

.sg__num {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sg__row.is-active .sg__num, .sg__row:hover .sg__num { background: var(--red); color: #fff; }

.sg__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sg__main { font-size: 15px; font-weight: 600; color: var(--ink); }
.sg__sub { font-size: 12.5px; color: var(--ink-soft); }
.sg__mark { background: rgba(225, 27, 34, .16); color: inherit; border-radius: 3px; padding: 0 1px; }

.sg__empty { padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sg__empty span { font-size: 14.5px; color: var(--ink-soft); }
.sg__empty-action {
  border: 0;
  background: none;
  padding: 0;
  color: var(--red);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sg__chosen {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(30, 142, 74, .08);
  border: 1px solid rgba(30, 142, 74, .22);
  animation: option-in .3s var(--ease-out) both;
}
.sg__chosen-inner { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: #16693B; }
.sg__chosen-inner svg { flex: 0 0 auto; }

/* Переключатель между справочником и ручным вводом */
.sg__switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 15px;
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .22s var(--ease), border-color .22s var(--ease), background-color .22s var(--ease);
}
.sg__switch:hover { color: var(--red); border-color: var(--red); background: rgba(225, 27, 34, .04); }
.sg__switch svg { flex: 0 0 auto; }

.sg__manual { animation: option-in .32s var(--ease-out) both; }
.sg__manual-label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 650; color: var(--ink); }
.sg__manual-hint { margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

@media (max-width: 760px) {
  .sg__list { max-height: 260px; }
  .sg__row { padding: 11px 13px; gap: 11px; }
  .sg__num { min-width: 54px; font-size: 12px; }
  .sg__main { font-size: 14.5px; }
  .sg__switch { width: 100%; justify-content: center; }
}

/* Значок на экране «анкета уже заполнена» */
.already-mark {
  width: 96px; height: 96px;
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(225, 27, 34, .14);
  border: 2px solid rgba(225, 27, 34, .5);
  color: var(--red-light);
}

/* Кнопка в момент запроса к серверу */
.btn.is-busy { opacity: .7; cursor: progress; }
