/* Neema Connect — Apply and My loan pages.
   Plain CSS (no runtime CSS framework) so these pages run no third-party scripts:
   they handle ID numbers, documents and sign-in codes. Brand colours match index.html. */

:root {
  --navy: #030870;
  --navy-deep: #02054a;
  --navy-soft: #1b2a8a;
  --red: #e10600;
  --red-deep: #b90500;
  --surface: #f3f6fc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --warn: #92400e;
  --warn-bg: #fff4dc;
  --bad: #b91c1c;
  --bad-bg: #fdecec;
  --radius: 16px;
  --shadow: 0 20px 40px -18px rgba(3, 8, 112, 0.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--surface); }
body {
  margin: 0; min-height: 100vh; background: var(--surface); color: var(--ink);
  font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-soft); }
:focus-visible { outline: 3px solid #3b5bdb; outline-offset: 2px; }
[hidden] { display: none !important; }

/* header */
.masthead { background: var(--navy); color: #fff; padding-bottom: 88px; position: relative; overflow: hidden; }
.masthead::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -140px;
  background: var(--red); opacity: .18; filter: blur(90px); border-radius: 50%;
}
.bar { max-width: 1040px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; font-size: 19px; }
.brand img { width: 44px; height: 44px; background: #fff; border-radius: 10px; padding: 4px; object-fit: contain; }
.brand em { color: var(--red); font-style: normal; }
.bar nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; font-weight: 600; }
.bar nav a { color: rgba(255,255,255,.88); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--red); }
@media (max-width: 560px) {
  .bar { flex-wrap: wrap; row-gap: 10px; }
  .bar nav { width: 100%; margin-left: 0; gap: 22px; }
  .brand { font-size: 17px; }
}
.hero { max-width: 1040px; margin: 0 auto; padding: 18px 20px 0; position: relative; z-index: 1; }
.hero h1 { margin: 0 0 6px; font-size: clamp(28px, 5vw, 40px); line-height: 1.15; }
.hero p { margin: 0; color: #cbd5e1; max-width: 560px; }

main { max-width: 1040px; margin: -64px auto 0; padding: 0 20px 64px; position: relative; z-index: 2; }

/* step indicator */
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.steps li { font-size: 13px; font-weight: 700; color: #cbd5e1; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; }
.steps li[aria-current="step"] { background: #fff; color: var(--navy); border-color: #fff; }
.steps li.done { color: #fff; }
.steps li.done::before { content: "✓ "; color: #7ee2a0; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.layout.single { grid-template-columns: minmax(0, 720px); }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; border: 1px solid rgba(3,8,112,.06); }
.card + .card { margin-top: 20px; }
.card h2 { margin: 0 0 4px; font-size: 22px; color: var(--navy); }
.card .lead { margin: 0 0 22px; color: var(--muted); }
@media (max-width: 520px) { .card { padding: 22px 18px; } }

/* form controls */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .field .label { font-size: 14px; font-weight: 700; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
/* Every box looks the same: text, email, phone, number, date, and the rand boxes (which have no
   type, so they are matched by :not([type])), and the lists. One height for all of them. */
input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="password"], select {
  font: inherit; color: var(--ink); background: #fff; width: 100%; min-width: 0;
  border: 1.5px solid #cfd6e4; border-radius: 12px; padding: 12px 14px; min-height: 50px;
}
input[type="date"] { appearance: none; -webkit-appearance: none; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input:focus, select:focus { border-color: var(--navy-soft); outline: none; box-shadow: 0 0 0 4px rgba(27,42,138,.12); }
input[aria-invalid="true"] { border-color: var(--bad); }
.error-text { color: var(--bad); font-size: 13px; font-weight: 600; margin: 0; }

.amount-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.amount-big { font-size: 34px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--red); height: 28px; }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.grid-3 .span-2 { grid-column: span 2; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } .grid-3 .span-2 { grid-column: auto; } }
.optional { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
select { appearance: auto; }

/* budget: label on the left, rand amount on the right, like a payslip */
.money-group { border: 1.5px solid var(--line); border-radius: 12px; padding: 6px 16px 10px; margin: 0 0 16px; }
.money-group legend { font-weight: 800; color: var(--navy); padding: 0 6px; font-size: 15px; }
.money-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.money-row:last-child { border-bottom: 0; }
.rand { position: relative; flex: none; width: 150px; }
.rand::before { content: "R"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.rand input { padding-left: 28px; text-align: right; font-variant-numeric: tabular-nums; min-height: 44px; }
@media (max-width: 420px) { .rand { width: 120px; } }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.totals div { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.totals span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.totals strong { font-variant-numeric: tabular-nums; }

/* review */
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 18px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.review-block { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.review-block h3 { margin: 0 0 10px; font-size: 15px; color: var(--navy); display: flex; justify-content: space-between; }
.review-block h3 button { font: inherit; font-size: 13px; font-weight: 700; background: none; border: 0; color: var(--navy-soft); text-decoration: underline; cursor: pointer; }
.steps li { font-size: 12px; padding: 5px 10px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented.two { grid-template-columns: repeat(2, 1fr); }
.segmented.one { grid-template-columns: 1fr; }
.doc h4 .tag { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.doc h4 .tag.req { color: var(--red-deep); background: var(--bad-bg); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { text-align: center; border: 1.5px solid #cfd6e4; border-radius: 12px; padding: 12px 6px; font-weight: 700; cursor: pointer; background: #fff; }
.segmented input:checked + label { border-color: var(--navy); background: var(--navy); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid #3b5bdb; outline-offset: 2px; }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
fieldset.bare { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.bare > legend { padding: 0; margin-bottom: 6px; }  /* lines up with the labels beside it */
.button {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font: inherit; font-weight: 800; border: 0; border-radius: 12px; padding: 14px 24px; cursor: pointer;
  background: var(--red); color: #fff; box-shadow: 0 8px 20px -8px rgba(225,6,0,.6); min-height: 50px;
}
.button:hover { background: var(--red-deep); }
.button[disabled] { opacity: .6; cursor: wait; }
.button-quiet { background: transparent; color: var(--navy); box-shadow: none; padding: 14px 8px; }
.button-quiet:hover { background: transparent; text-decoration: underline; }
.button-navy { background: var(--navy); box-shadow: 0 8px 20px -8px rgba(3,8,112,.5); }
.button-navy:hover { background: var(--navy-deep); }

.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 0 0 18px; }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-info { background: #eef2ff; color: var(--navy); }

/* estimate panel */
.estimate { position: sticky; top: 20px; }
.estimate h3 { margin: 0 0 14px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.estimate .total { font-size: 30px; font-weight: 800; color: var(--navy); margin: 0; font-variant-numeric: tabular-nums; }
.estimate .total-label { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rows li span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.estimate .basis { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* documents */
.doc { display: grid; grid-template-columns: 1fr; gap: 8px 16px; align-items: center; padding: 16px; border: 1.5px dashed #cfd6e4; border-radius: 12px; margin-bottom: 12px; }
.doc.uploaded { border-style: solid; border-color: #b7e3c5; background: #f6fcf8; }
.doc h4 { margin: 0; font-size: 15px; }
.doc p { margin: 0; font-size: 13px; color: var(--muted); }
.doc .controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; grid-column: 1 / -1; }
.doc select { width: auto; min-height: 42px; padding: 8px 10px; }
.file-button { position: relative; overflow: hidden; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 10px; padding: 9px 14px; cursor: pointer; background: #fff; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 3px solid #3b5bdb; outline-offset: 2px; }
.doc-status { font-size: 13px; font-weight: 700; }
.doc-status.ok { color: var(--ok); }
.doc-status.bad { color: var(--bad); }

/* reference */
.reference { font-family: ui-monospace, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .08em; color: var(--navy); background: var(--surface); border-radius: 12px; padding: 12px 16px; display: inline-block; margin: 4px 0 18px; }
.next-steps { margin: 0 0 22px; padding-left: 20px; }
.next-steps li { margin-bottom: 8px; }

/* code entry */
.code-input { font-size: 28px !important; letter-spacing: .5em; text-align: center; font-family: ui-monospace, Consolas, monospace; max-width: 260px; }

/* my loan */
.loan-card { border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.loan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.loan-head h3 { margin: 0; font-size: 20px; color: var(--navy); }
.loan-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; background: #eceff5; color: #4a5266; }
.pill-assessed, .pill-received { background: var(--warn-bg); color: var(--warn); }
.pill-active, .pill-paid-up, .pill-offer-ready-to-sign { background: var(--ok-bg); color: var(--ok); }
.pill-declined, .pill-please-contact-us { background: var(--bad-bg); color: var(--bad); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.figures div { background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.figures span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.figures strong { font-size: 18px; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.session-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.session-bar p { margin: 0; color: var(--muted); font-size: 14px; }

.small { font-size: 13px; color: var(--muted); }

/* the offer: quotation and agreement */
.offer-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--ok-bg); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.offer-banner p { margin: 0; color: var(--ok); font-weight: 700; }
.doc-section { border-top: 1px solid var(--line); padding: 16px 0 4px; }
.doc-section h3 { margin: 0 0 10px; font-size: 16px; color: var(--navy); }
.doc-section ul { margin: 0; padding-left: 20px; font-size: 14px; }
.doc-section li { margin-bottom: 6px; }
.terms-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcfe; }
.fingerprint { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
.sign-box { border: 2px solid var(--navy); border-radius: 14px; padding: 18px; margin-top: 18px; }
.sign-box h3 { margin: 0 0 6px; color: var(--navy); }
@media print {
  .masthead, .footer, .no-print, .sign-box { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .terms-text { max-height: none; overflow: visible; }
}
.footer { max-width: 1040px; margin: 0 auto; padding: 0 20px 40px; font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }
