/* Door Quiz Page Styles
   Стиль под текущую дизайн-систему сайта: светлый фон, аккуратные карточки, радиусы 12px, акцент #1a1a1a.
*/

/* Breadcrumb (same visual language as catalog page) */
.breadcrumb {
  background: #f8f9fa;
  padding: 1rem 0;
  margin-top: 70px; /* header is fixed */
  border-bottom: 1px solid #e5e5e5;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.breadcrumb-nav a {
  color: #6a6a6a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
  color: #1a1a1a;
}

.separator { color: #a0a0a0; }
.current { color: #1a1a1a; font-weight: 500; }

.quiz-header {
  background: white;
  padding: 3rem 0;
  text-align: center;
  border-bottom: 1px solid #e5e5e5;
}

.quiz-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
}

.quiz-header p {
  font-size: 1.125rem;
  color: #6a6a6a;
}

.quiz-content {
  padding: 2rem 0 4rem;
  background: #fafafa;
}

.quiz-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  overflow: hidden;
}

/* Top bar */
.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  flex-wrap: wrap;
}

.quiz-steps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quiz-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #a0a0a0;
  font-size: 0.9rem;
  font-weight: 600;
  user-select: none;
}

.quiz-step .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #e5e5e5;
  background: #fafafa;
  transition: all 0.25s ease;
}

.quiz-step.is-active,
.quiz-step.is-done {
  color: #1a1a1a;
}

.quiz-step.is-active .dot,
.quiz-step.is-done .dot {
  border-color: #1a1a1a;
}

.quiz-step.is-done .dot {
  background: #1a1a1a;
}

.quiz-mini-summary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: #6a6a6a;
  font-size: 0.9rem;
}

.quiz-mini-summary .caption {
  color: #a0a0a0;
}

.quiz-mini-summary .value {
  color: #1a1a1a;
  font-weight: 600;
}

/* Slides / presentation effect */
.quiz-viewport {
  overflow: hidden;
}

.quiz-slides {
  display: flex;
  width: 100%;
  transform: translateX(0%);
  transition: transform 420ms ease;
}

.quiz-slide {
  min-width: 100%;
  padding: 2rem 1.5rem 2.25rem;
}

.quiz-slide-head h2 {
  font-size: 1.75rem;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.quiz-slide-head p {
  color: #6a6a6a;
  margin-bottom: 1.5rem;
}

/* Choices */
.quiz-choices {
  display: grid;
  gap: 1rem;
}

.quiz-choices.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-choice {
  cursor: pointer;
  display: block;
}

.quiz-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz-choice-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: stretch;
  gap: 1rem;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: #fff;
  transition: all 0.25s ease;
  overflow: hidden;
  min-height: 128px;
}

.quiz-choice-card.is-compact {
  grid-template-columns: 1fr auto;
  min-height: 96px;
  padding: 1.25rem 1.25rem;
}

.quiz-choice-media {
  background: #f5f5f5;
  position: relative;
  min-height: 128px;
}

.quiz-choice-media.is-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.quiz-choice-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quiz-choice-body {
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-choice-card.is-compact .quiz-choice-body {
  padding: 0;
}

.quiz-choice-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
}

.quiz-choice-sub {
  display: block;
  font-size: 0.9rem;
  color: #6a6a6a;
}

.quiz-choice-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #e5e5e5;
  margin: 1.25rem 1.25rem 0 0;
  align-self: flex-start;
  position: relative;
  transition: all 0.25s ease;
}

.quiz-choice-card.is-compact .quiz-choice-check {
  margin: 0;
  align-self: center;
}

.quiz-choice:hover .quiz-choice-card {
  border-color: #1a1a1a;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.quiz-choice input:checked + .quiz-choice-card {
  border-color: #1a1a1a;
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.quiz-choice input:checked + .quiz-choice-card .quiz-choice-check {
  border-color: #1a1a1a;
  background: #1a1a1a;
}

.quiz-choice input:checked + .quiz-choice-card .quiz-choice-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Hint */
.quiz-hint {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  color: #6a6a6a;
  font-size: 0.95rem;
}

.hint-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1a1a1a;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

/* Final layout */
.quiz-final-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.final-art {
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  position: relative;
  overflow: hidden;
}

.final-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 35%, rgba(26,26,26,0.08), transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(26,26,26,0.06), transparent 55%);
}

.final-art-card {
  position: relative;
  padding: 2rem;
}

.final-art-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.final-art-sub {
  color: #6a6a6a;
  font-size: 1rem;
  max-width: 28ch;
}

.final-form {
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  padding: 1.5rem;
  background: #fff;
}

/* Form */
.quiz-form {
  display: grid;
  gap: 1rem;
}

.quiz-field {
  display: grid;
  gap: 0.4rem;
}

.quiz-label {
  font-size: 0.9rem;
  color: #6a6a6a;
  font-weight: 600;
}

.quiz-field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  background: white;
}

.quiz-field input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

/* Consent checkbox (re-using catalog-like checkmark look) */
.quiz-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.9rem;
  color: #6a6a6a;
  cursor: pointer;
}

.quiz-consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz-consent .checkmark {
  width: 18px;
  height: 18px;
  background: #f8f9fa;
  border: 2px solid #e5e5e5;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.quiz-consent:hover .checkmark {
  border-color: #1a1a1a;
}

.quiz-consent input:checked + .checkmark {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.quiz-consent input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.quiz-consent a {
  color: #1a1a1a;
}

.quiz-submit-row {
  display: grid;
  gap: 0.5rem;
}

.quiz-form-note {
  margin: 0;
  font-size: 0.9rem;
  color: #6a6a6a;
  min-height: 1.2em;
}

/* Nav buttons */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e5e5e5;
  background: #fff;
}

.quiz-back {
  min-width: 120px;
}

.quiz-next {
  min-width: 160px;
}

.quiz-next:disabled,
.quiz-back:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.quiz-error {
  padding: 0 1.5rem 1.25rem;
  color: #ef4444;
  font-size: 0.95rem;
  min-height: 1.2em;
}

/* Responsive */
@media (max-width: 900px) {
  .quiz-choices.grid-2 {
    grid-template-columns: 1fr;
  }
  .quiz-choice-card {
    grid-template-columns: 140px 1fr auto;
  }
  .quiz-final-layout {
    grid-template-columns: 1fr;
  }
  .final-form {
    padding: 1.25rem;
  }
}

@media (max-width: 520px) {
  .quiz-slide {
    padding: 1.5rem 1rem 1.75rem;
  }
  .quiz-top, .quiz-nav {
    padding: 1rem;
  }
  .quiz-choice-card {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .quiz-choice-check {
    margin: 0 1rem 1rem 1rem;
    justify-self: end;
  }
  .quiz-choice-body {
    padding: 1rem 1rem 0;
  }
  .quiz-choice-media {
    min-height: 160px;
  }
}
