/* GEMS e-Recruitment – shared styles, following the gems.gov.za look and feel:
   Helvetica Neue, navy pill buttons, teal accent band, the GEMS multi-colour stripe,
   lightly shadowed square cards, light-grey link footer. Mobile-first, WCAG 2.1 AA contrast. */
:root {
  --bg: #f8f9fc; --surface: #ffffff; --surface-2: #f2f4f7; --text: #212529; --heading: #222b45; --muted: #5a6275; --border: #dcdfe5;
  --brand: #004b85; --brand-ink: #ffffff; --brand-soft: #e6eff7; --brand-2: #1ab1a4; --link: #0e76bc;
  --teal: #1ab1a4; --teal-dark: #007d7f; --teal-light: #6fd9d2; --green: #3aaa35; --green-dark: #1e7b34;
  --footer-bg: #eeeeee; --footer-ink: #222b45;
  --danger: #b42318; --danger-soft: #fdecea; --ok: #067647; --ok-soft: #e6f6ec; --warn: #8a5a00; --warn-soft: #fff4d6;
  --radius: 4px; --shadow: 0 2px 10px rgba(34,43,69,.09); --focus: 0 0 0 3px rgba(14,118,188,.4);
  --stripe: linear-gradient(90deg, #004b85 0 10%, #0e76bc 10% 20%, #3aaa35 20% 30%, #1e7b34 30% 40%, #f8ad21 40% 50%, #e07b1a 50% 60%, #da1a24 60% 70%, #a3161d 70% 80%, #1ab1a4 80% 90%, #007d7f 90% 100%);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1422; --surface: #151e2f; --surface-2: #1c2740; --text: #e8edf4; --heading: #f2f5fa; --muted: #a3adbf; --border: #2b3750;
    --brand: #5aa7e0; --brand-ink: #04192a; --brand-soft: #14304b; --brand-2: #3fd0c3; --link: #7cc0f0;
    --teal: #1ab1a4; --teal-dark: #0f8f86; --teal-light: #1d5c58; --footer-bg: #111a2a; --footer-ink: #c9d2e0;
    --danger: #f97066; --danger-soft: #3a1714; --ok: #47cd89; --ok-soft: #10301f; --warn: #fdb022; --warn-soft: #33270a;
    --shadow: none; --focus: 0 0 0 3px rgba(124,192,240,.45); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); overflow-x: clip; }
.full-bleed, .hero, .band { margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; }
a { color: var(--link); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--heading); font-weight: 500; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 999px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.gems-stripe { height: 6px; background: var(--stripe); }

/* Header – white bar, wordmark left, menu right, navy "Login" pill, colour stripe underneath */
.topbar { background: var(--surface); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 6px rgba(34,43,69,.12); }
.topbar::after { content: ""; display: block; height: 4px; background: var(--stripe); }
.topbar .inner { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--heading); text-decoration: none; }
.brand .mark { width: 38px; height: 38px; border-radius: 50%; flex: none; background: conic-gradient(#004b85 0 36deg, #0e76bc 0 72deg, #3aaa35 0 108deg, #1e7b34 0 144deg, #f8ad21 0 180deg, #e07b1a 0 216deg, #da1a24 0 252deg, #a3161d 0 288deg, #1ab1a4 0 324deg, #007d7f 0); -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px); mask: radial-gradient(circle, transparent 7px, #000 8px); font-size: 0; }
.brand .word { font-size: 1.55rem; font-weight: 500; letter-spacing: -.02em; line-height: 1; color: var(--heading); }
.brand .word b { font-weight: 500; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; letter-spacing: .01em; margin-top: 2px; }
.brand .sep { width: 1px; height: 30px; background: var(--border); margin: 0 4px; }
.brand .product { font-size: 1rem; color: var(--brand); font-weight: 500; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button.linkish { padding: 8px 12px; text-decoration: none; color: #000; font-weight: 400; font-size: .95rem; border-bottom: 2px solid transparent; border-radius: 0; }
@media (prefers-color-scheme: dark) { .nav a, .nav button.linkish { color: var(--text); } }
.nav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--teal); }
.nav a:hover { color: var(--brand); }
.nav .nav-sep { width: 1px; height: 28px; background: var(--border); margin: 0 8px; }
.nav a.btn { border: 1.5px solid var(--link); border-radius: 999px; color: var(--link); padding: 5px 18px; font-weight: 500; }
.nav a.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.nav a.btn:hover { background: var(--brand-soft); }
.nav a.btn.primary:hover { background: #003a68; color: #fff; }
.btn.menu-btn { display: none; }
@media (max-width: 860px) {
  .btn.menu-btn { display: inline-flex; margin-left: auto; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .nav.open { display: flex; }
  .nav .nav-sep { display: none; }
}

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }

/* Footer – light grey, columns of links like gems.gov.za */
.footer { background: var(--footer-bg); color: var(--footer-ink); font-size: .9rem; margin-top: 24px; }
.footer::before { content: ""; display: block; height: 4px; background: var(--stripe); }
.footer .inner { max-width: 1240px; margin: 0 auto; padding: 28px 20px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.footer h2 { font-size: .98rem; font-weight: 700; color: var(--footer-ink); margin-bottom: 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 5px 0; }
.footer a { color: var(--footer-ink); text-decoration: none; }
.footer a:hover { text-decoration: underline; color: var(--link); }
.footer .legal { max-width: 1240px; margin: 0 auto; padding: 12px 20px 22px; border-top: 1px solid rgba(34,43,69,.15); font-size: .8rem; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.footer.slim .legal { border-top: 0; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid #e6e8ec; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .card { border-color: var(--border); } }
.card + .card { margin-top: 14px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* Hero – green notice panel over navy, finished with the colour stripe (gems.gov.za home banner) */
.hero { position: relative; overflow: hidden; color: #fff; margin-top: -24px; margin-bottom: 0; padding: 48px 20px 54px; background: linear-gradient(120deg, #0b2f55 0%, #004b85 45%, #0e76bc 100%); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--stripe); }
.hero .hero-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.hero .notice { background: linear-gradient(90deg, rgba(30,123,52,.96), rgba(58,170,53,.9) 70%, rgba(58,170,53,.55)); padding: 26px 28px; }
.hero h1 { font-size: 2.3rem; font-weight: 700; color: #fff; line-height: 1.12; margin-bottom: .35em; }
.hero p { font-size: 1.08rem; opacity: .97; max-width: 56ch; margin: 0; }
.hero .side { background: rgba(111,217,210,.92); color: #0d2b33; padding: 22px 24px; text-align: center; }
.hero .side h2 { color: #0d2b33; font-size: 1.45rem; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.75); margin-bottom: 12px; }
.hero .side p { color: #0d2b33; font-size: .98rem; margin-bottom: 14px; }
@media (max-width: 860px) { .hero .hero-inner { grid-template-columns: 1fr; } .hero h1 { font-size: 1.8rem; } }
.band { background: var(--teal); color: #fff; margin-top: 0; margin-bottom: 24px; padding: 12px 20px; }
.band .inner { max-width: 1240px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 1.05rem; }
.band strong { font-weight: 700; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 1150px; margin: 0 auto 10px; }
.quick a { display: block; text-align: center; padding: 8px 14px; border: 1.5px solid var(--link); border-radius: 999px; color: var(--link); text-decoration: none; font-size: .98rem; background: var(--surface); }
.quick a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.divider { height: 5px; max-width: 1150px; margin: 18px auto 26px; background: var(--stripe); }
.section-title { text-align: center; font-size: 1.7rem; margin: 6px 0 18px; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 8px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg label { margin: 0; padding: 8px 16px; cursor: pointer; font-weight: 500; }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { color: var(--brand-ink); }
.seg label:has(input:checked) { background: var(--brand); color: var(--brand-ink); }
.seg label:has(input:focus-visible) { box-shadow: inset var(--focus); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 7px 20px; border-radius: 999px; border: 1.5px solid var(--link); background: var(--surface); color: var(--link); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #003a68; border-color: #003a68; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.ok { color: var(--ok); border-color: var(--ok); }
.btn.sm { min-height: 32px; padding: 4px 14px; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
button.linkish { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* Badges, pills, tables */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-ink); background: var(--brand); white-space: nowrap; font-weight: 500; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Job cards – like the GEMS option cards: colour stripe on top, centred, blue title */
.job { display: block; text-decoration: none; color: inherit; padding: 0 !important; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.job::before { content: ""; display: block; height: 5px; background: var(--stripe); }
.job .job-body { padding: 18px 20px 20px; }
.job:hover { box-shadow: 0 6px 22px rgba(34,43,69,.16); transform: translateY(-1px); }
.job h3 { color: var(--link); font-size: 1.3rem; margin: 10px 0 6px; }
.job .cta { display: inline-block; margin-top: 10px; background: var(--brand); color: #fff; border-radius: 999px; padding: 5px 18px; font-size: .9rem; }
.meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: .87rem; }
.prose { white-space: pre-line; }

/* Progress tracker (ToR 4.9, 4.34) */
.steps { display: flex; list-style: none; padding: 0; margin: 12px 0; gap: 0; overflow-x: auto; }
.steps li { flex: 1; min-width: 78px; text-align: center; font-size: .76rem; color: var(--muted); position: relative; padding-top: 26px; }
.steps li::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--teal); border-color: var(--teal); }
.steps li.done::after, .steps li.current::after { background: var(--teal); }
.steps li.current { color: var(--brand); font-weight: 700; }
.steps li.current::before { border-color: var(--teal) !important; }
.steps li.current::before { background: var(--surface); border: 4px solid var(--brand); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); border-radius: 99px; }

/* Stats */
.stat { padding: 14px 16px; }
.stat { border-top: 4px solid var(--teal) !important; }
.stat .n { font-size: 1.8rem; font-weight: 500; line-height: 1.1; color: var(--brand); }
.stat .l { color: var(--muted); font-size: .85rem; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.chart-bars span { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart-bars span.hi { background: var(--brand-2); }
.chart-axis { display: flex; gap: 3px; font-size: .68rem; color: var(--muted); }
.chart-axis span { flex: 1; text-align: center; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 44px; gap: 8px; align-items: center; font-size: .88rem; margin: 5px 0; }

/* Feedback */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 12px; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(640px, calc(100% - 24px)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(10,15,25,.5); }
dialog .dlg-body { padding: 18px; max-height: 80vh; overflow: auto; }
dialog .dlg-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--brand); border-color: var(--teal); }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print {
  .topbar, .footer, .no-print, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
}
@media (max-width: 480px) { .brand small { display: none; } .brand .word { font-size: 1.35rem; } }
