/*
 * LearnPress quiz screens based on Design.pdf, pages 13-15.
 * Presentation only: questions, answers, timing, attempts and results are
 * always supplied by LearnPress.
 */

:root {
  --nn-quiz-bg: #FBFAF6;
  --nn-quiz-ink: #20271F;
  --nn-quiz-accent: #8B5C66;
  --nn-quiz-olive: #DCE8AD;
  --nn-quiz-green: #344436;
  --nn-quiz-card: #FFFFFF;
  --nn-quiz-line: rgba(52, 68, 54, 0.16);
  --nn-quiz-muted: rgba(32, 39, 31, 0.64);
  --nn-quiz-danger: #8B5C66;
  --nn-quiz-radius: 22px;
  --nn-quiz-shadow: 0 14px 38px rgba(32, 39, 31, 0.05);
}

body.nn-lms.course-item-popup:has(#learn-press-quiz-app),
body.nn-lms.single-lp_quiz {
  background: var(--nn-quiz-bg) !important;
  color: var(--nn-quiz-ink);
  font-family: "Manrope", sans-serif !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz, .quiz-content) {
  color: var(--nn-quiz-ink);
  font-family: "Manrope", sans-serif;
}

body.nn-lms.course-item-popup #popup-content:has(#learn-press-quiz-app) {
  background: var(--nn-quiz-bg) !important;
}

body.nn-lms.course-item-popup .content-item-wrap:has(#learn-press-quiz-app) {
  width: min(100%, 920px) !important;
  max-width: 920px !important;
  margin: 0 auto !important;
  padding: clamp(24px, 4vw, 62px) clamp(18px, 4vw, 42px) 90px !important;
}

body.nn-lms.course-item-popup .content-item-summary:has(#learn-press-quiz-app),
body.nn-lms.single-lp_quiz #learn-press-quiz-app {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  h1,
  h2,
  .quiz-title
) {
  color: var(--nn-quiz-ink);
  font-family: "Prata", Georgia, serif !important;
  font-weight: 400 !important;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(.quiz-title, h1) {
  margin: 0 0 28px !important;
  font-size: clamp(30px, 4vw, 48px) !important;
}

/* Native question counter and timer. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-status,
  .quiz-status__content,
  .quiz-meta
) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px !important;
  color: var(--nn-quiz-muted);
  font-size: 13px;
  font-weight: 700;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-countdown,
  .countdown,
  .quiz-timer,
  .quiz-time,
  .quiz-status .time
) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--nn-quiz-line);
  border-radius: 999px;
  background: var(--nn-quiz-card);
  color: var(--nn-quiz-green);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .questions-index,
  .question-index,
  .quiz-current-question,
  .quiz-status .questions-index
) {
  color: var(--nn-quiz-muted);
  font-size: 13px;
  font-weight: 700;
}

/* LearnPress progress output only; no percentage or counter is generated. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-progress,
  .learn-press-progress,
  .lp-progress-bar
) {
  min-height: 8px;
  margin: 0 0 clamp(28px, 4vw, 42px) !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(220, 232, 173, 0.62) !important;
  box-shadow: none !important;
  overflow: hidden;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-progress,
  .learn-press-progress,
  .lp-progress-bar
) :where(.progress-bg, .lp-progress-value, .progress-active, .progress-value) {
  min-height: 8px;
  border-radius: 999px !important;
  background: var(--nn-quiz-accent) !important;
  box-shadow: none !important;
}

/* Question block. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-question,
  .question-content,
  .question
) {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .question-title,
  .question-title h3,
  .question-content > h3
) {
  max-width: 780px;
  margin: 0 0 clamp(22px, 3vw, 30px) !important;
  color: var(--nn-quiz-ink) !important;
  font-family: "Manrope", sans-serif !important;
  font-size: clamp(24px, 3.2vw, 35px) !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em;
  line-height: 1.28;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .question-description,
  .question-explanation,
  .question-hint
) {
  margin: -12px 0 24px;
  color: var(--nn-quiz-muted);
  font-size: 14px;
  line-height: 1.7;
}

/* Real answer inputs remain visible and keyboard operable. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-options {
  display: grid !important;
  gap: 13px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option {
  position: relative;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--nn-quiz-line) !important;
  border-radius: 17px !important;
  background: var(--nn-quiz-card) !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option:hover {
  border-color: rgba(139, 92, 102, 0.56) !important;
  transform: translateY(-1px);
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option label,
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option .option-title {
  display: flex !important;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 68px;
  margin: 0 !important;
  padding: 17px 20px !important;
  color: var(--nn-quiz-ink) !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option input:is([type="radio"], [type="checkbox"]) {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0 !important;
  accent-color: var(--nn-quiz-accent);
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option:has(input:checked),
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option.selected {
  border-color: var(--nn-quiz-accent) !important;
  background: rgba(220, 232, 173, 0.46) !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .answer-option.answer-correct,
  .answer-option.answered-correct,
  .answer-option.correct
) {
  border-color: var(--nn-quiz-green) !important;
  background: rgba(220, 232, 173, 0.62) !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .answer-option.answer-wrong,
  .answer-option.answered-wrong,
  .answer-option.wrong
) {
  border-color: var(--nn-quiz-danger) !important;
  background: rgba(139, 92, 102, 0.09) !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .question-response,
  .question-feedback,
  .answer-explanation
) {
  margin-top: 18px !important;
  padding: 16px 18px !important;
  border: 1px solid var(--nn-quiz-line) !important;
  border-radius: 15px;
  background: rgba(220, 232, 173, 0.36) !important;
  color: var(--nn-quiz-ink);
  font-size: 14px;
  line-height: 1.65;
}

/* Navigation and submission controls retain their native actions/state. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-buttons,
  .question-actions,
  .quiz-actions,
  .quiz-buttons .button-right
) {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .lp-button,
  button,
  input[type="submit"]
) {
  min-height: 50px;
  padding: 12px 24px !important;
  border: 1px solid var(--nn-quiz-green) !important;
  border-radius: 14px !important;
  background: var(--nn-quiz-green) !important;
  color: #FFFFFF !important;
  font-family: "Manrope", sans-serif !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.2;
  box-shadow: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .lp-button,
  button,
  input[type="submit"]
):not(:disabled):hover {
  border-color: var(--nn-quiz-accent) !important;
  background: var(--nn-quiz-accent) !important;
  transform: translateY(-1px);
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .lp-button,
  button,
  input[type="submit"]
):disabled,
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .lp-button.disabled,
  button.disabled
) {
  border-color: var(--nn-quiz-olive) !important;
  background: var(--nn-quiz-olive) !important;
  color: rgba(32, 39, 31, 0.48) !important;
  cursor: not-allowed;
  opacity: 1 !important;
  transform: none;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .button-prev-question,
  .prev-question,
  .quiz-buttons .button-left .lp-button
) {
  border-color: var(--nn-quiz-line) !important;
  background: var(--nn-quiz-card) !important;
  color: var(--nn-quiz-green) !important;
}

/* Existing question navigator. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-questions,
  .question-numbers,
  .quiz-question-numbers
) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 !important;
  padding: 14px !important;
  border: 1px solid var(--nn-quiz-line) !important;
  border-radius: 17px;
  background: var(--nn-quiz-card) !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .question-number,
  .quiz-question-number,
  .quiz-questions li
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  margin: 0 !important;
  border: 1px solid var(--nn-quiz-line) !important;
  border-radius: 11px !important;
  background: var(--nn-quiz-card) !important;
  color: var(--nn-quiz-muted) !important;
  font-size: 12px;
  font-weight: 800;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .question-number.current,
  .quiz-question-number.current,
  .quiz-questions li.current
) {
  border-color: var(--nn-quiz-accent) !important;
  background: var(--nn-quiz-accent) !important;
  color: #FFFFFF !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .question-number.answered,
  .quiz-question-number.answered,
  .quiz-questions li.answered
) {
  border-color: var(--nn-quiz-green) !important;
  background: var(--nn-quiz-olive) !important;
  color: var(--nn-quiz-green) !important;
}

/* Native LearnPress result screens. No pass mark or attempt value is added. */
body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .quiz-result,
  .quiz-result-content,
  .result-statistic
) {
  margin: 0 0 24px !important;
  padding: clamp(22px, 4vw, 36px) !important;
  border: 1px solid var(--nn-quiz-line) !important;
  border-radius: var(--nn-quiz-radius) !important;
  background: var(--nn-quiz-card) !important;
  box-shadow: var(--nn-quiz-shadow) !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
  .result-grade,
  .result-achieved,
  .result-require
) {
  color: var(--nn-quiz-green);
  font-family: "Prata", Georgia, serif;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .result-statistic ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .result-statistic li {
  min-width: 0;
  margin: 0 !important;
  padding: 16px !important;
  border: 1px solid var(--nn-quiz-line);
  border-radius: 15px;
  background: var(--nn-quiz-bg);
}

body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :focus-visible {
  outline: 3px solid var(--nn-quiz-accent) !important;
  outline-offset: 3px;
}

@media (max-width: 800px) {
  body.nn-lms.course-item-popup .content-item-wrap:has(#learn-press-quiz-app) {
    max-width: 760px !important;
    padding: 28px 20px 72px !important;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option label,
  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option .option-title {
    min-height: 64px;
    padding: 15px 18px !important;
  }
}

@media (max-width: 560px) {
  body.nn-lms.course-item-popup .content-item-wrap:has(#learn-press-quiz-app),
  body.nn-lms.single-lp_quiz #learn-press-quiz-app {
    padding-right: 18px !important;
    padding-left: 18px !important;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
    .quiz-status,
    .quiz-status__content,
    .quiz-meta
  ) {
    align-items: flex-start;
    gap: 10px;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
    .quiz-countdown,
    .countdown,
    .quiz-timer,
    .quiz-time,
    .quiz-status .time
  ) {
    padding: 6px 9px;
    border: 0;
    background: transparent;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
    .question-title,
    .question-title h3,
    .question-content > h3
  ) {
    font-size: clamp(23px, 7vw, 30px) !important;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-options {
    gap: 11px;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option {
    border-radius: 15px !important;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option label,
  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .answer-option .option-title {
    min-height: 62px;
    padding: 14px 16px !important;
    font-size: 14px;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
    .quiz-buttons,
    .question-actions,
    .quiz-actions,
    .quiz-buttons .button-right
  ) {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) :where(
    .lp-button,
    button,
    input[type="submit"]
  ) {
    width: 100%;
  }

  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) .result-statistic ul {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) *,
  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) *::before,
  body.nn-lms :where(#learn-press-quiz-app, .content-item-quiz) *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
