/* ============================================================
   UNIVERSAL QUIZ — macro quiz_logic (.quiz-item_*)
   Подключается отдельно: global.11b613674d1249d5.css → quiz.11b613674d1249d5.css
   ============================================================ */

/* ---- Секция квиза ---- */
.quiz {
  display: none;
  padding: 1rem 0 60px;
  background: var(--color-bg-quiz);
}

.quiz .container {
  max-width: 100%;
  padding: 0 1rem;
}
.quiz_inner {
  position: relative;
}
.quiz_inner:has(.quiz-item) {
  min-height: 420px;
}

/* ---- Шаг квиза ---- */
.quiz-item {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "image"
    "answers";
  gap: 1rem;
  align-items: start;
  opacity: 1;
  transition: var(--quiz-transition);
}
.quiz-item:has(.quiz-item_subtitle) {
  grid-template-areas:
    "title"
    "subtitle"
    "image"
    "answers";
}
.quiz-item_text-content {
  display: contents;
}
.quiz-item_title {
  grid-area: title;
  color: var(--color-text-primary);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.2;
}
.quiz-item_subtitle {
  grid-area: subtitle;
  margin: 0 auto 8px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-primary);
  max-width: 100%;
}
.quiz-item_answers {
  grid-area: answers;
  margin-top: 0;
  list-style: none;
}
.quiz-item_img-content {
  grid-area: image;
  margin-left: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
}
.quiz-item_img-content img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ---- Ответы (как answer-variants__variant-text в OLD) ---- */
.quiz-item_answer {
  display: block;
  width: 100%;
  background-color: var(--color-bg-body);
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: var(--font-size-body);
  text-align: left;
  padding: 0;
  cursor: pointer;
  border-radius: 5px;
  border: solid 1px rgba(217, 216, 230, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.quiz-item_answer:active,
.quiz-item_answer:focus,
.quiz-item_answer.--clicked {
  outline: none;
  background-color: var(--color-bg-body) !important;
  border-color: rgba(217, 216, 230, 0.55);
  box-shadow: none;
}
.quiz-item_answer + .quiz-item_answer {
  margin-top: 1rem;
}

/* ---- Декоративный radio (b-radio из OLD / app.11b613674d1249d5.css) ---- */
.quiz-item_answer .b-radio.radio {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.8rem 1rem;
  pointer-events: none;
  user-select: none;
  line-height: 1.5;
}
.quiz-item_answer .b-radio.radio .check {
  flex-shrink: 0;
  position: relative;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  border: none;
  background-color: #e8e8e8;
  transition: background 0.15s ease-out, box-shadow 0.15s ease-out, border 0.15s ease-out;
}
.quiz-item_answer .b-radio.radio .check::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.25em;
  height: 1.25em;
  margin-left: -0.625em;
  margin-top: -0.625em;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s ease-out;
  background-color: transparent;
}
.quiz-item_answer.--clicked .b-radio.radio .check {
  border: 2px solid var(--color);
  background: #fff;
  box-shadow: 0 2px 6px 0 var(--color-alpha);
}
.quiz-item_answer.--clicked .b-radio.radio .check::before {
  transform: scale(0.5);
  background: var(--color);
}
.quiz-item_answer .b-radio.radio .control-label {
  padding-left: 1rem;
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
}

/* ---- Переход между шагами (fadeOut 500ms — OLD custom6.js) ---- */
.quiz-item.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ---- Нижняя панель прогресса ---- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: none;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 16px;
  background-color: var(--color-bg-quiz);
  z-index: 100;
}
.bottom-bar_progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.bottom-bar_label {
  line-height: 15px;
}
.bottom-bar_dots-wrapper {
  display: inline-flex;
  align-items: center;
}
.bottom-bar_dot {
  width: 7px;
  height: 7px;
  border: 1px solid var(--color);
  border-radius: 50%;
  background-color: transparent;
  margin-right: 5px;
  transition: background-color 0.3s ease;
}
.bottom-bar_dot:last-child {
  margin-right: 0;
}
.dot--active {
  background-color: var(--color);
}

/* ---- Лоадер после квиза ---- */
.loader-screen {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--color-bg-body);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.loader-screen_content {
  text-align: center;
}
.loader-spinner {
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
}
.loader-messages {
  color: var(--color-text-primary);
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 60px;
}
.loader-message {
  font-size: var(--font-size-base);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.6s ease-in;
  white-space: nowrap;
}
.quiz-loader {
  width: 50px;
  aspect-ratio: 1;
  display: grid;
  border: 4px solid #0000;
  border-radius: 50%;
  border-right-color: var(--color);
  animation: quiz-loader-spin 1s infinite linear;
}
.quiz-loader::before,
.quiz-loader::after {
  content: "";
  grid-area: 1/1;
  margin: 2px;
  border: inherit;
  border-radius: 50%;
  animation: quiz-loader-spin 2s infinite;
}
.quiz-loader::after {
  margin: 8px;
  animation-duration: 3s;
}
@keyframes quiz-loader-spin {
  100% {
    transform: rotate(1turn);
  }
}
