/* SAMAF Training Centre - quiet, document-like. Carlito = metric twin of Calibri. */

@font-face {
  font-family: 'Carlito';
  src: url('/fonts/Carlito-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Carlito';
  src: url('/fonts/Carlito-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #f6f8f9;
  --card: #ffffff;
  --ink: #16232b;
  --muted: #5a6b74;
  --line: #d8e0e3;
  --teal: #0e5a63;
  --teal-dark: #0a444b;
  --teal-soft: #e3eef0;
  --pass: #1d7a4f;
  --pass-soft: #e4f2ea;
  --fail: #b3372f;
  --fail-soft: #f8e9e7;
  --warn-soft: #fdf3dc;
  --warn-ink: #7a5b12;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(22, 35, 43, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Carlito', Calibri, 'Segoe UI', sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
}

/* ---------- layout ---------- */

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

.topbar {
  background: var(--teal);
  color: #fff;
  border-bottom: 3px solid var(--teal-dark);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
}
.brand span { font-weight: 400; opacity: 0.92; }
.topnav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.topnav a, .topnav button {
  color: #eaf3f4;
  text-decoration: none;
  font: inherit;
  font-size: 15px;
  padding: 5px 10px;
  border-radius: 4px;
  background: none;
  border: 0;
  cursor: pointer;
}
.topnav a:hover, .topnav button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.topnav a.active { background: rgba(255, 255, 255, 0.18); color: #fff; }
.topnav .who { color: #bcd6d9; font-size: 14px; padding: 5px 6px; }

.foot {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  color: var(--muted);
  font-size: 13.5px;
  border-top: 1px solid var(--line);
}

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 26px 0 8px; }
h3 { font-size: 17px; margin: 18px 0 6px; }
p { margin: 8px 0; }
a { color: var(--teal); }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* ---------- cards, lists ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 14px 0;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.module {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.module .m-title { font-weight: 700; font-size: 17.5px; }
.module .m-desc { color: var(--muted); font-size: 15px; margin-top: 3px; }
.module .m-side { text-align: right; flex-shrink: 0; }

.chip {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip.pass { background: var(--pass-soft); color: var(--pass); }
.chip.fail { background: var(--fail-soft); color: var(--fail); }
.chip.todo { background: var(--teal-soft); color: var(--teal); }
.chip.plain { background: #eef1f2; color: var(--muted); }

/* ---------- forms ---------- */

label { display: block; font-weight: 700; font-size: 15px; margin: 14px 0 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
  width: 100%;
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
  border-color: var(--teal);
}
textarea { min-height: 180px; resize: vertical; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 15.5px;
  color: #fff;
  background: var(--teal);
  border: 1px solid var(--teal-dark);
  border-radius: 4px;
  padding: 9px 18px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--teal-dark); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost {
  background: #fff;
  color: var(--teal);
  border-color: var(--line);
  font-weight: 400;
}
.btn.ghost:hover { border-color: var(--teal); }
.btn.small { font-size: 14px; padding: 5px 12px; }
.btn.danger { background: #fff; color: var(--fail); border-color: var(--line); font-weight: 400; }
.btn.danger:hover { border-color: var(--fail); }

.actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.msg { padding: 10px 14px; border-radius: 4px; margin: 12px 0; font-size: 15px; }
.msg.err { background: var(--fail-soft); color: var(--fail); }
.msg.ok { background: var(--pass-soft); color: var(--pass); }
.msg.note { background: var(--warn-soft); color: var(--warn-ink); }

/* ---------- quiz ---------- */

.qcard { margin: 16px 0; }
.qnum { color: var(--teal); font-weight: 700; font-size: 14px; letter-spacing: 0.4px; }
.qtext { font-weight: 700; margin: 4px 0 10px; }
.opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 6px 0;
  cursor: pointer;
  background: #fff;
}
.opt:hover { border-color: var(--teal); }
.opt input { margin-top: 4px; accent-color: var(--teal); flex-shrink: 0; }
.opt.sel { border-color: var(--teal); background: var(--teal-soft); }
.opt .ol { font-weight: 700; color: var(--teal); }

.result-band {
  text-align: center;
  padding: 22px 18px;
  border-radius: var(--radius);
  margin: 16px 0;
  border: 1px solid var(--line);
}
.result-band.pass { background: var(--pass-soft); border-color: #bfe0cd; }
.result-band.fail { background: var(--fail-soft); border-color: #ecc7c2; }
.result-band .big { font-size: 34px; font-weight: 700; }
.result-band.pass .big { color: var(--pass); }
.result-band.fail .big { color: var(--fail); }

.ritem { border-left: 3px solid var(--line); padding: 2px 0 2px 14px; margin: 16px 0; }
.ritem.ok { border-left-color: var(--pass); }
.ritem.no { border-left-color: var(--fail); }
.ritem .verdict { font-weight: 700; font-size: 14.5px; }
.ritem.ok .verdict { color: var(--pass); }
.ritem.no .verdict { color: var(--fail); }
.ritem .exp { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.ritem .ref { font-size: 13.5px; color: var(--muted); font-style: italic; }

.policy-body {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; margin: 14px 0; }
.checkline input { margin-top: 4px; accent-color: var(--teal); }

/* ---------- tables (admin) ---------- */

.tablewrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; background: #fff; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--teal-soft); color: var(--teal-dark); font-size: 13.5px; letter-spacing: 0.3px; white-space: nowrap; }
tr:hover td { background: #fafcfc; }
td.num, th.num { text-align: right; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 18px 0 16px; flex-wrap: wrap; }
.tabs a {
  padding: 7px 14px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tabs a.active { color: var(--teal); border-bottom-color: var(--teal); }

.kv { font-size: 15px; }
.kv b { display: inline-block; min-width: 130px; }

.temp-pw {
  font-family: 'Carlito', Calibri, monospace;
  font-size: 18px;
  font-weight: 700;
  background: var(--warn-soft);
  color: var(--warn-ink);
  padding: 8px 14px;
  border-radius: 4px;
  display: inline-block;
  user-select: all;
}

.loading { color: var(--muted); padding: 40px 0; text-align: center; }

@media (max-width: 560px) {
  .module { flex-direction: column; }
  .module .m-side { text-align: left; }
}
