/* =========================
   Reset + Base
   ========================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b1020;
  color: #e9edf7;
  line-height: 1.4;
}

.hidden { display: none !important; }

.container {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 14px;
}

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  background: #121a33;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}

.center { text-align: center; }

h1 { font-size: 28px; margin-bottom: 10px; }
h2 { font-size: 22px; margin-bottom: 8px; }
h3 { font-size: 18px; margin: 12px 0 8px; }

.muted { opacity: 0.85; }
.tiny { font-size: 12px; margin-top: 10px; opacity: 0.8; }

/* =========================
   Buttons
   ========================= */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  background: #2d5bff;
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 650;
  transition: filter 120ms ease, transform 120ms ease;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn.secondary { background: #243058; }
.btn.danger { background: #ff3b3b; }

.btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.35);
  outline-offset: 2px;
}

/* =========================
   Disclaimer
   ========================= */
.disclaimer {
  padding: 12px 14px;
  margin: 14px 0;
  background: rgba(234, 179, 8, 0.10);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 10px;
  font-size: 13px;
  color: #c9a227;
  line-height: 1.5;
}

/* =========================
   Notice
   ========================= */
.notice {
  padding: 12px;
  margin: 14px 0;
  background: rgba(45, 91, 255, 0.12);
  border: 1px solid rgba(45, 91, 255, 0.25);
  border-radius: 12px;
}

/* =========================
   Topbar
   ========================= */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stat .label { font-size: 12px; opacity: 0.8; display: block; }
.stat .value { font-size: 16px; font-weight: 700; }

#timer.warning { color: #ffd34d; }

/* =========================
   Progress
   ========================= */
.progress-wrap { margin-bottom: 14px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  height: 12px;
}

.progress-bar {
  height: 12px;
  background: #2d5bff;
  width: 0%;
  transition: width 200ms ease;
}

/* =========================
   Question
   ========================= */
.q-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 12px;
  margin-top: 6px;
}

.question-text { margin: 12px 0 14px; font-size: 16px; }

/* Options */
.options { display: grid; gap: 10px; }

.option {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  user-select: none;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.option:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
}

.option:active { transform: translateY(1px); }

.option input { margin-top: 4px; cursor: pointer; }
.option label { cursor: pointer; width: 100%; }

.option.selected {
  border-color: rgba(45, 91, 255, 0.8);
  background: rgba(45, 91, 255, 0.14);
}

.option.disabled { cursor: default; opacity: 0.92; transform: none; }
.option.correct { border-color: rgba(0, 255, 160, 0.65); background: rgba(0, 255, 160, 0.10); }
.option.incorrect { border-color: rgba(255, 59, 59, 0.7); background: rgba(255, 59, 59, 0.10); }

.explanation {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

/* =========================
   Navigation
   ========================= */
.navigation {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   Review
   ========================= */
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px;
}

.review-question-btn {
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #e9edf7;
  cursor: pointer;
  font-weight: 750;
}

.review-question-btn:hover { filter: brightness(1.05); }
.review-question-btn.answered { border-color: rgba(45, 91, 255, 0.7); }
.review-question-btn.flagged { border-color: rgba(255, 211, 77, 0.9); }
.review-question-btn.current { outline: 2px solid rgba(255,255,255,0.35); }

.legend {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 6px;
}

.legend.answered { background: rgba(45,91,255,0.20); }
.legend.flagged { background: rgba(255,211,77,0.18); }
.legend.current { background: rgba(255,255,255,0.12); }

/* =========================
   Results
   ========================= */
.score-box { margin: 12px 0 10px; }

.score-big { font-size: 44px; font-weight: 900; }

.pass-status {
  margin: 10px 0 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight: 800;
}

.pass-status.pass { border-color: rgba(0,255,160,0.45); }
.pass-status.fail { border-color: rgba(255,59,59,0.55); }

.domain-breakdown { display: grid; gap: 10px; margin-top: 10px; }

.domain-result {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.domain-score.good { color: #00ffa0; font-weight: 800; }
.domain-score.average { color: #ffd34d; font-weight: 800; }
.domain-score.poor { color: #ff3b3b; font-weight: 800; }

/* =========================
   Mobile
   ========================= */
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .navigation { flex-direction: column; }
  .btn { width: 100%; }
}

/* =========================
   Per-exam accent colors
   ========================= */
/* Linux+ — green */
body.linuxplus .btn:not(.secondary):not(.danger) { background: #22c55e; }
body.linuxplus .progress-bar { background: #22c55e; }
body.linuxplus .option.selected { border-color: rgba(34,197,94,0.8); background: rgba(34,197,94,0.12); }
body.linuxplus .review-question-btn.answered { border-color: rgba(34,197,94,0.7); }
body.linuxplus .legend.answered { background: rgba(34,197,94,0.20); }

/* Network+ — orange */
body.netplus .btn:not(.secondary):not(.danger) { background: #f97316; }
body.netplus .progress-bar { background: #f97316; }
body.netplus .option.selected { border-color: rgba(249,115,22,0.8); background: rgba(249,115,22,0.12); }
body.netplus .review-question-btn.answered { border-color: rgba(249,115,22,0.7); }
body.netplus .legend.answered { background: rgba(249,115,22,0.20); }

/* =========================
   Back link (exam pages)
   ========================= */
.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  color: rgba(233,237,247,0.65);
  text-decoration: none;
}
.back-link:hover { color: #e9edf7; }

/* =========================
   Hub page
   ========================= */
body.hub {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
}

.hub-wrap {
  width: 100%;
  max-width: 1040px;
}

.hub-header {
  text-align: center;
  margin-bottom: 36px;
}

.hub-header h1 { font-size: 32px; margin-bottom: 8px; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.exam-card {
  display: flex;
  flex-direction: column;
  background: #121a33;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: #e9edf7;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.30);
}

.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
}

.exam-card.secplus:hover  { border-color: rgba(45,91,255,0.55); }
.exam-card.linuxplus:hover { border-color: rgba(34,197,94,0.55); }
.exam-card.netplus:hover   { border-color: rgba(249,115,22,0.55); }

.exam-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.exam-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.08);
}

.exam-card.secplus  .exam-badge { background: rgba(45,91,255,0.20);  color: #7da8ff; }
.exam-card.linuxplus .exam-badge { background: rgba(34,197,94,0.20); color: #4ade80; }
.exam-card.netplus   .exam-badge { background: rgba(249,115,22,0.20);color: #fb923c; }

.exam-card h2 { font-size: 24px; margin-bottom: 8px; }

.exam-desc {
  font-size: 14px;
  opacity: 0.75;
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}

.exam-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 0;
}

.exam-meta li {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
}

.exam-cta {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.85;
  transition: opacity 120ms ease;
}
.exam-card:hover .exam-cta { opacity: 1; }

.exam-card.secplus  .exam-cta { color: #7da8ff; }
.exam-card.linuxplus .exam-cta { color: #4ade80; }
.exam-card.netplus   .exam-cta { color: #fb923c; }

.hub-footer {
  text-align: center;
  margin-top: 32px;
}

@media (max-width: 640px) {
  .hub-header h1 { font-size: 24px; }
  .hub-grid { grid-template-columns: 1fr; }
}
