/* One stylesheet for the whole portal.
   KZN Business Training Centre, as on kznbusinesstraining.co.za: navy, green
   and cream. The green used for button fills is a shade darker than the
   website's, so white lettering on it stays readable. The fonts are the
   system's own — nothing is loaded from anywhere but this server, which is
   also what the Content-Security-Policy allows. */

:root {
  --brand: #0b2239;
  --brand-dark: #071829;
  --accent: #34bd6b;
  --accent-strong: #238b4f;
  --accent-strong-dark: #1c7542;
  --ink: #212529;
  --muted: #5f6b76;
  --line: #d7dce2;
  --line-soft: #e8ecf0;
  --bg: #f7f4e9;
  --panel: #ffffff;
  --good: #1a7f37;
  --bad: #b42318;
  --warn: #b54708;
  --radius: 8px;
  --font-body: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-heading: "Segoe UI Semibold", "Segoe UI", system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
}

body { display: flex; flex-direction: column; }

h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; font-family: var(--font-heading); color: var(--brand); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

p { margin: 0 0 12px; }
ol, ul { margin: 0 0 12px; padding-left: 22px; }
li { margin-bottom: 6px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ------------------------------------------------------------- chrome -- */

.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--brand);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}

.masthead .wordmark { font-family: var(--font-heading); font-size: 17px; letter-spacing: 0.2px; }
.masthead .where { font-size: 13px; opacity: 0.85; }
.masthead .spacer { flex: 1; }
.masthead .who { font-size: 13px; text-align: right; }
.masthead .saved { font-size: 12px; opacity: 0.8; }

main { flex: 1; min-height: 0; }

.sheet {
  max-width: 760px;
  margin: 28px auto;
  padding: 0 20px 40px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------- forms -- */

label { display: block; margin-bottom: 14px; font-size: 14px; }
label > span { display: block; margin-bottom: 4px; color: var(--brand); font-weight: 600; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-bottom: 4px; }

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.problem { display: block; color: var(--bad); font-size: 13px; margin-top: 4px; }
label.wrong input, label.wrong select { border-color: var(--bad); }

button {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--accent-strong-dark); }
button[disabled] { background: var(--line); color: var(--muted); cursor: default; }
button.quiet { background: transparent; color: var(--brand); border-color: var(--line); }
button.quiet:hover { background: var(--line-soft); }
button.link { background: none; border: none; color: #fff; text-decoration: underline; padding: 4px 0; font-weight: 400; font-size: 13px; }

.notice {
  padding: 12px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--warn);
  background: #fff8ef;
  margin-bottom: 16px;
}
.notice.bad { border-left-color: var(--bad); background: #fef3f2; }

/* ------------------------------------------------- the paper being sat -- */

#paper { display: none; height: 100%; }
#paper.open { display: flex; }

#instructions {
  width: 380px;
  flex: 0 0 380px;
  overflow-y: auto;
  padding: 18px 20px 40px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
#paper.narrow #instructions { display: none; }

#instructions .exercise { margin-bottom: 22px; }
#instructions .exercise h3 { margin-bottom: 2px; }
#instructions .tab {
  display: inline-block;
  font-size: 12px;
  color: var(--brand);
  background: var(--line-soft);
  border-radius: 4px;
  padding: 1px 7px;
  margin-bottom: 8px;
}
#instructions .note { font-size: 13px; color: var(--muted); }
#instructions ol { padding-left: 20px; }

#editor { flex: 1; min-width: 0; height: 100%; }
#editor > div, #editor iframe { width: 100%; height: 100%; border: 0; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------------ result -- */

.score {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}
.score .pct { font-family: var(--font-heading); font-size: 44px; color: var(--brand); line-height: 1; }
.score .band { font-weight: 600; }
.score .band.passed { color: var(--good); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--brand); font-size: 13px; }
td.marks, th.marks { text-align: right; white-space: nowrap; }
tr.total td { border-top: 2px solid var(--line); border-bottom: none; font-weight: 600; }

/* ---------------------------------------------------- facilitator pages -- */

.wide { max-width: 1180px; margin: 20px auto; padding: 0 20px 40px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; align-items: end; }
.filters label { margin-bottom: 10px; }

.actions { display: flex; gap: 10px; margin-top: 14px; }

td.passed, .band.passed { color: var(--good); }

.exercise { margin-bottom: 18px; }
.exercise h3 { margin-bottom: 4px; }
.exercise td:first-child { width: 18px; color: var(--good); }
.exercise td:nth-child(2) { width: 40%; }

input.code { font-family: Consolas, "Cascadia Mono", monospace; }

/* The facilitator prints a paper from this screen, for a client or for one
   delegate; the buttons and filters around it are not part of what goes to a
   manager. */
@media print {
  .noprint { display: none !important; }
  .masthead { background: #fff; color: var(--brand); border-bottom: 2px solid var(--brand); }
  .card { border: none; padding: 0 0 12px; }
  .wide { max-width: none; padding: 0; }
}
