/* Mploy site styles */
:root {
  --brand: #1f8a4c;
  --brand-dark: #166b3a;
  --brand-soft: #e8f5ec;
  --ink: #14211a;
  --muted: #5b6b62;
  --line: #e3e9e4;
  --bg: #f6f8f5;
  --card: #ffffff;
  --amber: #b26a00;
  --amber-ring: #d18a00;
  --red: #b42318;
  --red-soft: #fdecea;
  --shadow: 0 8px 24px rgba(20, 33, 26, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}
a { color: var(--brand-dark); }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Wordmark: the M is an inline SVG of the South African flag */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.02em;
  color: var(--brand);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}
.logo-m { flex: none; width: 0.8em; height: 0.72em; }
.logo-lg { font-size: clamp(46px, 5.4vw, 64px); }
.logo-sm { font-size: 26px; }
.brand { text-align: center; }
.brand .tagline { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* Top banner advert carousel (artwork 1200 x 200, i.e. 6:1) */
.banner-wrap { padding-top: 16px; }
.banner {
  position: relative;
  aspect-ratio: 6 / 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.banner-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.banner-slide.is-active { opacity: 1; visibility: visible; }
.banner-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.banner-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1px dashed #c9d6cd;
  border-radius: inherit;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.banner-empty strong { color: var(--ink); font-size: clamp(15px, 2vw, 22px); }
.banner-empty span { font-size: clamp(12px, 1.3vw, 14px); }
.banner-empty:hover, .banner-empty:focus-visible { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.banner-dots {
  position: absolute;
  bottom: 4px;
  left: 50%;
  display: flex;
  transform: translateX(-50%);
}
.banner-dots button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.banner-dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: width 0.2s;
}
.banner-dots button[aria-current="true"]::before { width: 18px; background: #fff; }
.banner .ad-label { z-index: 1; }

.admin-header { background: var(--card); border-bottom: 1px solid var(--line); }
.admin-header .wrap { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; }
.admin-tag { padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 600; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.visitors { margin: 0 0 6px; }
.visitors strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.foot-links { margin: 0; }
.foot-links a { color: var(--muted); }

/* Three-column layout: 4 ad squares | centre panel | 4 ad squares */
main.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 200px;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.ads { display: grid; gap: 16px; align-content: start; }
.ad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
}
.ad img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ad-label {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 1px 6px;
  border-radius: 4px;
}
.ad-empty {
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-style: dashed;
  color: var(--muted);
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ad-empty strong { font-size: 14px; }
.ad-empty span { font-size: 12px; line-height: 1.35; }
.ad-empty:hover, .ad-empty:focus-visible { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* Centre panel: logo and tagline on top, then the landing view or questionnaire.
   On the landing view the whole block is centred vertically; during a check it fills the panel. */
.centre {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 40px;
}
.centre > .brand { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.centre-body { display: flex; flex-direction: column; }
.centre.is-quiz { justify-content: flex-start; }
.centre.is-quiz .centre-body { flex: 1; }
.centre.is-quiz > .brand { margin-bottom: 24px; padding-bottom: 18px; }
.centre.is-quiz .logo-lg { font-size: 36px; }
.centre.is-quiz .brand .tagline { margin-top: 6px; font-size: 13px; }

/* Landing view */
.home { text-align: center; }
.home h1 { margin: 0 0 12px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.5px; }
.lead { max-width: 520px; margin: 0 auto 32px; color: var(--muted); font-size: 17px; }
.checks { display: grid; gap: 16px; max-width: 460px; margin: 0 auto; }
.check-tab {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  padding: 20px 22px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.check-tab:hover, .check-tab:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(31, 138, 76, 0.14);
  transform: translateY(-1px);
}
.check-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.check-title { font-size: 18px; font-weight: 700; }
.check-sub { grid-column: 1; color: var(--muted); font-size: 14px; }
.check-arrow {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 500px;
  margin: 32px auto 0;
  padding: 0;
  list-style: none;
}
.steps li { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; line-height: 1.3; }
.steps b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 14px;
}
.home-note { margin: 24px 0 0; color: var(--muted); font-size: 13px; }

/* Questionnaire */
.quiz { display: flex; flex-direction: column; flex: 1; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.quiz-title { color: var(--brand-dark); font-size: 13px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.quiz-exit { color: var(--muted); font-size: 14px; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width 0.3s ease; }
.quiz-count { margin: 10px 0 20px; color: var(--muted); font-size: 13px; }
.quiz-intro {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
}
.q-form { display: flex; flex-direction: column; flex: 1; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.q-text { margin: 0 0 8px; padding: 0; font-size: 21px; font-weight: 650; line-height: 1.35; outline: none; }
.q-help { margin: 0; color: var(--muted); font-size: 14px; }
.opts { display: grid; gap: 10px; margin-top: 18px; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.opt:hover { border-color: #b9d8c4; }
.opt input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt-na { color: var(--muted); }
.q-ref { margin: 16px 0 0; color: var(--muted); font-size: 12.5px; }
.q-ref strong { color: var(--red); font-weight: 600; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-block { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Result view */
.result { text-align: center; }
.result-kicker { margin: 4px 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.score {
  --c: var(--brand);
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
}
.score span {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--card);
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.band-good { --c: var(--brand); }
.band-fair { --c: var(--amber-ring); }
.band-poor { --c: var(--red); }
.result h2 { margin: 0 0 6px; font-size: 24px; outline: none; }
.result-summary { max-width: 460px; margin: 0 auto 20px; color: var(--muted); }
.gaps {
  max-width: 520px;
  margin: 0 auto 24px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--bg);
  text-align: left;
}
.gaps h3 { margin: 0 0 8px; font-size: 14px; }
.gaps ul { margin: 0; padding-left: 18px; }
.gaps li { margin: 6px 0; font-size: 14px; }
.gaps li span { color: var(--muted); font-size: 12.5px; }
.gaps-more { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.tag-critical {
  display: inline-block;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.email-form { max-width: 520px; margin: 0 auto; padding-top: 24px; border-top: 1px solid var(--line); text-align: left; }
.email-form h3 { margin: 0 0 4px; font-size: 18px; }
.email-form .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.field input, .admin-form input[type=text], .admin-form input[type=url], .admin-form input[type=password] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.field input:focus, .admin-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[aria-invalid=true] { border-color: var(--red); }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.captcha-row img { width: 210px; height: 66px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand-dark); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.consent { margin: 4px 0 16px; color: var(--muted); font-size: 12.5px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 8px; font-size: 14px; }
.check-line input { margin-top: 3px; accent-color: var(--brand); }
.form-msg { min-height: 1.2em; margin: 12px 0 0; font-size: 14px; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: var(--brand-dark); }
.sent { max-width: 520px; margin: 0 auto; padding: 20px; border-radius: 12px; background: var(--brand-soft); }
.sent h3 { margin: 0 0 6px; outline: none; }
.sent p { margin: 0; }
.disclaimer { max-width: 520px; margin: 24px auto 0; color: var(--muted); font-size: 12px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }

/* Simple content pages (privacy, unsubscribe) */
.page { flex: 1; padding-top: 32px; padding-bottom: 40px; }
.page-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 40px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.page-card h1 { margin: 0 0 12px; font-size: 28px; }
.page-card h2 { margin: 24px 0 8px; font-size: 18px; }
.page-card p, .page-card li { color: #2b3a31; }

/* Admin */
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-bar h1 { margin: 0; font-size: 26px; }
.admin-section { margin: 0 0 24px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.admin-section > h2 { margin: 0 0 4px; font-size: 19px; }
.admin-section > p.hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 12px; background: var(--bg); }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.slot-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.slot-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.slot-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  max-width: 160px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
}
.slot-preview img { width: 100%; height: 100%; object-fit: contain; }
.slot-preview.wide { aspect-ratio: 6 / 1; max-width: 100%; }
.slots-wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.page > .brand { margin-bottom: 24px; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-on { background: var(--brand-soft); color: var(--brand-dark); }
.pill-off { background: var(--bg); color: var(--muted); }
.admin-form label { display: block; font-size: 13px; font-weight: 600; }
.admin-form label > input { margin-top: 4px; font-weight: 400; }
.admin-form .check-line { font-weight: 400; }
.admin-form input[type=file] { width: 100%; margin-top: 4px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.notice-ok { background: var(--brand-soft); color: var(--brand-dark); }
.notice-error { background: var(--red-soft); color: var(--red); }
.table-wrap { overflow-x: auto; }
table.leads { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.leads th, table.leads td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.leads th { color: var(--muted); font-weight: 600; }
.narrow { max-width: 420px; margin: 0 auto; }

/* Responsive */
@media (max-width: 1080px) {
  main.layout { grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 16px; }
  .centre { padding: 32px 28px; }
}
@media (max-width: 860px) {
  main.layout { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .centre { order: -1; padding: 28px 20px; }
  .centre > .brand { margin-bottom: 24px; padding-bottom: 20px; }
  .ads { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .page-card { padding: 28px 20px; }
}
@media (max-width: 520px) {
  .ads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner-wrap { padding-top: 12px; }
  .banner { border-radius: 10px; }
  .banner-empty span, .banner-dots { display: none; }
  .brand .tagline { font-size: 14px; }
  .steps { gap: 8px; }
  .steps li { font-size: 12.5px; }
  .q-text { font-size: 19px; }
  .check-title { font-size: 17px; }
  .quiz-nav .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
