:root {
  --navy: #1F3864;
  --navy-light: #2c4d85;
  --gold: #B08D57;
  --gold-light: #D9C29A;
  --bg: #F7F5F1;
  --card-bg: #FFFFFF;
  --ink: #22242A;
  --muted: #5b5f6b;
  --good: #1c7c3f;
  --bad: #b3261e;
  --case-bg: #EDF2F7;
  --step-bg: #FBF6EC;
  --border: #E3DFD6;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Calibri", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar .brand {
  display: flex;
  flex-direction: column;
}

.topbar .brand strong {
  font-size: 20px;
  letter-spacing: 0.3px;
}

.topbar .brand span {
  font-size: 13px;
  color: var(--gold-light);
}

.topbar a.back {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
}
.topbar a.back:hover { background: rgba(255,255,255,0.12); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px 30px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

h1.page-title {
  color: var(--navy);
  font-size: 26px;
  margin: 0 0 6px;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 10px;
}

h2.section-title {
  color: var(--gold);
  font-size: 19px;
  margin: 0 0 12px;
  border-bottom: 2px solid var(--gold-light);
  padding-bottom: 6px;
}

h3 {
  color: var(--navy);
  font-size: 16.5px;
  margin: 18px 0 8px;
}

p { margin: 0 0 12px; font-size: 15.5px; }

ul.plain { padding-left: 20px; margin: 0 0 12px; }
ul.plain li { margin-bottom: 6px; }

.info-box {
  background: #F4F0E8;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 14.5px;
}
.info-box strong.label { display:block; color: var(--navy); margin-bottom: 6px; }

.case-box {
  background: var(--case-bg);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 14px 0;
}
.case-box .case-label { color: var(--navy); font-weight: bold; margin-bottom: 6px; }
.case-box .case-why { color: var(--gold); font-weight: bold; }

.step-box {
  background: var(--step-bg);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 14px 0;
}
.step-box .step-title { color: var(--navy); font-weight: bold; margin-bottom: 10px; }
.step-box .step-item { margin-bottom: 8px; }
.step-box .step-num { color: var(--gold); font-weight: bold; }

table.ref-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 18px;
  font-size: 14px;
}
table.ref-table th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 8px 10px;
}
table.ref-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.ref-table tr:nth-child(even) td { background: #F7F7F7; }

.progress-track {
  height: 8px;
  background: #e4e0d6;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--navy));
  transition: width .3s ease;
}
.progress-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

button, .btn {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: opacity .15s ease, transform .1s ease;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover:not(:disabled) { opacity: 0.9; }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover:not(:disabled) { background: rgba(31,56,100,0.06); }
.btn-danger-outline { background: transparent; color: var(--bad); border: 1.5px solid var(--bad); }

.quiz-q { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.quiz-q:last-child { border-bottom: none; }
.quiz-q .q-text { font-weight: 600; margin-bottom: 10px; }
.quiz-q label {
  display: block;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14.5px;
}
.quiz-q label:hover { border-color: var(--gold); }
.quiz-q label.correct { border-color: var(--good); background: #eaf7ee; }
.quiz-q label.incorrect { border-color: var(--bad); background: #fbeaea; }
.quiz-q label.selected:not(.correct):not(.incorrect) { border-color: var(--navy); background: #eef1f7; }
.quiz-q input { margin-right: 8px; }
.quiz-q.locked label { cursor: default; }

.score-banner {
  text-align: center;
  padding: 22px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.score-banner.pass { background: #eaf7ee; border: 1.5px solid var(--good); }
.score-banner.fail { background: #fbeaea; border: 1.5px solid var(--bad); }
.score-banner .big { font-size: 34px; font-weight: 800; }
.score-banner.pass .big { color: var(--good); }
.score-banner.fail .big { color: var(--bad); }

.module-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.module-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.module-card .m-info strong { color: var(--navy); font-size: 17px; display:block; margin-bottom:4px;}
.module-card .m-info span { color: var(--muted); font-size: 13.5px; }
.module-card .m-status {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: #eee;
  color: #666;
}
.module-card .m-status.done { background: #eaf7ee; color: var(--good); }

.name-gate {
  text-align: center;
  padding: 40px 20px;
}
.name-gate input {
  font-size: 16px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  width: 320px;
  max-width: 90%;
  margin: 14px 0 20px;
}

.cert-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

footer.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 20px;
}

/* ---- Added: module/unit illustrations & login gate ---- */
.module-banner {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 18px;
  display: block;
  background: var(--navy);
}
.unit-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.unit-icon-row .unit-icon {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 10px;
  background: var(--step-bg);
  border: 1px solid var(--gold-light);
  padding: 8px;
}
.unit-icon-row .unit-icon-label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.module-card .m-icon {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 8px;
  background: var(--step-bg);
  border: 1px solid var(--gold-light);
  padding: 6px;
}
.module-card .m-left { display: flex; align-items: center; gap: 14px; }

.auth-gate {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
  padding: 40px 30px;
}
.auth-gate img { width: 64px; height: 64px; margin-bottom: 14px; }
.auth-gate p { color: var(--muted); font-size: 14.5px; }
.auth-hidden { display: none !important; }
