/* ============================================
   Quiz Overlay Styles
   Business Systems & Process Health Check
   ============================================ */

/* Overlay Container */
.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30, 30, 35, 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.quiz-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Close Button */
.quiz-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line-dim);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.quiz-close:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.quiz-close svg {
  width: 20px;
  height: 20px;
}

/* Quiz Container */
.quiz-container {
  width: 100%;
  max-width: 640px;
  padding: 2rem;
  position: relative;
}

/* Progress Bar */
.quiz-progress {
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 4px;
  background: var(--line-dim);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--accent-orange);
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
}

.quiz-progress-text {
  position: absolute;
  top: 12px;
  right: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Screens */
.quiz-screen {
  display: none;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.quiz-screen.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* Intro Screen */
.quiz-intro {
  text-align: center;
  padding-top: 2rem;
}

.quiz-intro h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.quiz-intro p {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.quiz-intro-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.quiz-intro-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.quiz-intro-feature svg {
  width: 16px;
  height: 16px;
  color: var(--accent-orange);
}

/* Start Button */
.quiz-start-btn {
  padding: 1rem 2.5rem;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-start-btn:hover {
  background: #d4632a;
  transform: translateY(-2px);
}

/* Question Screen */
.quiz-question {
  padding-top: 3rem;
}

.quiz-question-number {
  font-size: 0.75rem;
  color: var(--accent-orange);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.quiz-question h3 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.4;
}

/* Answer Options */
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-answer {
  padding: 1rem 1.25rem;
  background: transparent;
  border: 1px solid var(--line-dim);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quiz-answer:hover {
  border-color: var(--accent-orange-dim);
  background: rgba(233, 113, 50, 0.05);
}

.quiz-answer.selected {
  border-color: var(--accent-orange);
  background: rgba(233, 113, 50, 0.1);
  color: var(--text-primary);
}

.quiz-answer-indicator {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line-dim);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.quiz-answer.selected .quiz-answer-indicator {
  border-color: var(--accent-orange);
  background: var(--accent-orange);
}

.quiz-answer.selected .quiz-answer-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* Email Gate */
.quiz-email-gate {
  padding-top: 3rem;
  text-align: center;
}

.quiz-email-gate h3 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.quiz-email-gate p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-email-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.quiz-form-group {
  position: relative;
  text-align: left;
}

.quiz-form-group input {
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: 1px solid var(--line-dim);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.quiz-form-group input:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.quiz-form-group label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s ease;
  background: rgba(30, 30, 35, 0.98);
}

.quiz-form-group input:focus + label,
.quiz-form-group input:not(:placeholder-shown) + label {
  top: -0.5rem;
  left: 0.75rem;
  font-size: 0.75rem;
  padding: 0 0.25rem;
  color: var(--accent-orange);
}

.quiz-submit-btn {
  padding: 1rem 2rem;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.quiz-submit-btn:hover {
  background: #d4632a;
  transform: translateY(-2px);
}

.quiz-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quiz-privacy-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.quiz-privacy-note a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* Results Screen */
.quiz-results {
  padding-top: 3rem;
  text-align: center;
}

.quiz-result-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-result-icon svg {
  width: 40px;
  height: 40px;
}

/* Segment Colors */
.quiz-result-icon.segment-green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.quiz-result-icon.segment-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.quiz-result-icon.segment-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.quiz-result-icon.segment-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.quiz-results h3 {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.quiz-results p {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.quiz-result-cta {
  padding: 1rem 2rem;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.quiz-result-cta:hover {
  background: #d4632a;
  transform: translateY(-2px);
}

.quiz-result-secondary {
  display: block;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-main);
}

.quiz-result-secondary:hover {
  color: var(--text-secondary);
}

/* Score Display (optional) */
.quiz-score-display {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.quiz-score-item {
  text-align: center;
}

.quiz-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.quiz-score-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Loading State */
.quiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.quiz-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line-dim);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: quiz-spin 1s linear infinite;
}

@keyframes quiz-spin {
  to { transform: rotate(360deg); }
}

.quiz-loading-text {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
  .quiz-container {
    padding: 1.5rem;
  }

  .quiz-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .quiz-progress {
    left: 1.5rem;
    right: 1.5rem;
  }

  .quiz-progress-text {
    right: 1.5rem;
  }

  .quiz-intro h2 {
    font-size: 1.5rem;
  }

  .quiz-intro-features {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .quiz-question h3 {
    font-size: 1.25rem;
  }

  .quiz-answer {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .quiz-score-display {
    flex-direction: column;
    gap: 1rem;
  }
}
