/* Kinrise IQ's tokens (stone ground, white header, Roboto, yellow #fecc4e),
   so a supplier moving between an email, this form and anything else Kinrise
   sends sees one company. No dark mode: a form filled in once does not need it,
   and a second palette is a second thing to keep accessible. */
:root {
  --slate: #373444; --stone: #f2eee8; --surface: #ffffff; --surface-2: #f9f9fb;
  --ink: #373444; --ink-2: #60646c; --ink-3: #80838d;
  --rule: rgba(55, 52, 68, .12); --rule-strong: rgba(55, 52, 68, .22);
  --primary: #fecc4e; --accent: #ea8d31; --accent-ink: #9a5a12;
  --good: #0b6b2e; --good-bg: #ecf8f0;
  --bad: #c4302f; --bad-bg: #fdf0f0; --notice-bg: #fefaec; --notice-line: rgba(234, 141, 49, .35);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(55, 52, 68, .05), 0 12px 28px -20px rgba(55, 52, 68, .25);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; scroll-behavior: smooth; }
body { margin: 0; background: var(--stone); color: var(--ink); font: 16px/1.55 Roboto, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

.top { background: var(--surface); border-bottom: 1px solid var(--rule); }
.topbar { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.logo { height: 28px; width: auto; padding-right: 14px; border-right: 1px solid var(--rule); }
.brand { font-weight: 700; }
.spacer { flex: 1; }

main.wrap { padding: 28px 16px 40px; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 900; letter-spacing: -.5px; line-height: 1.15; margin: 0 0 10px; }
p { margin: 0 0 14px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.hint { color: var(--ink-3); font-size: 13px; margin: 14px 0 0; }
.intro { margin-bottom: 22px; }
.eyebrow { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: rgba(254, 204, 78, .35);
  color: var(--accent-ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin: 0 0 18px; }
.narrow { max-width: 520px; margin: 24px auto; }

/* --- The form's layout: a progress rail beside the sections on wide screens. */
/* The header and footer widen with the form, so the logo lines up with it. */
body:has(.form-screen:not([hidden])) .wrap { max-width: 1120px; }
.form-layout { display: block; }
.rail { display: none; }
@media (min-width: 1000px) {
  .form-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
  .rail { display: block; position: sticky; top: 20px; }
}
.rail ol { list-style: none; margin: 0; padding: 0; counter-reset: rail; }
.rail li { counter-increment: rail; }
.rail a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.rail a:hover { background: rgba(55, 52, 68, .05); color: var(--ink); }
.rail .dot { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--rule-strong); background: var(--surface); font-size: 12px; font-weight: 700; color: var(--ink-3); }
.rail .dot::before { content: counter(rail); }
.rail a.done { color: var(--ink); }
.rail a.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.rail a.done .dot::before { content: ''; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.rail-note { margin: 16px 12px 0; font-size: 12.5px; color: var(--ink-3); }

/* --- Sections: a numbered heading inside each card rather than a legend
   sitting on its border. The float is what lets a legend lay out like a block. */
#vendor-form { counter-reset: section; }
fieldset.card { min-width: 0; counter-increment: section; }
fieldset.card > legend { float: left; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0; margin: 0 0 18px;
  font-weight: 900; font-size: 19px; letter-spacing: -.2px; }
fieldset.card > legend::before { content: counter(section); display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; border-radius: 9px; background: rgba(254, 204, 78, .35); color: var(--accent-ink); font-size: 14px; font-weight: 900; }
fieldset.card > legend + * { clear: both; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 18px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
label.wide { grid-column: 1 / -1; }
label small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.req { color: var(--bad); }
.lt { display: block; }

input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: rgba(55, 52, 68, .35); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(234, 141, 49, .16); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
input::placeholder { color: var(--ink-3); }
/* One chevron for every select, the same in every browser. */
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23373444' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; }
select[aria-invalid="true"] { background-color: var(--bad-bg); }

/* Checkboxes as tiles: a bigger target, and a ticked one reads as done. */
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; box-shadow: none; }
label.check { flex-direction: row; align-items: flex-start; gap: 11px; font-weight: 400; font-size: 15px; margin: 0 0 10px; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
label.check:hover { border-color: var(--rule-strong); }
label.check:has(input:checked) { border-color: rgba(234, 141, 49, .45); background: var(--notice-bg); }
label.check:last-child { margin-bottom: 0; }
label.check.toggle { display: inline-flex; margin-bottom: 18px; }

button { font: inherit; font-weight: 700; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); border-radius: 10px;
  padding: 10px 18px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover { border-color: rgba(55, 52, 68, .4); }
button.primary { background: linear-gradient(135deg, #ffd766, var(--primary) 55%, #f8bb45); border-color: transparent; box-shadow: 0 1px 2px rgba(55, 52, 68, .12); }
button.primary:hover { box-shadow: 0 4px 12px -4px rgba(234, 141, 49, .55); }
button.link { background: none; border: 0; padding: 4px; min-height: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; box-shadow: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }

.error { color: var(--bad); background: var(--bad-bg); border-radius: 10px; padding: 10px 13px; margin: 14px 0 0; font-size: 14.5px; }
.notice { background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.notice p { margin: 4px 0 0; white-space: pre-wrap; }

/* --- Documents: the list, then a drop zone. */
.files { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 12px; font-size: 14.5px; background: var(--surface-2); }
.files li.muted { justify-content: center; border-style: dashed; background: none; }
.files .cat { font-size: 12px; font-weight: 700; background: rgba(254, 204, 78, .35); color: var(--accent-ink); border-radius: 999px; padding: 3px 10px; max-width: 100%; }
.files .name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; text-align: center;
  border: 1.5px dashed var(--rule-strong); border-radius: 14px; background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--accent); background: var(--notice-bg); }
.dropzone.has-file { border-style: solid; border-color: rgba(234, 141, 49, .55); background: var(--notice-bg); color: var(--ink); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; min-height: 0; }
.dropzone svg { color: var(--accent); margin-bottom: 4px; }
.dz-title { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.dz-sub { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.upload .row select { flex: 1; min-width: 200px; }

/* The live ABN and BSB results: a status mark inside the field, the words on a
   fixed two-line strip beneath it (full text on hover), so nothing below moves. */
.chk-field { position: relative; display: block; }
.chk-field input { padding-right: 42px; }
.chk-icon { position: absolute; right: 12px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; display: none; pointer-events: none; }
.chk-icon::before { content: ''; position: absolute; }
.chk-field[data-outcome] .chk-icon { display: block; }
.chk-field[data-outcome="pass"] .chk-icon { background: var(--good); }
.chk-field[data-outcome="pass"] .chk-icon::before { left: 6px; top: 5px; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.chk-field[data-outcome="flag"] .chk-icon { background: #e79a1c; }
.chk-field[data-outcome="fail"] .chk-icon { background: var(--bad); }
.chk-field[data-outcome="flag"] .chk-icon::before, .chk-field[data-outcome="fail"] .chk-icon::before { content: '!'; inset: 0; color: #fff; font: 700 13px/20px Roboto, system-ui, sans-serif; text-align: center; }
.chk-field[data-outcome="pending"] .chk-icon, .chk-field[data-outcome="error"] .chk-icon { background: none; border: 2px solid var(--rule-strong); }
.chk-field[data-outcome="pending"] .chk-icon { border-right-color: var(--accent); animation: spin .7s linear infinite; }
.chk-field[data-outcome="pass"] input { border-color: rgba(11, 107, 46, .45); }
.chk-field[data-outcome="flag"] input { border-color: rgba(231, 154, 28, .7); }
.chk-field[data-outcome="fail"] input { border-color: var(--bad); }
label small.chk { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  height: 2.8em; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); transition: color .15s; }
label small.chk.pass { color: var(--good); }
label small.chk.flag { color: #8a5300; }
label small.chk.fail { color: var(--bad); }

/* --- Save and submit, kept in view at the foot of the window while scrolling. */
.actionbar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 4px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); box-shadow: 0 10px 30px -12px rgba(55, 52, 68, .35); }
.save-status { margin-right: auto; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 560px) {
  .actionbar { padding: 10px; gap: 8px; }
  .actionbar button { flex: 1; white-space: nowrap; padding: 10px 12px; font-size: 15px; }
  .save-status { flex-basis: 100%; }
  .save-status:empty { display: none; }
}

.foot { padding-bottom: 36px; color: var(--ink-3); font-size: 13px; }

/* Sign-in: the "Before you start" and "Check your email" cards. */
.signin { text-align: center; padding: 30px 28px 26px; }
.signin .muted { max-width: 400px; margin-left: auto; margin-right: auto; }
.signin-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 14px;
  border-radius: 16px; background: rgba(254, 204, 78, .28); color: var(--accent-ink); }
.signin .error { text-align: left; }
.center { text-align: center; }
button.block { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; padding: 12px 16px; margin-top: 18px; }

/* Six boxes, three and three, sized for a thumb on a phone. */
.otp { display: flex; justify-content: center; gap: 8px; margin: 22px 0 4px; }
.otp-gap { width: 6px; }
.otp-digit { width: 48px; height: 58px; padding: 0; text-align: center; font-size: 26px; font-weight: 700;
  font-variant-numeric: tabular-nums; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--surface-2);
  caret-color: var(--accent); transition: border-color .12s, background .12s, box-shadow .12s; }
.otp-digit:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(234, 141, 49, .18); }
.otp-digit.filled { border-color: rgba(55, 52, 68, .35); background: var(--surface); }
.otp.shake { animation: shake .35s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (max-width: 380px) { .otp { gap: 6px; } .otp-digit { width: 40px; height: 52px; font-size: 22px; } }

/* "Can't continue": the sign-in card's look, with numbered next steps. */
.problem .steps { list-style: none; counter-reset: step; text-align: left; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.problem .steps li { counter-increment: step; position: relative; padding: 12px 14px 12px 50px; border: 1px solid var(--rule);
  border-radius: 12px; background: var(--surface-2); font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.problem .steps li b { display: block; color: var(--ink); font-weight: 700; }
.problem .steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 8px;
  background: rgba(254, 204, 78, .35); color: var(--accent-ink); font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.problem-note { margin: 18px auto 0; max-width: 400px; font-size: 13px; color: var(--ink-3); }
.problem[data-kind="error"] .signin-icon { background: var(--bad-bg); color: var(--bad); }

.resend { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); }
.resend button.link { padding: 0; display: inline-flex; align-items: center; gap: 6px; }

/* A spinner inside a button, shown while it works. The label stays, so the
   button keeps its width and says what it is doing. */
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; flex: none; }
.is-busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.6s; }
  .otp.shake { animation: none; }
}
