/* CISSP Exam Simulator: only the rules the tool template does not cover.
   Right and wrong use fixed green and red, because those colors carry
   meaning; everything interactive uses the accent tokens. */

#cissp-exam .cx-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

#cissp-exam .cx-mode {
  display: flex;
  flex-direction: column;
  margin: 0;
}

#cissp-exam .cx-mode .tool-actions {
  margin-top: auto;
  padding-top: 8px;
}

#cissp-exam .cx-mode > p {
  font-size: 0.92em;
  line-height: 1.5;
}

#cissp-exam .cx-facts li {
  padding: 2px 0;
}

#cissp-exam .cx-count {
  max-width: 8em;
}

#cissp-exam fieldset {
  border: 0;
  margin: 0 0 10px;
  padding: 0;
  min-width: 0;
}

#cissp-exam .cx-domains label,
#cissp-exam .cx-options label {
  display: block;
  font-size: 0.9em;
  line-height: 1.5;
  cursor: pointer;
}

#cissp-exam .cx-question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

#cissp-exam .cx-question-head .tool-pill {
  font-size: 12px;
  padding: 3px 8px;
}

#cissp-exam .cx-question-head .cx-muted {
  background: var(--site-accent-soft);
  color: inherit;
}

#cissp-exam .cx-question-head .cx-timer {
  margin-left: auto;
  font-family: "Roboto Mono", monospace;
}

#cissp-exam .cx-stem {
  font-size: 1.1em;
  line-height: 1.55;
  white-space: pre-line;
  margin-bottom: 14px;
}

#cissp-exam .cx-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 2px solid var(--site-accent-muted);
  border-radius: 6px;
  cursor: pointer;
}

#cissp-exam .cx-choice:hover {
  border-color: var(--site-accent);
}

#cissp-exam .cx-choice:has(input:checked) {
  border-color: var(--site-accent);
  background: var(--site-accent-soft);
}

#cissp-exam .cx-choice:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--site-accent-ring);
}

#cissp-exam .cx-choice input {
  margin-top: 4px;
}

#cissp-exam .cx-letter {
  font-weight: 700;
  min-width: 1.2em;
}

/* After an answer the right and wrong marks must win over the hover and
   selected styles above, so they repeat those selectors. */
#cissp-exam .cx-choice.cx-right,
#cissp-exam .cx-choice.cx-right:hover,
#cissp-exam .cx-choice.cx-right:has(input:checked),
#cissp-exam .cx-review-options .cx-right {
  border-color: #1b7a36;
  background: rgba(27, 122, 54, 0.12);
}

#cissp-exam .cx-choice.cx-wrong,
#cissp-exam .cx-choice.cx-wrong:hover,
#cissp-exam .cx-choice.cx-wrong:has(input:checked),
#cissp-exam .cx-review-options .cx-wrong {
  border-color: #b3261e;
  background: rgba(179, 38, 30, 0.10);
}

#cissp-exam .cx-feedback {
  border-left: 4px solid var(--site-accent);
  padding: 8px 14px;
  margin: 10px 0 14px;
}

#cissp-exam .cx-verdict,
#cissp-exam .cx-result-headline {
  font-weight: 700;
  margin-bottom: 6px;
}

#cissp-exam .cx-verdict-right { color: #1b7a36; }
#cissp-exam .cx-verdict-wrong { color: #b3261e; }

#cissp-exam .cx-answer {
  font-weight: 600;
  margin-bottom: 6px;
}

#cissp-exam .cx-why {
  line-height: 1.55;
  margin-bottom: 0;
}

#cissp-exam .cx-table-wrap {
  overflow-x: auto;
  margin: 12px 0 18px;
}

#cissp-exam .cx-table {
  border-collapse: collapse;
  font-size: 0.92em;
}

#cissp-exam .cx-table th,
#cissp-exam .cx-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--site-accent-muted);
  text-align: left;
}

#cissp-exam .cx-table td {
  text-align: right;
}

#cissp-exam .cx-table td:last-child {
  text-align: left;
}

#cissp-exam .cx-review-title {
  font-size: 1em;
  margin-top: 8px;
}

#cissp-exam .cx-review-item {
  border: 1px solid var(--site-accent-muted);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

#cissp-exam .cx-review-item summary {
  cursor: pointer;
  font-weight: 600;
}

#cissp-exam .cx-review-options li {
  padding: 3px 6px;
  border-left: 3px solid transparent;
  margin-bottom: 3px;
}

/* Dark mode is Quarto's Darkly, marked on the body. */
body.quarto-dark #cissp-exam .cx-verdict-right { color: #5fd07f; }
body.quarto-dark #cissp-exam .cx-verdict-wrong { color: #ff7b72; }
body.quarto-dark #cissp-exam .cx-choice.cx-right,
body.quarto-dark #cissp-exam .cx-choice.cx-right:has(input:checked),
body.quarto-dark #cissp-exam .cx-review-options .cx-right { border-color: #5fd07f; background: rgba(95, 208, 127, 0.16); }
body.quarto-dark #cissp-exam .cx-choice.cx-wrong,
body.quarto-dark #cissp-exam .cx-choice.cx-wrong:has(input:checked),
body.quarto-dark #cissp-exam .cx-review-options .cx-wrong { border-color: #ff7b72; background: rgba(255, 123, 114, 0.14); }
