[ng-cloak], .ng-cloak { display: none !important; }

:root {
  --bar: #2d3e50;
  --bar-2: #e9edf1;
  --accent: #1a6fb5;
  --accent-dark: #145a93;
  --ok: #1e7b34;
  --ok-bg: #e6f4ea;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --flag: #d9822b;
  --text: #1f2933;
  --muted: #61707f;
  --line: #cfd6dd;
  --page: #f4f6f8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar with timer ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bar);
  color: #fff;
}
.topbar-title { font-weight: bold; font-size: 15px; }
.timer { display: flex; align-items: center; gap: 8px; font-size: 15px; white-space: nowrap; }
.timer-value {
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 3px;
}
.timer.warning .timer-value { background: var(--bad); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.75; } }
.link-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.subbar {
  position: sticky;
  top: 46px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  background: var(--bar-2);
  border-bottom: 1px solid var(--line);
}
.qnum { font-weight: bold; }
.subbar-mid { color: var(--muted); font-size: 14px; font-style: italic; }
.flag { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.flag input { width: 16px; height: 16px; }
.flag-icon { color: #9aa5b1; font-size: 18px; }
.flag.on .flag-icon { color: var(--flag); }

/* ---------- question ---------- */
.question-pane {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 120px;
  background: #fff;
}
.exam-page .question-pane { min-height: calc(100vh - 160px); }
.question-text { white-space: pre-line; font-size: 17px; margin-bottom: 22px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
}
.option:hover { background: #f2f7fc; border-color: #a9c4dd; }
.option.selected { background: #e5f0fa; border-color: var(--accent); }
.option.disabled { opacity: 0.55; cursor: not-allowed; }
.option input { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.opt-letter { font-weight: bold; min-width: 20px; }
.opt-text { flex: 1; }

/* ---------- bottom bar ---------- */
.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bar-2);
  border-top: 1px solid var(--line);
}
.bottombar-left, .bottombar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.progress-text { color: var(--muted); font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-size: 15px;
  padding: 8px 16px;
  border: 1px solid #9aa5b1;
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.btn:hover:not([disabled]) { background: #eef2f5; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--accent-dark); }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-lg { font-size: 17px; padding: 11px 26px; }

/* ---------- review screen ---------- */
.review-help { color: var(--muted); }
.review-stats { display: flex; gap: 24px; margin: 12px 0 18px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.review-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #c4ccd4;
  border-radius: 3px;
  background: #fff;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.review-cell:hover { background: #f2f7fc; }
.review-cell.answered { border-left-color: var(--accent); }
.review-cell:not(.answered) .cell-status { color: var(--bad); }
.cell-num { font-weight: bold; }
.cell-status { font-size: 13px; color: var(--muted); }
.cell-flag { position: absolute; top: 6px; right: 8px; color: var(--flag); }

/* ---------- start page ---------- */
.start-card, .results {
  width: 100%;
  max-width: 1000px;
  margin: 24px auto;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.start-card h1 { margin-top: 0; }
.lead { color: var(--muted); font-size: 17px; }
h2 { font-size: 19px; margin: 26px 0 10px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e3e8ec; }
.info-table th { width: 200px; color: var(--muted); font-weight: normal; }
.info-table.domains th { width: auto; font-weight: bold; color: var(--text); }
.instructions ul { padding-left: 20px; }
kbd { border: 1px solid #b8c1ca; border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; font-size: 13px; background: #f7f9fa; }
.resume-box { margin-top: 20px; padding: 14px 18px; background: #fff8e6; border: 1px solid #f0d58c; border-radius: 4px; }
.resume-box p { margin-top: 0; }
.start-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.disclaimer { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 20px 28px; }

/* ---------- results ---------- */
.score-card { display: flex; gap: 32px; align-items: center; padding: 22px; border-radius: 4px; flex-wrap: wrap; }
.score-card.pass { background: var(--ok-bg); border: 1px solid #a8d5b5; }
.score-card.fail { background: var(--bad-bg); border: 1px solid #f0b4ad; }
.score-main { text-align: center; min-width: 150px; }
.score-label { color: var(--muted); }
.score-value { font-size: 54px; font-weight: bold; line-height: 1.1; }
.score-outcome { font-size: 22px; font-weight: bold; letter-spacing: 2px; }
.pass .score-outcome { color: var(--ok); }
.fail .score-outcome { color: var(--bad); }
.score-details { flex: 1; min-width: 260px; }
.score-bar { position: relative; height: 14px; background: #fff; border: 1px solid var(--line); border-radius: 7px; margin-top: 22px; }
.score-fill { height: 100%; border-radius: 7px; background: var(--accent); }
.pass .score-fill { background: var(--ok); }
.fail .score-fill { background: var(--bad); }
.score-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); }
.score-mark span { position: absolute; top: -20px; left: -14px; font-size: 12px; font-weight: bold; }
.score-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.score-facts { list-style: none; padding: 0; margin: 12px 0 0; }
.score-facts li { margin: 4px 0; }
.muted { color: var(--muted); font-size: 13px; }

.domain-row { display: grid; grid-template-columns: 320px 1fr 130px; gap: 12px; align-items: center; margin: 8px 0; }
.domain-bar { height: 12px; background: #e9edf1; border-radius: 6px; overflow: hidden; }
.domain-fill { height: 100%; background: var(--ok); }
.domain-fill.low { background: var(--bad); }
.domain-num { text-align: right; font-size: 14px; }

.answers-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.answers-head h2 { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); background: #fff; border-radius: 3px; cursor: pointer; }
.tabs button.active { background: var(--bar); color: #fff; border-color: var(--bar); }
.empty { color: var(--muted); }

.answer-item { margin-top: 16px; padding: 18px 20px; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 4px; }
.answer-item.right { border-left-color: var(--ok); }
.answer-item.wrong { border-left-color: var(--bad); }
.answer-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.badge { padding: 2px 8px; border-radius: 3px; font-weight: bold; font-size: 13px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.flagged-note { color: var(--flag); }
.answer-item .question-text { font-size: 16px; margin-bottom: 12px; }
.answer-options { list-style: none; padding: 0; margin: 0; }
.answer-options li { display: flex; gap: 8px; padding: 8px 12px; margin: 6px 0; border: 1px solid #e3e8ec; border-radius: 3px; }
.answer-options li.correct { background: var(--ok-bg); border-color: #a8d5b5; }
.answer-options li.chosen-wrong { background: var(--bad-bg); border-color: #f0b4ad; }
.opt-tag { font-size: 13px; font-weight: bold; white-space: nowrap; }
li.correct .opt-tag { color: var(--ok); }
li.chosen-wrong .opt-tag { color: var(--bad); }
.explanation { margin-top: 12px; padding: 10px 14px; background: #f4f7fa; border-radius: 3px; font-size: 15px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .subbar { top: 74px; }
  .topbar-title { font-size: 13px; }
  .question-pane { padding: 18px 14px 170px; }
  .bottombar { flex-direction: column; align-items: stretch; }
  .progress-text { text-align: center; }
  .domain-row { grid-template-columns: 1fr; gap: 4px; }
  .domain-num { text-align: left; }
  .start-card, .results { padding: 18px; margin: 0; border-radius: 0; }
}
