:root {
  --navy: #002a5c;
  --navy-700: #013a7a;
  --red: #e42c2a;
  --yellow: #ffcf00;
  --paper: #f6f8fb;
  --line: #d9e1ec;
  --line-strong: #b9c6d8;
  --muted: #5b6b7f;
  --ink: #11243a;
  --white: #ffffff;
  --ok: #157f5b;
  --radius: 14px;
  --shadow: 0 18px 50px -28px rgba(0, 42, 92, 0.45);
  --display:
    var(--e-global-typography-primary-font-family), "Barlow Semi Condensed",
    "Barlow", sans-serif;
  --body:
    var(--e-global-typography-text-font-family), "Barlow", system-ui,
    -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  /* font-family: var(--body); */
  font-family: "Roboto", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy);
}

/* ---------- shell ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
}

/* ---------- left rail ---------- */
.rail {
  background: var(--navy);
  color: #dce7f3;
  /* padding: 40px 34px; */
  padding: 20px 34px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 34px;
  overflow: hidden;
}

.rail::after {
  /* ambient brand bar */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(
    var(--yellow) 0 33%,
    var(--red) 33% 66%,
    var(--white) 66% 100%
  );
  opacity: 0.9;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand img {
  /* height: 46px; */
  height: 94px;
  width: auto;
  display: block;
}

.wordmark {
  display: none;
  line-height: 1;
}

.wordmark b {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 21px;
  color: #fff;
  text-transform: uppercase;
  display: block;
}

.wordmark span {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--yellow);
  text-transform: uppercase;
}

.rail-lead h1 {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: 0.4px;
  margin: 0 0 12px;
}

.rail-lead h1 em {
  color: var(--yellow);
  font-style: normal;
}

.rail-lead p {
  margin: 0;
  color: #aac1dc;
  font-size: 14.5px;
  max-width: 30ch;
}

/* vertical stepper */
.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.stepper li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  position: relative;
}

.stepper li::before {
  /* connector */
  content: "";
  position: absolute;
  left: 16px;
  top: 48px;
  bottom: -9px;
  width: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.stepper li:last-child::before {
  display: none;
}

.dot {
  grid-row: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.28);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: #9fb6d2;
  background: transparent;
  transition: 0.35s;
  z-index: 1;
}

.stepper .st-label {
  font-size: 14px;
  color: #9fb6d2;
  font-weight: 500;
  transition: 0.25s;
}

.stepper .st-num {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 2px;
  color: #7793b6;
  text-transform: uppercase;
}

.stepper li.active .dot {
  border-color: var(--yellow);
  color: var(--navy);
  background: var(--yellow);
}

.stepper li.active .st-label {
  color: #fff;
}

.stepper li.done .dot {
  border-color: var(--yellow);
  background: transparent;
  color: var(--yellow);
}

.stepper li.done .st-label {
  color: #cfe0f2;
}

.stepper li.done::before {
  background: var(--yellow);
}

.rail-foot {
  margin-top: auto;
  font-size: 12.5px;
  color: #7f99bb;
}

.rail-foot a {
  color: #cfe0f2;
  text-decoration: underline;
}

/* ---------- form panel ---------- */
.panel {
  padding: 46px 56px 64px;
  max-width: 880px;
  width: 100%;
}

.topbar {
  display: none;
}

.progress-mini {
  display: none;
}

.step {
  display: none;
  animation: rise 0.45s ease both;
}

.step.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
}

.eyebrow b {
  color: var(--muted);
  font-weight: 600;
}

.step h2 {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy);
  font-size: 32px;
  letter-spacing: 0.4px;
  margin: 0 0 6px;
}

.step .sub {
  color: var(--muted);
  margin: 0 0 26px;
  font-size: 15px;
  max-width: 60ch;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-help {
  margin-top: 5px;
}

label.lbl {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.2px;
}

label.lbl .req {
  color: var(--red);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  width: 100%;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23002A5C' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(0, 42, 92, 0.12);
}

input::placeholder {
  color: #9aa9bb;
}

.field.invalid input,
.field.invalid select {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(228, 44, 42, 0.1);
}

.err {
  display: none;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
}

.field.invalid .err {
  display: block;
}

/* segmented yes/no */
.seg {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: max-content;
}

.seg label {
  position: relative;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  padding: 11px 26px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--muted);
  transition: 0.18s;
}

.seg label:first-child span,
.seg label:nth-child(2) span {
  border-right: 1.5px solid var(--line);
}

.seg input:checked + span {
  background: var(--navy);
  color: #fff;
}

.field.invalid .seg {
  border-color: var(--red);
}

/* option chips (checkbox cards) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  transition: 0.16s;
}

.chip span::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--line-strong);
  display: inline-block;
  transition: 0.16s;
  flex: none;
}

.chip input:checked + span {
  border-color: var(--navy);
  background: #f1f6fc;
}

.chip input:checked + span::before {
  background: var(--navy);
  border-color: var(--navy);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'><path d='M5 13l4 4L19 7'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

.chip input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(0, 42, 92, 0.14);
}

.group-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
  letter-spacing: 0.2px;
}

.group-label small {
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.subgroup {
  margin-bottom: 26px;
}

.subgroup:last-of-type {
  margin-bottom: 0;
}

/* qualifications rows */
.qual {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.qual .chip span {
  width: 100%;
}

.qual input.detail {
  font-size: 14px;
  padding: 10px 13px;
}

.qual input.detail:disabled {
  background: #f3f5f8;
  color: #9aa9bb;
  border-style: dashed;
}

/* file upload */
.drop {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  background: #fbfcfe;
  cursor: pointer;
  transition: 0.18s;
  display: flex;
}

.drop:hover,
.drop.drag {
  border-color: var(--navy);
  background: #f1f6fc;
}

.drop strong {
  color: var(--navy);
  font-weight: 700;
}

.drop .hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.drop input {
  display: none;
}

.file-chip {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  background: #f1f6fc;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
}

.file-chip.show {
  display: flex;
}

.file-chip .nm {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip .sz {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
  flex: none;
}

.file-chip button {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex: none;
}

/* profile photo avatar */
.avatar-up {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.avatar {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  flex: none;
  overflow: hidden;
  border: 2px dashed var(--line-strong);
  background: #fbfcfe;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.18s;
}

.avatar:hover {
  border-color: var(--navy);
  background: #f1f6fc;
}

.avatar svg {
  width: 30px;
  height: 30px;
  color: var(--line-strong);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar.has-img {
  border-style: solid;
  border-color: var(--navy);
}

.avatar.has-img svg {
  display: none;
}

.avatar.has-img img {
  display: block;
}

.avatar input {
  display: none;
}

.avatar-meta p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 38ch;
}

.avatar-meta .group-label {
  margin: 0 0 4px;
}

.avatar-meta button {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--red);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  display: none;
}

.avatar-meta button.show {
  display: inline;
}

/* consent */
.consent {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.consent.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(228, 44, 42, 0.08);
}

.consent input {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  accent-color: var(--navy);
  flex: none;
  cursor: pointer;
}

.consent p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink);
}

.consent .req {
  color: var(--red);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 26px 0;
  border: 0;
}

/* nav */
.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  padding: 14px 30px;
  border-radius: 11px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: 0.18s;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-700);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--navy);
  background: #f1f6fc;
}

.btn-submit {
  background: var(--red);
  color: #fff;
}

.btn-submit:hover {
  background: #c92422;
}

.nav .spacer {
  margin-left: auto;
}

.step-count {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* success */
.done-screen {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.done-screen.show {
  display: block;
  animation: rise 0.5s ease both;
}

.tick {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--ok);
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
}

.tick svg {
  width: 46px;
  height: 46px;
}

.done-screen h2 {
  font-family: var(--display);
  text-transform: uppercase;
  color: var(--navy);
  font-size: 34px;
  margin: 0 0 10px;
}

.done-screen p {
  color: var(--muted);
  max-width: 48ch;
  margin: 0 auto 8px;
  font-size: 16px;
}

textarea {
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  width: 100%;
  min-height: 140px;
  resize: vertical;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}

textarea::placeholder {
  color: #9aa9bb;
}

textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(0, 42, 92, 0.12);
}

.subgroup textarea {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.cv-p {
  margin-bottom: 30px;
}

.other-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height 0.35s ease,
    opacity 0.35s ease,
    transform 0.35s ease;
}

.other-details.show {
  max-height: 250px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 15px;
}

.conditional-field,
.conditional-message,
#otherAuthorisation {
  margin: 17px 0;
}

.cannot-continue {
  font-size: 1.1em;
  margin-top: 10px;
}

.check-box-declare {
  margin: 5px 0;
}

@media (max-width: 920px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    overflow-x: hidden;
  }

  .step {
    margin-top: 15px;
  }

  .rail {
    display: none;
  }

  .seg span {
    font-size: 13.5px;
  }

  .topbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--navy);
    color: #fff;
    padding: 20px 22px;
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .topbar .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .topbar img {
    height: 34px;
  }

  .topbar .wordmark {
    display: block;
  }

  .topbar .step-name {
    font-family: var(--display);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: var(--yellow);
  }

  .progress-mini {
    display: block;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
  }

  .progress-mini i {
    display: block;
    height: 100%;
    background: var(--yellow);
    width: 20%;
    transition: width 0.4s ease;
  }

  .panel {
    padding: 30px 22px 56px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .qual {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .step h2 {
    font-size: 27px;
  }

  .nav {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
