/* ============ КВИЗ-ПОДБОР ПОТОЛКА ============ */

.quiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 29, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: quizFadeIn 0.25s ease;
}

.quiz-overlay.open {
  display: flex;
}

@keyframes quizFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.quiz-modal {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.4);
  animation: quizSlideUp 0.3s ease;
}

@keyframes quizSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.quiz-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.quiz-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
}

.quiz-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gray);
  font-size: 1.3rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-close:hover {
  background: var(--line);
  color: var(--dark);
}

/* Прогресс */
.quiz-progress {
  height: 4px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0;
  transition: width 0.35s ease;
}

.quiz-progress-text {
  padding: 12px 28px 0;
  font-size: 0.82rem;
  color: var(--gray);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Шаги */
.quiz-body {
  padding: 16px 28px 24px;
  overflow-y: auto;
  flex: 1;
}

.quiz-step {
  display: none;
  animation: quizStepIn 0.3s ease;
}

.quiz-step.active {
  display: block;
}

@keyframes quizStepIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.quiz-step h4 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  line-height: 1.25;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  color: var(--dark);
}

.quiz-option:hover {
  border-color: var(--dark);
  transform: translateY(-1px);
}

.quiz-option.selected {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.quiz-option-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.quiz-option-text {
  flex: 1;
}

.quiz-option-text small {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  opacity: 0.6;
  margin-top: 2px;
}

/* Результат */
.quiz-result {
  text-align: center;
  padding: 8px 0;
}

.quiz-result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 184, 0, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 20px;
}

.quiz-result h4 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.quiz-result h4 span {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.quiz-result p {
  color: var(--gray);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-result-actions .btn {
  width: 100%;
}

.quiz-result-price {
  background: #f6f4f1;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--gray);
}

.quiz-result-price b {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin-top: 4px;
}

/* Навигация */
.quiz-nav {
  padding: 16px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: #fafaf9;
}

.quiz-nav-back {
  background: none;
  border: none;
  color: var(--gray);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  transition: 0.2s;
}

.quiz-nav-back:hover {
  color: var(--dark);
}

.quiz-nav-back:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.quiz-step-counter {
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 600;
}

.quiz-nav-hidden {
  display: none;
}

/* Адаптив */
@media (max-width: 640px) {
  .quiz-modal {
    border-radius: 20px;
    max-height: calc(100vh - 24px);
  }

  .quiz-header {
    padding: 20px 20px 14px;
  }

  .quiz-body {
    padding: 14px 20px 20px;
  }

  .quiz-nav {
    padding: 14px 20px 20px;
  }

  .quiz-progress-text {
    padding: 10px 20px 0;
  }

  .quiz-step h4 {
    font-size: 1.15rem;
  }

  .quiz-result h4 {
    font-size: 1.3rem;
  }
}

/* Кнопка запуска квиза на странице */
.quiz-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: 0 12px 28px -8px rgba(255, 107, 53, 0.5);
}

.quiz-trigger:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.quiz-trigger i {
  font-size: 1.1rem;
}