/*
 * LMS3 SCORM Creator: the questions of a learning module and their result (lib/quiz.js). Comes after
 * lib/shell.css and lib/module.css. Correct and not correct are told by a word as well, not by the colour alone.
 */
.shell-page {
  --quiz-right: #1a7f37;
  --quiz-right-bg: #edf7ef;
  --quiz-wrong: #b42318;
  --quiz-wrong-bg: #fdf0ee;
}

/* a question */
.shell-page .module-question__set {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.shell-page .module-question__legend {
  display: block;
  width: 100%;
  margin: 0 0 0.75em;
  padding: 0;
  font-weight: 600;
  font-size: 1.05em;
}
.shell-page .module-question__title {
  display: block;
  margin-bottom: 0.25em;
  color: var(--shell-muted, #5b6573);
  font-size: 0.9em;
  font-weight: 600;
}
.shell-page .module-question__text {
  display: block;
}
.shell-page .module-question__more {
  margin: -0.25em 0 0.75em;
}
.shell-page .module-question__more > :first-child {
  margin-top: 0;
}
.shell-page .module-question__more > :last-child {
  margin-bottom: 0;
}

/* the answers: rows that are easy to hit, also with a finger */
.shell-page .module-question__options {
  display: grid;
  gap: 8px;
}
.shell-page .module-question__option {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 12px;
  box-sizing: border-box;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--shell-line, #dfe3e8);
  border-radius: 8px;
  background: #ffffff;
  line-height: 1.45;
  cursor: pointer;
}
.shell-page .module-question__option:hover {
  background: var(--shell-hover, #f1f3f5);
}
.shell-page .module-question__option:has(.module-question__input:checked) {
  border-color: var(--shell-accent, #1f2937);
  box-shadow: inset 0 0 0 1px var(--shell-accent, #1f2937);
}
.shell-page .module-question__option:focus-within {
  outline: 2px solid var(--shell-accent, #1f2937);
  outline-offset: 2px;
}
.shell-page .module-question__input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--shell-accent, #1f2937);
  cursor: inherit;
}
.shell-page .module-question__answer {
  flex: 1 1 12em;
  min-width: 0;
}
.shell-page .module-question__mark:empty {
  display: none;
}
.shell-page .module-question__mark {
  flex: 0 0 auto;
  align-self: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
}

/* after "Check answer" */
.shell-page .module-question__set:disabled .module-question__option {
  cursor: default;
}
.shell-page .module-question__set:disabled .module-question__option:hover {
  background: #ffffff;
}
.shell-page .module-question__option.is-right {
  border-color: var(--quiz-right);
  box-shadow: inset 0 0 0 1px var(--quiz-right);
  background: var(--quiz-right-bg);
}
.shell-page .module-question__set:disabled .module-question__option.is-right:hover {
  background: var(--quiz-right-bg);
}
.shell-page .module-question__option.is-right .module-question__mark {
  background: var(--quiz-right);
  color: #ffffff;
}
.shell-page .module-question__option.is-mistake.is-chosen {
  border-color: var(--quiz-wrong);
  box-shadow: inset 0 0 0 1px var(--quiz-wrong);
  background: var(--quiz-wrong-bg);
}
.shell-page .module-question__set:disabled .module-question__option.is-mistake.is-chosen:hover {
  background: var(--quiz-wrong-bg);
}
.shell-page .module-question__option.is-mistake.is-chosen .module-question__mark {
  background: var(--quiz-wrong);
  color: #ffffff;
}
.shell-page .module-question__option.is-chosen:not(.is-mistake) .module-question__mark,
.shell-page .module-question__option.is-right .module-question__mark {
  background: var(--quiz-right);
  color: #ffffff;
}

/* the buttons */
.shell-page .module-question__actions,
.shell-page .module-result__actions {
  margin: 14px 0 0;
}
.shell-page .module-question__check,
.shell-page .module-result__retry {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--shell-accent, #1f2937);
  color: var(--shell-accent-contrast, #ffffff);
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.shell-page .module-question__check:hover,
.shell-page .module-result__retry:hover {
  filter: brightness(1.1);
}
.shell-page .module-question__check:focus-visible,
.shell-page .module-result__retry:focus-visible,
.shell-page .module-result__go:focus-visible {
  outline: 2px solid var(--shell-accent, #1f2937);
  outline-offset: 2px;
}

/* the feedback */
.shell-page .module-question__feedback:empty {
  display: none;
}
.shell-page .module-question__feedback {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--shell-line, #dfe3e8);
  border-radius: 4px;
  background: var(--shell-hover, #f1f3f5);
}
.shell-page .module-question__feedback p {
  margin: 0;
}
.shell-page .module-question__feedback p + p {
  margin-top: 0.4em;
}
.shell-page .module-question.is-correct .module-question__feedback {
  border-left-color: var(--quiz-right);
  background: var(--quiz-right-bg);
}
.shell-page .module-question.is-wrong .module-question__feedback {
  border-left-color: var(--quiz-wrong);
  background: var(--quiz-wrong-bg);
}
.shell-page .module-question__verdict {
  font-weight: 700;
}
.shell-page .module-question.is-correct .module-question__verdict {
  color: var(--quiz-right);
}
.shell-page .module-question.is-wrong .module-question__verdict {
  color: var(--quiz-wrong);
}

/* the result */
.shell-page .module-result__header {
  margin: 0 0 0.6em;
}
.shell-page .module-result__text {
  margin: 0 0 1em;
}
.shell-page .module-result__text > :last-child {
  margin-bottom: 0;
}
.shell-page .module-result__status:empty {
  display: none;
}
.shell-page .module-result__status {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--shell-line, #dfe3e8);
  border-radius: 8px;
  font-size: 1.05em;
  font-weight: 600;
}
.shell-page .module-result.is-passed .module-result__status {
  border-color: var(--quiz-right);
  background: var(--quiz-right-bg);
  color: var(--quiz-right);
}
.shell-page .module-result.is-failed .module-result__status {
  border-color: var(--quiz-wrong);
  background: var(--quiz-wrong-bg);
  color: var(--quiz-wrong);
}
.shell-page .module-result__details {
  margin: 1.25em 0 0;
}
.shell-page .module-result__list-title {
  margin: 0 0 0.4em;
  font-weight: 600;
}
.shell-page .module-result__list {
  margin: 0;
  padding-left: 1.6em;
}
.shell-page .module-result__list li + li {
  margin-top: 0.3em;
}
.shell-page .module-result__go {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--shell-link, #1d4ed8);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.shell-page .module-result__state {
  color: var(--shell-muted, #5b6573);
  white-space: nowrap;
}
.shell-page .module-result__list .is-correct .module-result__state {
  color: var(--quiz-right);
  font-weight: 600;
}
.shell-page .module-result__list .is-wrong .module-result__state {
  color: var(--quiz-wrong);
  font-weight: 600;
}
.shell-page .module-result__state::before {
  content: "\2013\00a0";
  color: var(--shell-muted, #5b6573);
  font-weight: 400;
}

@media print {
  .shell-page .module-question__check,
  .shell-page .module-result__actions {
    display: none;
  }
}

/* --- matching: cards onto places ------------------------------------------------------------------------ */
.shell-page .module-matching__hint {
  margin: 0 0 12px;
  color: var(--shell-muted, #5b6573);
}
.shell-page .module-matching__board {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 640px) {
  .shell-page .module-matching__board {
    grid-template-columns: minmax(0, 1fr);
  }
}
.shell-page .module-matching__targets,
.shell-page .module-matching__cards {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shell-page .module-matching__target,
.shell-page .module-matching__place {
  margin: 0;
  padding: 0;
}
.shell-page .module-matching__target::before,
.shell-page .module-matching__place::before {
  content: none;
}
.shell-page .module-matching__place:empty {
  display: none;
}
.shell-page .module-matching__target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--shell-line, #dfe3e8);
  border-radius: 8px;
  background: #ffffff;
}
.shell-page .module-matching__prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  line-height: 1.35;
}
.shell-page .module-matching__image {
  display: block;
  flex: none;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}
.shell-page .module-matching__drop {
  min-width: 0;
}
.shell-page .module-matching__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 2px dashed var(--shell-line, #c7ced6);
  border-radius: 8px;
  background: #f8f9fb;
  color: var(--shell-muted, #5b6573);
  font: inherit;
  font-size: 0.9em;
  cursor: pointer;
}
.shell-page .is-choosing .module-matching__slot,
.shell-page .module-matching__target.is-over .module-matching__slot {
  border-color: var(--shell-accent, #1f2937);
  color: var(--shell-text, #1f2937);
}
.shell-page .module-matching__target.is-over {
  box-shadow: 0 0 0 2px var(--shell-accent, #1f2937);
}
.shell-page .module-matching__pool-label {
  margin: 0 0 8px;
  font-weight: 600;
}
.shell-page .module-matching__card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--shell-line, #dfe3e8);
  border-radius: 8px;
  background: #ffffff;
  color: var(--shell-text, #1f2937);
  font: inherit;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.shell-page .module-matching__card:hover:not(:disabled) {
  border-color: var(--shell-accent, #1f2937);
}
.shell-page .module-matching__card.is-chosen {
  border-color: var(--shell-accent, #1f2937);
  box-shadow: 0 0 0 2px var(--shell-accent, #1f2937);
}
.shell-page .module-matching__card.is-dragging {
  position: relative;
  z-index: 10;
  cursor: grabbing;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.25);
}
.shell-page .module-matching__card:disabled {
  cursor: default;
}
.shell-page .module-matching__card:focus-visible,
.shell-page .module-matching__slot:focus-visible {
  outline: 2px solid var(--shell-accent, #1f2937);
  outline-offset: 2px;
}
.shell-page .module-matching__text--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.shell-page .module-matching__status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--shell-muted, #5b6573);
  font-size: 0.9em;
}
.shell-page .module-matching__target.is-right {
  border-color: var(--quiz-right);
  background: var(--quiz-right-bg);
}
.shell-page .module-matching__target.is-mistake {
  border-color: var(--quiz-wrong);
  background: var(--quiz-wrong-bg);
}
.shell-page .module-matching__correct {
  grid-column: 1 / -1;
  color: var(--quiz-wrong);
  font-size: 0.9em;
  font-weight: 600;
}

/* answered: the cards are on their places, the pile of cards has nothing left */
.shell-page .module-question.is-answered .module-matching__pool {
  display: none;
}
.shell-page .module-question.is-answered .module-matching__board {
  grid-template-columns: minmax(0, 1fr);
}

/* --- find the area: a point on the image ------------------------------------------------------------------ */
.shell-page .module-findarea__hint {
  margin: 0 0 10px;
  color: var(--shell-muted, #5b6573);
}
.shell-page .module-findarea__stage {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  cursor: crosshair;
  border-radius: 8px;
}
.shell-page .module-findarea__stage[aria-disabled="true"] {
  cursor: default;
}
.shell-page .module-findarea__stage:focus-visible {
  outline: 3px solid var(--shell-accent, #1f2937);
  outline-offset: 3px;
}
.shell-page .module-findarea__image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  pointer-events: none;
  user-select: none;
}
.shell-page .module-findarea__marker {
  position: absolute;
  width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--shell-accent, #1f2937);
  box-shadow: 0 0 0 2px var(--shell-accent, #1f2937), 0 3px 8px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.shell-page .module-findarea__marker.is-right {
  background: var(--quiz-right);
  box-shadow: 0 0 0 2px var(--quiz-right), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.shell-page .module-findarea__marker.is-mistake {
  background: var(--quiz-wrong);
  box-shadow: 0 0 0 2px var(--quiz-wrong), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.shell-page .module-findarea__area {
  position: absolute;
  box-sizing: border-box;
  border: 3px dashed var(--quiz-right);
  border-radius: 50%;
  background: rgba(26, 127, 55, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.shell-page .module-findarea__area--rect {
  border-radius: 4px;
}
.shell-page .module-findarea__status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--shell-muted, #5b6573);
  font-size: 0.9em;
  text-align: center;
}

/* --- sorting: the steps in their order -------------------------------------------------------------------- */
.shell-page .module-sorting__hint {
  margin: 0 0 12px;
  color: var(--shell-muted, #5b6573);
}
.shell-page .module-sorting__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: module-sorting;
}
.shell-page .module-sorting__item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  min-height: 52px;
  box-sizing: border-box;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--shell-line, #dfe3e8);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  counter-increment: module-sorting;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.shell-page .module-sorting__item::before {
  content: counter(module-sorting);
  position: static;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--shell-hover, #f1f3f5);
  color: var(--shell-muted, #5b6573);
  font-size: 0.85em;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}
.shell-page .module-sorting__item.is-dragging {
  border-color: var(--shell-accent, #1f2937);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.22);
  cursor: grabbing;
}
.shell-page .module-sorting__handle {
  flex: none;
  width: 10px;
  height: 18px;
  background: radial-gradient(circle, var(--shell-muted, #5b6573) 1.5px, transparent 1.6px) 0 0 / 5px 6px;
  opacity: 0.6;
}
.shell-page .module-sorting__image {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}
.shell-page .module-sorting__text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.shell-page .module-sorting__moves {
  display: flex;
  flex: none;
  gap: 4px;
}
.shell-page .module-sorting__up,
.shell-page .module-sorting__down {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--shell-line, #dfe3e8);
  border-radius: 6px;
  background: #ffffff;
  color: var(--shell-text, #1f2937);
  font: inherit;
  font-size: 1.05em;
  cursor: pointer;
}
.shell-page .module-sorting__up:disabled,
.shell-page .module-sorting__down:disabled {
  opacity: 0.3;
  cursor: default;
}
.shell-page .module-sorting__up:focus-visible,
.shell-page .module-sorting__down:focus-visible {
  outline: 2px solid var(--shell-accent, #1f2937);
  outline-offset: 2px;
}
.shell-page .is-answered .module-sorting__item {
  cursor: default;
}
.shell-page .is-answered .module-sorting__moves {
  display: none;
}
.shell-page .module-sorting__item.is-right {
  border-color: var(--quiz-right);
  background: var(--quiz-right-bg);
}
.shell-page .module-sorting__item.is-mistake {
  border-color: var(--quiz-wrong);
  background: var(--quiz-wrong-bg);
}
.shell-page .module-sorting__status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--shell-muted, #5b6573);
  font-size: 0.9em;
}
.shell-page .module-sorting__solution {
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 3px solid var(--quiz-right);
  background: var(--quiz-right-bg);
  border-radius: 0 6px 6px 0;
}
.shell-page .module-sorting__solution p {
  margin: 0 0 4px;
  font-weight: 600;
}
.shell-page .module-sorting__solution ol {
  margin: 0;
  padding-left: 1.4em;
}

/* --- fill in the blanks ----------------------------------------------------------------------------------- */
.shell-page .module-cloze__text {
  line-height: 2.1;
}
.shell-page .module-cloze__text > :first-child {
  margin-top: 0;
}
.shell-page .module-cloze__gap {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.shell-page .module-cloze__input,
.shell-page .module-cloze__select {
  min-height: 36px;
  box-sizing: border-box;
  padding: 4px 8px;
  border: 1px solid var(--shell-line, #c7ced6);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--shell-text, #1f2937);
  font: inherit;
  line-height: 1.3;
  max-width: 100%;
}
.shell-page .module-cloze__input:focus-visible,
.shell-page .module-cloze__select:focus-visible {
  outline: 2px solid var(--shell-accent, #1f2937);
  outline-offset: 1px;
}
.shell-page .module-cloze__gap.is-right .module-cloze__input,
.shell-page .module-cloze__gap.is-right .module-cloze__select {
  border-color: var(--quiz-right);
  background: var(--quiz-right-bg);
}
.shell-page .module-cloze__gap.is-mistake .module-cloze__input,
.shell-page .module-cloze__gap.is-mistake .module-cloze__select {
  border-color: var(--quiz-wrong);
  background: var(--quiz-wrong-bg);
}
.shell-page .module-cloze__correct {
  color: var(--quiz-right);
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.3;
}

/* --- label the image: the places on the image (a list below it on a narrow screen) -------------------------- */
.shell-page .module-labelimage__stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
}
.shell-page .module-labelimage__picture {
  position: relative;
}
.shell-page .module-labelimage__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  /* the image, its places and the labels below it fit on one screen: no scrolling while dragging */
  max-height: min(32rem, 55vh);
  border-radius: 8px;
}
.shell-page .module-labelimage__marker,
.shell-page .module-labelimage__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--shell-accent, #1f2937);
  color: var(--shell-accent-contrast, #ffffff);
  font-size: 0.85em;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  flex: none;
}
.shell-page .module-labelimage__marker {
  position: absolute;
  transform: translate(-50%, -50%);
}
.shell-page .module-labelimage__targets {
  margin: 14px 0 0;
}
.shell-page .module-labelimage__target {
  grid-template-columns: auto minmax(0, 1fr);
}
.shell-page .module-labelimage__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shell-page .module-labelimage__cards .module-matching__card {
  width: auto;
}
@media (min-width: 720px) {
  /* a wide screen: every place stands on the image, beside its point */
  .shell-page .module-labelimage__marker {
    display: none;
  }
  .shell-page .module-labelimage__targets {
    position: absolute;
    inset: 0;
    margin: 0;
    display: block;
  }
  .shell-page .module-labelimage__target {
    position: absolute;
    left: var(--x);
    top: var(--y);
    display: flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    max-width: 16rem;
    padding: 4px;
    transform: translate(-14px, -50%);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.2);
  }
  /* an empty place is a small box beside its point: it does not hide the part of the image to label (the
     button keeps its name for a screen reader) */
  .shell-page .module-labelimage__target .module-matching__slot {
    width: 3rem;
    min-height: 32px;
    padding: 2px;
  }
  .shell-page .module-labelimage__empty {
    display: none;
  }
  .shell-page .module-labelimage__target .module-matching__card {
    min-height: 32px;
    padding: 2px 10px;
  }
  .shell-page .module-labelimage__target .module-matching__correct {
    position: absolute;
    left: 38px;
    top: 100%;
    margin-top: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #ffffff;
    white-space: nowrap;
  }
}
