/* Страница квиза — в тон main.css (Zapchast-Service) */

.quiz-page {
  min-height: 100dvh;
  background: var(--bg-deep);
}

.quiz-page__header {
  position: relative;
}

.quiz-shell {
  padding: 1.5rem 4vw 3rem;
  max-width: 520px;
  margin-inline: auto;
}

.quiz-panel {
  position: relative;
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(20, 16, 26, 0.95) 0%, rgba(10, 8, 14, 0.98) 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.quiz-view {
  display: none;
}

.quiz-view--active {
  display: block;
}

.quiz-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.quiz-h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}

.quiz-h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin: 0 0 0.5rem;
}

.quiz-intro-text {
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.quiz-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-progress__count {
  font-weight: 600;
  color: var(--text);
}

.quiz-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.quiz-track__fill {
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a5a24, var(--accent), #f0e4c8);
  transition: width 0.35s var(--ease-out);
}

.quiz-stage {
  display: none;
}

.quiz-stage.is-active {
  display: block;
}

.quiz-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.quiz-label--block {
  margin-top: 0.25rem;
}

.quiz-input-wrap {
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quiz-input-wrap:focus-within {
  border-color: rgba(212, 176, 106, 0.45);
  box-shadow: 0 0 0 1px rgba(212, 176, 106, 0.12);
}

.quiz-field {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  border: none;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
}

.quiz-field:focus {
  outline: none;
  box-shadow: none;
}

.quiz-field::placeholder {
  color: rgba(168, 160, 174, 0.75);
}

.quiz-input-wrap--phone {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.75rem;
}

.quiz-phone-prefix {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.quiz-field--phone {
  padding-left: 0.25rem;
}

.quiz-input-wrap--phone:focus-within {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.quiz-error {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #e8a0a0;
}

.quiz-error--block {
  margin-top: 0.75rem;
}

.quiz-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  margin-top: 1.75rem;
  align-items: center;
  justify-content: space-between;
}

#btn-back {
  order: 1;
}

#btn-quiz-next {
  order: 2;
  margin-left: auto;
}

.quiz-vin-skip {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 20rem;
}

.quiz-view--loading {
  text-align: center;
}

.quiz-loading__ring {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: quiz-spin 0.85s linear infinite;
}

@keyframes quiz-spin {
  to {
    transform: rotate(360deg);
  }
}

.quiz-muted {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
  line-height: 1.45;
}

.quiz-progressbar {
  margin-top: 1.5rem;
}

.quiz-progressbar__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.quiz-progressbar__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.quiz-progressbar__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5c4518, var(--accent));
  transition: width 0.12s linear;
}

.quiz-msg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.quiz-msg-btn {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.quiz-msg-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.quiz-msg-btn.is-selected {
  color: #120d08;
  border-color: rgba(212, 176, 106, 0.5);
  background: linear-gradient(135deg, #7a5a24 0%, var(--accent) 60%, #ecd9a8 100%);
}

.quiz-nick.is-collapsed {
  display: none;
}

#view-done .btn {
  margin-top: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .quiz-loading__ring {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.2);
  }
}

@media (max-width: 899px) {
  .quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #btn-quiz-next {
    order: 1;
    margin-left: 0;
    width: 100%;
  }

  #btn-back {
    order: 2;
    width: 100%;
  }

  .quiz-vin-skip--actions {
    margin-top: 0;
    max-width: none;
    width: 100%;
  }
}
