/* ============================================================
   Quiz Page — quiz.css
   Supplemental styles (core quiz styles live in main.css)
   Panel shell: flow-panel.css
   ============================================================ */

.quiz-page {
  padding-top: 1.5rem;
}

.quiz-container {
  max-width: 820px;
}

.quiz-ready-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  margin-bottom: 0;
  border-radius: var(--flceo-radius-lg, 12px);
  background: color-mix(in srgb, var(--flceo-success, #27ae60) 10%, var(--flceo-bg-white));
  border: 1px solid color-mix(in srgb, var(--flceo-success, #27ae60) 32%, var(--flceo-border-light, #dee2e6));
}

.quiz-ready-notice + .quiz-panel__footer {
  margin-top: 0.75rem;
}

.quiz-submit-area--ready {
  border-top: none;
  padding-top: 0;
}

.quiz-ready-notice__icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--flceo-success);
  background: color-mix(in srgb, var(--flceo-success, #27ae60) 16%, var(--flceo-bg-white));
}

.quiz-ready-notice__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--flceo-text);
}

.quiz-ready-notice__text {
  font-size: 0.9375rem;
  color: var(--flceo-text-muted);
}

.quiz-question-nav + .quiz-ready-notice {
  margin-top: 0.75rem;
}

.quiz-question-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--flceo-border-light, #dee2e6);
}

.quiz-question-nav__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--flceo-text-muted);
  text-align: center;
  flex: 1;
}

#quizMissedModal .modal-header {
  background: linear-gradient(
    135deg,
    var(--theme-admin-band-start, var(--flceo-accent)) 0%,
    var(--theme-admin-band-end, var(--flceo-accent-dark)) 100%
  );
  color: var(--theme-admin-band-text, var(--theme-accent-btn-text, #fff));
}

#quizMissedModal .modal-title,
#quizMissedModal .modal-title i {
  color: var(--theme-admin-band-text, var(--theme-accent-btn-text, #fff)) !important;
}

#quizMissedModal .btn-close {
  filter: brightness(0) invert(1);
}

#quizMissedModalBody .question-block {
  margin-bottom: 1rem;
}

#quizMissedModalBody .question-block:last-child {
  margin-bottom: 0;
}

.quiz-progress .progress-label {
  font-size: 0.875rem;
  color: var(--flceo-text);
}

.quiz-progress .progress-pct {
  font-size: 0.8125rem;
  font-weight: 600;
}

.question-block {
  box-shadow: var(--flceo-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
  transition: opacity 0.25s ease, transform 0.25s ease;
  scroll-margin-top: 5.5rem;
}

.question-block--current {
  box-shadow: var(--flceo-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.08));
}

.question-block--missed {
  border-color: color-mix(in srgb, var(--flceo-danger, #e74c3c) 45%, var(--flceo-border-light, #dee2e6));
  box-shadow: 0 2px 10px rgba(231, 76, 60, 0.08);
}

.quiz-missed-review {
  background: color-mix(in srgb, var(--flceo-danger, #e74c3c) 8%, var(--flceo-bg-white, #fff));
  border: 1px solid color-mix(in srgb, var(--flceo-danger, #e74c3c) 28%, var(--flceo-border-light, #dee2e6));
  border-radius: var(--flceo-radius-lg, 12px);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.answer-options--binary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.answer-options--binary .answer-option {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 3.25rem;
  margin-bottom: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.answer-option:last-child {
  margin-bottom: 0;
}

.answer-option:focus-visible {
  outline: 2px solid var(--flceo-primary);
  outline-offset: 2px;
}

/* Active selection — filled accent button with white text */
.answer-option.selected:not(.correct):not(.incorrect) {
  background: var(--flceo-button, var(--theme-button-bg, var(--flceo-accent)));
  border-color: var(--flceo-button, var(--theme-button-bg, var(--flceo-accent)));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--flceo-button, var(--theme-button-bg, var(--flceo-accent))) 35%, transparent);
}

/* Neutralize main.css .answer-option:hover (tan bg) — no visible hover change */
.answer-option:not(.selected):not(.correct):not(.incorrect):hover {
  background: var(--flceo-bg-white);
  border-color: var(--flceo-border);
  color: inherit;
  font-weight: inherit;
  box-shadow: none;
}

.answer-option.selected:not(.correct):not(.incorrect):hover {
  background: var(--flceo-button, var(--theme-button-bg, var(--flceo-accent)));
  border-color: var(--flceo-button, var(--theme-button-bg, var(--flceo-accent)));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--flceo-button, var(--theme-button-bg, var(--flceo-accent))) 35%, transparent);
}

.answer-option.correct:hover {
  border-color: var(--flceo-success);
  background: rgba(39, 174, 96, 0.08);
}

.answer-option.incorrect:hover {
  border-color: var(--flceo-danger);
  background: rgba(231, 76, 60, 0.08);
}

.answer-option.selected:not(.correct):not(.incorrect)::before {
  content: '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #fff;
  margin-right: 0.5rem;
  flex-shrink: 0;
  box-shadow: none;
}

.answer-option.correct::before,
.answer-option.incorrect::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 0;
  background: transparent;
}

.answer-option.correct::before {
  content: '✓';
  color: var(--flceo-success);
}

.answer-option.incorrect::before {
  content: '✕';
  color: var(--flceo-danger);
}

.answer-option[disabled] {
  opacity: 0.85;
  pointer-events: none;
}

#submitQuiz:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz-submit-area--ready #submitQuiz:not(:disabled) {
  min-width: 14rem;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--flceo-button, var(--theme-button-bg, var(--flceo-accent))) 35%, transparent);
}

.result-hero h2 {
  font-size: 1.5rem;
}

@media (min-width: 768px) {
  .result-hero h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 575.98px) {
  .quiz-ready-notice {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .quiz-question-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-question-nav__label {
    order: -1;
  }

  .question-block {
    padding: 1.125rem;
  }

  .answer-options--binary {
    grid-template-columns: 1fr;
  }

  .answer-option {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: 48px;
  }

  .result-hero {
    padding: 2rem 1rem;
  }

  .result-hero .result-icon svg {
    width: 48px;
    height: 48px;
  }

  .result-hero .result-score {
    font-size: 2rem;
  }
}
