/* =========================================================
   blocks-service-quiz.min.css — пошаговый квиз для страниц услуг.
   Стиль сайта: квадратные углы, акцент #b00a27, плавные переходы.
   ========================================================= */

.c-quiz {
  position: relative;
  margin: 56px 0;
  padding: 40px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
}

/* Красная полоса сверху — сразу видно, что блок интерактивный */
.c-quiz::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 3px;
  background: var(--c-accent);
}

/* ---------- Шапка квиза ---------- */
.c-quiz__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.c-quiz__title {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--c-text);
  position: relative;
  padding-left: 18px;
}
.c-quiz__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  background: var(--c-accent);
}
.c-quiz__lead {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-text-mute);
  padding-left: 18px;
}
.c-quiz__counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Прогресс-бар ---------- */
.c-quiz__progress {
  height: 4px;
  background: var(--c-border);
  margin-bottom: 32px;
  overflow: hidden;
  position: relative;
}
.c-quiz__progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c-accent);
  transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Область шагов ---------- */
.c-quiz__body {
  position: relative;
}
.c-quiz__step {
  display: none;
  animation: c-quiz-fade 0.35s ease-out;
}
.c-quiz__step.is-active {
  display: block;
}
@keyframes c-quiz-fade {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Вопрос ---------- */
.c-quiz__question {
  margin: 0 0 8px;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--c-text);
}
.c-quiz__hint {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text-mute);
}

/* ---------- Сетка вариантов ---------- */
.c-quiz__options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 28px;
}

/* ---------- Вариант выбора (radio/checkbox) ---------- */
.c-quiz__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition:
    border-color var(--c-transition),
    background-color var(--c-transition),
    transform var(--c-transition),
    box-shadow var(--c-transition);
}
.c-quiz__option:hover {
  border-color: var(--c-accent);
  transform: translateY(-2px);
  box-shadow: var(--c-shadow);
}
.c-quiz__option-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Кастомный маркер — квадрат для чекбокса, круг для радио */
.c-quiz__option-mark {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--c-border);
  background: var(--c-bg);
  box-sizing: border-box;
  transition:
    border-color var(--c-transition),
    background-color var(--c-transition);
}
/* Галочка — SVG data URI (точное центрирование flex-ом родителя) */
.c-quiz__option-mark::after {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 6.2l3.1 3.1 6-6.4' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
/* Radio — круглый маркер и точка внутри */
.c-quiz__option-input[type="radio"] + .c-quiz__option-mark {
  border-radius: 50%;
}
.c-quiz__option-input[type="radio"] + .c-quiz__option-mark::after {
  width: 10px;
  height: 10px;
  background-image: none;
  background-color: var(--c-accent);
  border-radius: 50%;
  transform: scale(0);
}
.c-quiz__option-input[type="radio"]:checked + .c-quiz__option-mark {
  border-color: var(--c-accent);
}
.c-quiz__option-input[type="radio"]:checked + .c-quiz__option-mark::after {
  transform: scale(1);
}
/* Checkbox — заливка акцентом + белая галочка */
.c-quiz__option-input[type="checkbox"]:checked + .c-quiz__option-mark {
  background: var(--c-accent);
  border-color: var(--c-accent);
}
.c-quiz__option-input[type="checkbox"]:checked + .c-quiz__option-mark::after {
  transform: scale(1);
}
.c-quiz__option-input:focus-visible + .c-quiz__option-mark {
  outline: 3px solid rgba(176, 10, 39, 0.25);
  outline-offset: 2px;
}
/* Выбранная карточка — акцентная рамка */
.c-quiz__option:has(.c-quiz__option-input:checked) {
  border-color: var(--c-accent);
  background: rgba(176, 10, 39, 0.04);
}
.c-quiz__option-body {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}
.c-quiz__option-title {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--c-text);
}
.c-quiz__option-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-text-mute);
}

/* Иконка у варианта (опционально) */
.c-quiz__option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 4px;
  background: rgba(176, 10, 39, 0.06);
  color: var(--c-accent);
  flex-shrink: 0;
}
.c-quiz__option-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.c-quiz__option:has(.c-quiz__option-input:checked) .c-quiz__option-icon {
  background: var(--c-accent);
  color: #ffffff;
}

/* ---------- Поля ввода на шаге контактов ---------- */
.c-quiz__fields {
  display: grid;
  gap: 16px;
  margin: 0 0 20px;
}
.c-quiz__field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
}
.c-quiz__field label > span {
  color: var(--c-accent);
  margin-left: 2px;
}
.c-quiz__field input,
.c-quiz__field textarea {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 0;
  box-sizing: border-box;
  min-height: 48px;
  transition: border-color var(--c-transition), box-shadow var(--c-transition);
}
.c-quiz__field input:focus,
.c-quiz__field textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(176, 10, 39, 0.12);
}
.c-quiz__field .form__item_error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-accent);
}
.c-quiz__field .form__item_error:empty { display: none; }

/* Чекбокс согласия в стиле сайта */
.c-quiz__agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 20px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text-mute);
}
.c-quiz__agree a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Навигация (Назад / Далее) ---------- */
.c-quiz__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}
.c-quiz__nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border: 0;
  cursor: pointer;
  transition: background-color var(--c-transition), color var(--c-transition), transform var(--c-transition), box-shadow var(--c-transition);
}
.c-quiz__nav-btn svg {
  display: block;
  width: 16px;
  height: 16px;
}
.c-quiz__nav-btn--back {
  background: transparent;
  color: var(--c-text-mute);
  border: 1px solid var(--c-border);
}
.c-quiz__nav-btn--back:hover {
  color: var(--c-accent);
  border-color: var(--c-accent);
}
.c-quiz__nav-btn--next,
.c-quiz__nav-btn--submit {
  background: var(--c-accent);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}
.c-quiz__nav-btn--next:hover,
.c-quiz__nav-btn--submit:hover {
  background: var(--c-accent-h);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(176, 10, 39, 0.55);
}
/* Бегущий блик на кнопке */
.c-quiz__nav-btn--next::before,
.c-quiz__nav-btn--submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -140%;
  width: 140%;
  height: 100%;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  animation: c-quiz-shine 3.2s ease-in-out infinite;
  animation-delay: 0.8s;
  pointer-events: none;
}
@keyframes c-quiz-shine {
  0%   { left: -140%; }
  35%  { left: 140%; }
  100% { left: 140%; }
}
.c-quiz__nav-btn--next:disabled,
.c-quiz__nav-btn--submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.c-quiz__nav-btn--next:disabled::before,
.c-quiz__nav-btn--submit:disabled::before {
  display: none;
}

/* ---------- Статус отправки ---------- */
.c-quiz__status {
  margin-top: 20px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
}
.c-quiz__status--success {
  border-color: #b9e2c2;
  background: #eafaf0;
  color: #14602c;
}
.c-quiz__status--error {
  border-color: #f2c0c6;
  background: #fdecee;
  color: #8e081f;
}
.c-quiz__status--info {
  border-color: #c7ddff;
  background: #eef4ff;
  color: #1f4ea8;
}

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 700px) {
  .c-quiz { padding: 28px 20px; margin: 40px 0; }
  .c-quiz__options { grid-template-columns: 1fr; gap: 10px; }
  .c-quiz__option { padding: 16px 16px; }
  .c-quiz__nav { flex-direction: column-reverse; gap: 12px; }
  .c-quiz__nav-btn { width: 100%; justify-content: center; }
  .c-quiz__head { gap: 12px; margin-bottom: 16px; }
}
@media (max-width: 400px) {
  .c-quiz { padding: 22px 16px; }
  .c-quiz__option-icon { width: 36px; height: 36px; }
  .c-quiz__option-icon svg { width: 18px; height: 18px; }
}

/* Уважение к prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .c-quiz__step,
  .c-quiz__nav-btn::before,
  .c-quiz__option,
  .c-quiz__option-mark::after {
    animation: none !important;
    transition: none !important;
  }
}