/* ============================================================
   FORMAN Quiz — стилі багатокрокового опитувальника
   Кольори легко міняються через змінні нижче (--fq-accent тощо)
   ============================================================ */
.fq * { box-sizing: border-box; }

.fq {
  /* Кольори підлаштовані під сайт forman.od.ua (Roboto + червоний акцент).
     Хочете повернути синій із шаблону — поміняйте --fq-accent на #3538CD, hover на #2A2CA8. */
  --fq-accent: #FF0000;
  --fq-accent-hover: #DA0202;
  --fq-ink: #000000;
  --fq-text: #1B252F;
  --fq-muted: #7A7A7A;
  --fq-border: #D6D6D6;
  --fq-card: #FFFFFF;
  --fq-field: #F5F5F8;
  --fq-radius: 7px;

  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--fq-text);
  position: relative;
  overflow-x: clip; /* щоб бічний слайд переходу не давав горизонтальний скрол */
}

/* ---- Прогрес ---- */
.fq__progress {
  height: 6px;
  background: var(--fq-border);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 40px;
}
.fq__progress-bar {
  height: 100%;
  width: 0;
  background: var(--fq-accent);
  border-radius: 999px;
  transition: width .35s ease;
}

/* ---- Крок + плавні переходи між кроками (кросфейд з накладанням) ---- */
.fq__viewport { position: relative; transition: height .32s ease; }
.fq__step {
  opacity: 1;
  transform: none;
  transition: opacity .32s ease, transform .32s ease;
  will-change: opacity, transform;
}
/* стартові стани появи нового кроку (входить у потоці) */
.fq__step.is-enter-right { opacity: 0; transform: translateX(26px); }  /* вперед — заходить справа */
.fq__step.is-enter-left  { opacity: 0; transform: translateX(-26px); } /* назад — заходить зліва  */
.fq__step.is-enter-fade  { opacity: 0; }                                /* перше завантаження      */
/* старий крок під час виходу — абсолютно, щоб накладався на новий */
.fq__step.is-leaving {
  position: absolute; top: 0; left: 0; right: 0;
  opacity: 0; pointer-events: none;
}
.fq__step.is-leaving.to-left  { transform: translateX(-26px); }
.fq__step.is-leaving.to-right { transform: translateX(26px); }

.fq__title {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 900;
  color: var(--fq-ink);
  text-align: center;
  margin: 0 0 8px;
}
.fq__subtitle {
  text-align: center;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--fq-text);
  margin: 0 0 28px;
}

/* ---- Варіанти-радіо (без картинок) ---- */
.fq__options {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(var(--fq-cols, 2), 1fr);
  margin-top: 32px;
}
.fq__option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  background: var(--fq-card);
  border: 1.5px solid var(--fq-border);
  border-radius: var(--fq-radius);
  cursor: pointer;
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 500;
  transition: border-color .18s, box-shadow .18s, background .18s, transform .18s;
  user-select: none;
}
.fq__option:hover { border-color: #f0a6a6; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.06); }
.fq__option:active { transform: translateY(0); }
.fq__option.is-selected {
  border-color: var(--fq-accent);
  background: #FFF4F4;
  box-shadow: 0 0 0 3px rgba(255,0,0,.12);
}
.fq__radio {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border: 2px solid #cfd4dc;
  border-radius: 50%;
  position: relative;
  transition: border-color .18s;
}
.fq__radio::after {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--fq-accent);
  transform: scale(0);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); /* легка пружинка */
}
.fq__option.is-selected .fq__radio { border-color: var(--fq-accent); }
.fq__option.is-selected .fq__radio::after { transform: scale(1); }

/* ---- Текстове поле ---- */
.fq__text-input {
  width: 100%;
  margin-top: 32px;
  padding: 22px 24px;
  font-size: 18px;
  background: var(--fq-field);
  border: 1.5px solid transparent;
  border-radius: var(--fq-radius);
  color: var(--fq-text);
  font-family: inherit;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.fq__text-input:focus { outline: none; border-color: var(--fq-accent); background: #fff; box-shadow: 0 0 0 4px rgba(255,0,0,.08); }
.fq__text-input::placeholder { color: #98a2b3; }

/* ---- Картки з зображеннями ---- */
.fq__cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(var(--fq-cols, 4), 1fr);
  margin-top: 32px;
}
.fq__card {
  background: var(--fq-card);
  border: 1.5px solid var(--fq-border);
  border-radius: var(--fq-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s, box-shadow .25s, transform .25s;
  display: flex;
  flex-direction: column;
}
.fq__card:hover { transform: translateY(-4px); border-color: #f0a6a6; box-shadow: 0 12px 26px rgba(0,0,0,.10); }
.fq__card:active { transform: translateY(-1px); }
.fq__card.is-selected {
  border-color: var(--fq-accent);
  box-shadow: 0 0 0 3px rgba(255,0,0,.13);
}
.fq__card-img {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #eef0f5, #dfe3ec);
  background-size: cover;
  background-position: center;
  transition: transform .4s ease;
}
.fq__card:hover .fq__card-img { transform: scale(1.06); }
.fq__card-label {
  padding: 16px 18px;
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 700;
  color: var(--fq-text);
}

/* ---- Крок контактів ---- */
.fq__founder {
  display: flex; align-items: center; gap: 18px;
  justify-content: center;
  margin: 8px 0 28px;
}
.fq__founder-img {
  width: 92px; height: 92px; border-radius: 50%;
  background: #eef0f5 center/cover no-repeat;
  flex: 0 0 auto;
}
.fq__founder-name { font-weight: 700; font-size: 20px; color: var(--fq-ink); }
.fq__founder-role { color: var(--fq-muted); font-size: 15px; margin: 2px 0 4px; }
.fq__stars { color: var(--fq-accent); letter-spacing: 2px; font-size: 16px; }

.fq__field {
  width: 100%;
  padding: 22px 24px;
  font-size: 18px;
  background: var(--fq-field);
  border: 1.5px solid transparent;
  border-radius: var(--fq-radius);
  font-family: inherit;
  margin-top: 16px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.fq__field:focus { outline: none; border-color: var(--fq-accent); background: #fff; box-shadow: 0 0 0 4px rgba(255,0,0,.08); }
.fq__field::placeholder { color: #98a2b3; }

.fq__phone-row { display: flex; gap: 12px; margin-top: 16px; }
.fq__phone-prefix {
  display: flex; align-items: center; gap: 6px;
  padding: 0 20px;
  background: var(--fq-field);
  border-radius: var(--fq-radius);
  font-size: 18px; font-weight: 600;
  white-space: nowrap;
}
.fq__phone-row .fq__field { margin-top: 0; }

.fq__consent {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 18px; font-size: 14px; color: var(--fq-muted);
  cursor: pointer;
}
.fq__consent input { width: 20px; height: 20px; accent-color: var(--fq-accent); margin-top: 1px; flex: 0 0 auto; }
.fq__consent a { color: var(--fq-accent); }

/* honeypot — прихований від людей, видимий ботам */
.fq__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- Навігація ---- */
.fq__nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 40px;
  min-height: 64px;
}
.fq__back {
  background: none; border: none; cursor: pointer;
  color: var(--fq-muted); font-size: 16px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 4px;
}
.fq__back { transition: color .18s; }
.fq__back svg { transition: transform .18s ease; }
.fq__back:hover { color: var(--fq-text); }
.fq__back:hover svg { transform: translateX(-3px); }
.fq__back.is-hidden { visibility: hidden; }

.fq__next {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--fq-accent); color: #fff;
  border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 18px;
  padding: 20px 34px;
  border-radius: var(--fq-radius);
  transition: background .18s, opacity .18s, transform .18s, box-shadow .18s;
}
.fq__next:hover { background: var(--fq-accent-hover); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255,0,0,.24); }
.fq__next:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(255,0,0,.20); }
.fq__next:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.fq__next svg { width: 26px; height: 26px; transition: transform .18s ease; }
.fq__next:hover svg { transform: translateX(4px); }

.fq__error { color: #d92d20; text-align: center; margin-top: 16px; font-size: 15px; min-height: 20px; }

/* ---- Екран подяки (якщо без редіректу) ---- */
.fq__done { text-align: center; padding: 60px 20px; }
.fq__done h2 { font-size: 34px; color: var(--fq-ink); margin: 0 0 12px; }
.fq__done p { color: var(--fq-muted); font-size: 18px; }

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

/* Планшети */
@media (max-width: 900px) {
  .fq__cards   { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .fq__options { grid-template-columns: repeat(2, 1fr); }
}

/* Телефони */
@media (max-width: 620px) {
  .fq { padding: 4px 14px 20px; }
  .fq__progress { margin-bottom: 24px; }
  .fq__title { line-height: 1.2; }
  .fq__subtitle { margin-bottom: 18px; }

  .fq__options { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
  .fq__cards   { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; } /* 2 в ряд краще, ніж одна велика */

  .fq__option { padding: 15px 16px; }
  .fq__card-label { padding: 12px 14px; }

  /* 16px у полях — щоб iOS не робив авто-зум при фокусі */
  .fq__text-input, .fq__field { padding: 16px; font-size: 16px; }

  .fq__founder { gap: 14px; margin-bottom: 22px; }
  .fq__founder-img { width: 72px; height: 72px; }
  .fq__founder-name { font-size: 18px; }
  .fq__phone-prefix { padding: 0 14px; font-size: 16px; }
  .fq__consent { font-size: 13px; }

  .fq__nav { margin-top: 26px; min-height: 0; gap: 12px; }
  .fq__next { padding: 15px 24px; font-size: 16px; }
  .fq__next svg { width: 22px; height: 22px; }
  .fq__back { font-size: 15px; padding: 8px 2px; }
}

/* Вузькі телефони */
@media (max-width: 360px) {
  .fq__card-label { font-size: 14px; }
  .fq__next { padding: 14px 18px; }
}
