/************* FONT START *************/

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter_18pt-Medium.woff2") format("woff2");
  src: url("../fonts/Inter_18pt-Medium.woff") format("woff");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Inter_18pt-SemiBold.woff2") format("woff2");
  src: url("../fonts/Inter_18pt-SemiBold.woff") format("woff");
}

@font-face {
  font-family: "Domine";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Domine-Bold.woff2") format("woff2");
  src: url("../fonts/Domine-Bold.woff") format("woff");
}

/************* COLOR START *************/

:root {
  --primary-color: #E5654B;

  --body-bg: #F5F1EE;

  --text-white: #F5F1EE;

  --tertiary-hover: #E5654B66;

  --secondary-active: #B2331A;
}

/************* COMMON START *************/

html {
  box-sizing: border-box;
}

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

ul,
ol {
  padding: 0;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
figure,
figcaption,
blockquote,
dl,
dt {
  margin: 0;
}

ul {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

address {
  font-style: normal;
}

input,
textarea {
  outline: transparent;
  border: none;
}

button {
  padding: 0;
  border: none;
  background-color: transparent;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

body {
  font-family: "Inter", Arial, Helvetica, sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: var(--primary-color);
  background-color: var(--body-bg);
  overflow: hidden;
}

.main {
  flex-grow: 1;
  min-height: 100dvh;
}

.container {
  max-width: 768px;
  width: 100%;
  min-height: 100dvh;
  padding: 0 16px;
  margin: 0 auto;
}

/************* PRELOADER START *************/

.preloader,
.preloader-step {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--body-bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  animation: preloaderLoading 2s ease forwards;
}
@keyframes preloaderLoading {
  0% {
    opacity: 1;
  }
  30% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  98% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    display: none;
  }
}

.preloader-step {
  animation: preloaderStep 1.1s ease forwards;
}
@keyframes preloaderStep {
  0% {
    opacity: 0.7;
  }

  30% {
    opacity: 0.7;
  }

  70% {
    opacity: 0.7;
  }

  98% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    display: none;
  }
}

.preloader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.preloader__top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.preloader__text1 {
  font-size: 14px;
}

.preloader__text2 {
  font-size: 20px;
  font-weight: 600;
}

.preloader__text1,
.preloader__text2 {
  opacity: 0;
  transform: translateY(20px);
  animation: textFadeUp 2s ease forwards;
}
@keyframes textFadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  30% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.loader {
  height: 4px;
  width: 200px;
  border-radius: 8px;
  --c: no-repeat linear-gradient(#B2331A 0 0);
  background: var(--c), var(--c), var(--tertiary-hover);
  background-size: 60% 100%;
  animation: l16 3s infinite;
}
@keyframes l16 {
  0% {
    background-position: -150% 0, -150% 0
  }
  66% {
    background-position: 250% 0, -150% 0
  }
  100% {
    background-position: 250% 0, 250% 0
  }
}

.speed-loader {
  width: 56px;
  padding: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--secondary-active);
  --_m:
    conic-gradient(#0000 10%, #000),
    linear-gradient(#000 0 0) content-box;
  -webkit-mask: var(--_m);
  mask: var(--_m);
  -webkit-mask-composite: source-out;
  mask-composite: subtract;
  animation: l3 1s infinite linear;
}
@keyframes l3 {
  to {
    transform: rotate(1turn)
  }
}

/************* MOB-FORM START *************/

.text-body {
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.text-body span {
  color: var(--secondary-active)
}

.font-size-14 {
  font-size: 14px;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.title-box {
  margin-bottom: clamp(14px, 3.5dvh, 40px);
}
.title-box-mb {
  margin-bottom: clamp(20px, 5dvh, 60px);
}
.title-box-mb-14 {
  margin-bottom: 14px;
}

.text-image {
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -1.8px;
  font-weight: 500;
  font-family: "Inter";
  margin-bottom: 14px;
}

.title {
  font-size: clamp(40px, 7.5dvh, 64px);
  line-height: 0.8;
  letter-spacing: -1.9px;
  font-family: "Domine";
  font-weight: 700;
  margin-bottom: 11px;
}
.step-title {
  font-size: clamp(30px, 5.5dvh, 48px);
  line-height: 1;
}
.thank-title {
  font-family: "Domine";
  font-size: clamp(24px, 4dvh, 32px);
  line-height: 1;
  letter-spacing: -1px;
}
.title-mb {
  margin-bottom: 14px;
  line-height: 0.9;
}

.subtitle {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -1.0px;
  font-weight: 600;
  font-family: "Inter";
}

.subtitle span {
  color: var(--secondary-active)
}

.step-subtitle {
  font-family: "Inter";
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -1px;
}

.mob-form {
  min-height: 100dvh;
  background: url(../image/bg-mobile.png) top center / contain repeat;
}

.mob-form__wrap {
  padding: clamp(16px, 4dvh, 40px) 0 clamp(12px, 2dvh, 16px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mob-form__top {
  flex: 1;
  min-height: 0;
  /* На очень коротких экранах (iOS Safari с тулбарами) тяжёлый шаг может
     не влезть — даём контенту прокрутку вместо молчаливой обрезки. */
  overflow-x: hidden;
  overflow-y: auto;
  /* Рамка выбора у кнопок левой/правой колонки выступает на 6px (inset:-6px)
     и упиралась в этот overflow-x:hidden → левая грань обрезалась. Даём 6px
     внутреннего поля под выступ и гасим его отрицательным margin, чтобы
     контент не сдвинулся. */
  padding-inline: 6px;
  margin-inline: -6px;
}

/* Прогресс-бар: вместо png-чашек рисуем аккуратные кружочки с цифрами прямо
   в CSS. Номера — через counter (по позиции <li>, цифра в разметку не нужна).
   Состояние берём из имени файла картинки: цветная = пройдено/текущее,
   `-white` = впереди. Сам <img> прячем — заодно пропадают битые плейсхолдеры
   для несуществующих png 7–10. Цвета — из переменных темы (любой сценарий). */
.progress-list {
  display: flex;
  gap: clamp(4px, 1.6vw, 9px);
  margin-bottom: 8px;
  flex-wrap: nowrap;
  counter-reset: step;
}

.progress-list__item {
  flex-shrink: 0;
  counter-increment: step;
  display: flex;
}

.progress-list__img {
  display: none;
}

/* кружок с номером (по умолчанию — пройдено/текущее: залит цветом темы) */
.progress-list__item::before {
  content: counter(step);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: clamp(20px, 6.2vw, 30px);
  height: clamp(20px, 6.2vw, 30px);
  border-radius: 50%;
  border: 1.5px solid var(--primary-color);
  background: var(--primary-color);
  color: var(--text-white);
  font-family: "Inter";
  font-weight: 600;
  font-size: clamp(10px, 3.2vw, 14px);
  line-height: 1;
}

/* шаги впереди (картинка `-white`): контур без заливки, приглушённый */
.progress-list__item:has(.progress-list__img[src*="-white"])::before {
  background: transparent;
  color: var(--primary-color);
  opacity: 0.5;
}

/* Бэк отдаёт фикс. 10 <li>, но реальных картинок-шагов всего 6
   (progress_bar-1..6). Элементы 7–10 ссылаются на несуществующие png —
   это заглушки-паддинг. Прячем их целиком, чтобы кружков было ровно по числу
   вопросов, а не 10. (Картинок >6 в проекте нет, поэтому верх упирается в 6.) */
.progress-list__item:has(.progress-list__img[src*="progress_bar-7"]),
.progress-list__item:has(.progress-list__img[src*="progress_bar-8"]),
.progress-list__item:has(.progress-list__img[src*="progress_bar-9"]),
.progress-list__item:has(.progress-list__img[src*="progress_bar-10"]) {
  display: none;
}

.form-feedback {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.form-feedback__input {
  width: 100%;
  height: 68px;
  padding: 24px 12px;
  border: 1px solid var(--primary-color);
  margin-top: 12px;
  margin-bottom: 8px;
  background-color: transparent;
  color: var(--primary-color);
  font-weight: 500;
  font-family: "Inter";
  font-style: normal;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.form-feedback__input::placeholder {
  color: var(--primary-color);
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.form-feedback__input:focus,
.form-feedback__input:active {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.box-width {
  max-width: 83%;
  margin-bottom: 20px;
}

.form-feedback__error {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none; 
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  margin-top: 6px;
}

.form-feedback__error.is-visible {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 20px 12px;
  border-radius: 8px;
  background-color: var(--tertiary-hover);
  color: var(--secondary-active);
  border: 1px dashed var(--secondary-active);
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-bottom: 82px;
}

.form-feedback__bottom,
.mob-form__bottom {
  margin-top: auto;
  flex-shrink: 0;
}

.form-feedback__checkbox {
  position: absolute;
  z-index: -1;
  opacity: 0;
}

.form-feedback__checkbox+label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.form-feedback__checkbox+label::before {
  content: url(../image/chekbox.png);
  display: inline-block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  flex-grow: 0;
  margin-bottom: 8px;
  border: 1px solid transparent;
  border-radius: 50%;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 50% 50%;
}

.form-feedback__btn,
.mob-form__button {
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: var(--primary-color);
  color: var(--text-white);
  margin-top: 20px;
  font-family: "Inter";
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.mob-form__image {
  max-width: 180px;
  width: 100%;
  max-height: clamp(120px, 22dvh, 300px);
  margin: 0 auto;
  display: flex;
  margin-bottom: 20px;
}

.step-box-btn {
  display: flex;
  gap: 12px;
  align-items: center;
}

.step-back {
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.step-button {
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  font-family: "Inter";
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -1.0px;
  transition: opacity 0.3s ease;
}
.step-button.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}


.mob-form__image-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-column-gap: 12px;
  grid-row-gap: clamp(14px, 3.5dvh, 49px);
  margin-bottom: clamp(16px, 4dvh, 60px);
  max-width: 400px;
  width: 100%;
}

.mob-form__image-box--most {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 375px;
}

.mob-form__rate-box {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-column-gap: 8px;
  align-items: center;
  margin-bottom: clamp(4px, 1dvh, 12px);
  max-width: 400px;
  width: 100%;
}

.mob-form__answer {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mob-form__block-text {
  display: flex;
  font-family: "Inter";
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(14px, 3.5dvh, 60px);
  max-width: 400px;
  width: 100%;
}

.answer-btn-would {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  width: 101px;
  height: auto;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--primary-color);
  font-family: "Inter";
  position: relative;
}
.answer-btn-would .is-active {
  position: relative;
}

/* Кольцо выбора. Раньше бэк рисовал sketchy-рамку картинкой (background-image
   на кнопке/псевдоэлементе), нарисованную двойным штрихом → визуально две
   обводки. Делаем ровно одну чистую рамку:
   1) пустое состояние — ничего (правило только на .is-active);
   2) на .is-active — один аккуратный контур через ::before;
   3) любой фон-картинку бэка на кнопке и её псевдоэлементах глушим, чтобы не
      двоилось. Специфичность поднята через .mob-form__image-box + !important,
      чтобы перебить бэкендовый стиль. Сам смайлик (<img>) не трогаем. */
.mob-form__image-box .answer-btn-would.is-active::before {
  content: '' !important;
  position: absolute;
  inset: -6px;
  background: none !important;
  border: 2px solid var(--primary-color) !important;
  border-radius: 14px !important;
  pointer-events: none;
}

.mob-form__image-box .answer-btn-would.is-active,
.mob-form__image-box .answer-btn-would.is-active > *:not(img) {
  background: none !important;
}

/* Синяя «вторая рамка» на нажатом ответе — это браузерный фокус-контур по
   границе кнопки (внутри нашей рамки). Убираем, чтобы осталась одна рамка. */
.mob-form__image-box .answer-btn-would:focus,
.mob-form__image-box .answer-btn-would:focus-visible {
  outline: none !important;
}

/* Два глаза в верхней части рамки: вместе со смайлом-ртом (картинкой) активный
   ответ читается как «рожица». Левый глаз — сам ::after, правый — его box-shadow
   (симметрично центра, расстояние между зрачками = 32px). */
.mob-form__image-box .answer-btn-would.is-active::after {
  content: '' !important;
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  margin-left: -16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary-color) !important;
  box-shadow: 32px 0 0 var(--primary-color);
  pointer-events: none;
}

.answer-btn-rate,
.answer-btn-most,
.answer-btn-staff,
.answer-btn-options {
  font-weight: 500;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  font-family: "Inter";
  width: 62px;
  height: 62px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.answer-btn-most,
.answer-btn-staff,
.answer-btn-options {
  width: auto;
  height: clamp(48px, 8dvh, 64px);
  padding: 20px;
  white-space: nowrap;
  font-size: clamp(16px, 2.5dvh, 20px);
  line-height: 1;
  letter-spacing: -1px;
}
.answer-btn-rate.is-active,
.answer-btn-most.is-active,
.answer-btn-staff.is-active,
.answer-btn-options.is-active {
  color: var(--text-white);
  background-color: var(--primary-color);
}

.answer-close {
  width: 24px;
  height: 24px;
  margin-left: 8px;
  display: none;
}

.answer-btn-options.is-active .answer-close{
  display: block;
}

.answer-icon {
  position: relative;
}

.answer-icon__img {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
}

.answer-preview {
  display: flex;
  justify-content: center;
  margin: auto 40px clamp(16px, 3dvh, 40px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.answer-preview.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.answer-preview__img {
  width: clamp(100px, 18dvh, 210px);
  height: auto;
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 400px;
  width: 100%;
  margin-bottom: 16px;
}

.category-btn {
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.4px;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  font-family: "Inter";
  border-radius: 40px;
  padding: 4px 8px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.category-btn.is-active {
  color: var(--text-white);
  background-color: var(--primary-color);
}

.category-btn svg {
  transform: translateY(1px);
}

.category-btn.is-active svg{
  transform: rotate(-45deg);
}

.mob-form__textatea {
  max-width: 400px;
  width: 100%;
  min-height: clamp(80px, 15dvh, 212px);
  overflow-y: auto;
  background-color: transparent;
  padding: 12px;
  border: 1px solid var(--primary-color);
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-family: "Inter";
  color: var(--primary-color);
  resize: none;
}
.mob-form__textatea::placeholder {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-family: "Inter";
  color: var(--primary-color);
}

.mob-form__textatea::-webkit-scrollbar {
  width: 8px;
}

.mob-form__textatea::-webkit-scrollbar-track {
  background: var(--tertiary-hover);
}

.mob-form__textatea::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
}

.mob-form__icon-bg {
  height: clamp(90px, 15dvh, 145px);
  margin-bottom: clamp(14px, 3.5dvh, 32px);
  margin-top: clamp(20px, 5dvh, 62px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-image: url(../image/bg-mobile.png);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #FDFBFB;
}

.mob-form__icon-text {
  max-width: 51%;
  font-weight: 600;
  font-family: "Inter";
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -1px;
  padding: 16px 0px 9px 16px;
}

.icon-cover {
  width: 50%;
  height: 145px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}
.icon-cover img {
  margin-right: -60px;
  margin-top: -14px;
}

/************* SHORT-SCREEN ROBUSTNESS *************/
/* Цель: тяжёлые шаги (вопрос с фото-загрузкой, шаги с 5–6 вариантами) должны
   умещаться на низких экранах (iPhone SE и Safari с видимыми тулбарами, где
   100dvh ≈ 553px). Меняются только НИЖНИЕ границы clamp — на устройствах
   с высотой ≥ ~600px вид остаётся прежним, ужатие включается лишь на коротких. */

.answer-btn-most,
.answer-btn-staff,
.answer-btn-options {
  height: clamp(42px, 8dvh, 64px);
  padding: clamp(10px, 2.2dvh, 20px) 20px;
}

.mob-form__image-box--most {
  gap: clamp(5px, 1.4dvh, 8px);
  margin-bottom: clamp(8px, 2dvh, 60px);
}

/* Блок загрузки фото чека: в исходнике не стилизован (сырой браузерный
   дефолт ел много высоты). Делаем компактным и в тон бренду. */
.step-file-upload-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: clamp(6px, 1.5dvh, 16px);
}
.step-file-upload-block p {
  width: 100%;
  margin: 0;
  font-family: "Inter";
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.4px;
  color: var(--primary-color);
}
.step-file-upload-block input[type="file"] {
  font-size: 13px;
  color: var(--primary-color);
  max-width: 100%;
}
.step-file-upload-block input[type="file"]::file-selector-button {
  font-family: "Inter";
  font-weight: 600;
  font-size: 13px;
  color: var(--text-white);
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  margin-right: 10px;
  cursor: pointer;
}

/************* CHECK BADGE (чистый кружок-галочка) *************/
/* Заменяем шершавый chekbox.png на векторный кружок с галочкой прямо в CSS.
   Цвета из переменных темы (подхватит любую палитру). content переопределяем
   через !important, т.к. тема навязывает картинку инлайновым <style>. */
.form-feedback__checkbox + label::before {
  content: "" !important;
  width: clamp(84px, 22vw, 104px);
  height: clamp(84px, 22vw, 104px);
  border: none;
  border-radius: 50%;
  background-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.4 4.4L19.5 7' fill='none' stroke='%23F5F1EE' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 48% 48%;
}