/* ==========================================================================
   Public application form (/addexternalcandidates, /addexternalcandidates_qr)

   Loaded by application/views/ui/pcform/application_form.php — the
   redesigned copy picked by ui_pcform() (config/ui.php: ui_modern_pcform) —
   and, as its base, by the redesigned job card request form
   (views/ui/message/job_card_form_new.php, plus pages/jobcard.css). The
   original views keep their own styles and never load this file, so
   switching either back is exact.

   Self-contained on purpose: this is a public page with no session, so it does
   not load app.css. The tokens below are app.css's own values.
   ========================================================================== */

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../../../fonts/figtree/figtree-latin-variable.woff2') format('woff2');
}

:root {
  --ink: #050504;
  --ink-2: #45443f;
  --muted: #76746e;
  --bg: #edeae6;
  --surface: #ffffff;
  --surface-2: #f6f4f1;
  --border: #d6d1c9;
  --hairline: #e8e4df;
  --accent: #ff3c00;
  --accent-2: #ff781d;
  --accent-700: #e63500;
  --accent-50: #fff1ea;
  --accent-100: #ffd9cc;
  --gradient: linear-gradient(90deg, #ff3c00 0%, #ff781d 100%);
  --error: #d5281b;
  --error-50: #fbeae9;
  --ok: #00703c;
  --ok-50: #e7f5e8;
  --ring: 0 0 0 3px rgba(255, 60, 0, .28);
  --radius: 10px;
  --radius-lg: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Figtree', 'Inter', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent-700); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 0; box-shadow: var(--ring); border-radius: 4px; }
/* The script moves focus to each step's heading for screen readers; that is
   not something to draw a box around. */
h1[tabindex="-1"]:focus { outline: 0; box-shadow: none; }

/* ---------- Header ---------- */
.app-header { background: var(--ink); color: #fff; }
.app-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; color: #fff; text-decoration: none; }
.brand__logo { height: 40px; width: auto; display: block; }
.app-header__tag { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .72); letter-spacing: .02em; }

/* ---------- Page layout ---------- */
.pc-page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  flex: 1 0 auto;
  display: grid;
  gap: 24px;
  align-items: start;
}
.pc-page--wizard { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) {
  .pc-page { padding: 40px 20px 72px; }
  .pc-page--wizard { grid-template-columns: 236px minmax(0, 1fr); gap: 32px; }
}
.pc-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .05);
  padding: 24px 20px 28px;
  min-width: 0;
}
@media (min-width: 641px) { .pc-card { padding: 36px 40px 40px; } }
.pc-page--single { max-width: 720px; }

/* ---------- Step list (desktop) ---------- */
.pc-steps { display: none; }
@media (min-width: 920px) {
  .pc-steps { display: block; position: sticky; top: 24px; }
}
.pc-steps li { min-height: 40px; }
.pc-steps ol { list-style: none; margin: 0; padding: 0; position: relative; }
.pc-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 15px;
  color: var(--muted);
}
/* the connecting line between markers */
.pc-steps li + li::before {
  content: "";
  position: absolute;
  left: 15px;   /* dot centre 16px (4px padding + 12px), minus half the line */
  top: -8px;    /* from the dot above (8px padding below it) ... */
  height: 16px; /* ... to this dot (8px padding above it) */
  width: 2px;
  background: var(--border);
}
.pc-steps li.is-done + li::before { background: var(--ink); }
.pc-steps__dot {
  position: relative;
  z-index: 1;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pc-steps li.is-done { color: var(--ink-2); }
.pc-steps li.is-done .pc-steps__dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.pc-steps li.is-done .pc-steps__dot span { display: none; }
.pc-steps li.is-done .pc-steps__dot::after {
  content: "";
  width: 10px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.pc-steps li.is-current { color: var(--ink); font-weight: 700; }
.pc-steps li.is-current .pc-steps__dot { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-50); }

/* ---------- Progress (phones and tablets) ---------- */
.progress { margin-bottom: 18px; }
.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.progress__meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress__title { color: var(--ink); font-weight: 600; }
.progress__track { height: 6px; background: var(--hairline); border-radius: 999px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--gradient); width: 10%; border-radius: 999px; transition: width .3s ease; }
@media (min-width: 920px) { .progress { display: none !important; } }

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px -6px;
  padding: 6px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.back-link:hover { color: var(--ink); background: var(--surface-2); }
.back-link svg { width: 8px; height: 12px; }
.back-link[hidden] { display: none; }

/* ---------- Typography ---------- */
.caption {
  display: block;
  color: var(--accent-700);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
h1, h2, h3 { color: var(--ink); text-wrap: balance; margin: 0 0 16px; }
.h-xl { font-size: 30px; line-height: 1.12; font-weight: 750; letter-spacing: -.01em; }
.h-l { font-size: 25px; line-height: 1.18; font-weight: 750; letter-spacing: -.01em; }
.h-m { font-size: 19px; line-height: 1.25; font-weight: 700; margin-bottom: 10px; }
@media (min-width: 641px) {
  .h-xl { font-size: 38px; }
  .h-l { font-size: 29px; }
}
.lead { font-size: 18px; color: var(--ink-2); margin: 0 0 20px; max-width: 40em; }
p { max-width: 42em; margin: 0 0 14px; }
ul.plain { max-width: 42em; padding-left: 0; list-style: none; margin: 0 0 20px; display: grid; gap: 10px; }
ul.plain li {
  position: relative;
  padding: 12px 14px 12px 44px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
ul.plain li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 15px;
  height: 8.5px;
  border: solid var(--accent);
  border-width: 0 0 2.5px 2.5px;
  transform: translateY(-70%) rotate(-45deg);
}

.inset {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 16px 0;
  max-width: 42em;
  color: var(--ink-2);
  font-size: 15px;
}
.inset p { margin: 0; }
.inset--quiet { border-left-color: var(--border); }

/* ---------- Form structure ---------- */
.form-step { display: none; }
.form-step.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .form-step.is-active { animation: none; }
  .progress__fill { transition: none; }
}

.form-group { margin-bottom: 22px; max-width: 42em; }
.label { display: block; font-weight: 650; margin-bottom: 6px; font-size: 16px; color: var(--ink); }
.hint { display: block; color: var(--muted); margin-bottom: 10px; font-size: 15px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
legend .h-l, legend .h-m { margin-bottom: 8px; }

.input, .select, .textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #a8a59f; }
.input:hover, .select:hover, .textarea:hover { border-color: #b9b3aa; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--accent); box-shadow: var(--ring); }
.input--width-20 { max-width: 20em; }
.input--width-10 { max-width: 12em; }
textarea.input { min-height: 72px; resize: vertical; }
.textarea { min-height: 140px; resize: vertical; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2345443f' stroke-width='1.8' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ---------- Radios: each option a tappable card ---------- */
.radios { max-width: 42em; display: grid; gap: 8px; }
.radios__item { position: relative; }
.radios__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.radios__label {
  position: relative;
  display: block;
  padding: 13px 16px 13px 50px;
  font-size: 16px;
  line-height: 1.35;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.radios__label::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid #9d978e;
  border-radius: 50%;
  background: var(--surface);
  transition: border-color .15s;
}
.radios__label::after {
  content: "";
  position: absolute;
  left: 26px;   /* the circle's centre: 16px + half of 20px */
  top: 50%;
  transform: translate(-50%, -50%) scale(.4);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
.radios__input:hover + .radios__label { border-color: #b9b3aa; }
.radios__input:checked + .radios__label { border-color: var(--accent); background: var(--accent-50); font-weight: 600; }
.radios__input:checked + .radios__label::before { border-color: var(--accent); background: var(--accent); }
.radios__input:checked + .radios__label::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.radios__input:focus-visible + .radios__label { box-shadow: var(--ring); }
@media (max-width: 640px) {
  .radios__label { padding: 12px 14px 12px 48px; font-size: 15.5px; }
}

/* ---------- Checkbox (the declaration) ---------- */
.checkboxes__item { position: relative; max-width: 42em; }
.checkboxes__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.checkboxes__label {
  position: relative;
  display: block;
  padding: 16px 18px 16px 54px;
  font-size: 15px;
  line-height: 1.5;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.checkboxes__label::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 18px;
  width: 22px;
  height: 22px;
  border: 2px solid #9d978e;
  border-radius: 6px;
  background: var(--surface);
}
.checkboxes__label::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 29px;
  width: 12px;
  height: 7px;
  border: solid #fff;
  border-width: 0 0 2.5px 2.5px;
  transform: translate(-50%, -70%) rotate(-45deg);
  opacity: 0;
}
.checkboxes__input:checked + .checkboxes__label { border-color: var(--accent); background: var(--accent-50); }
.checkboxes__input:checked + .checkboxes__label::before { border-color: var(--accent); background: var(--accent); }
.checkboxes__input:checked + .checkboxes__label::after { opacity: 1; }
.checkboxes__input:focus-visible + .checkboxes__label { box-shadow: var(--ring); }

/* ---------- Conditional reveal ---------- */
.conditional {
  margin: 0 0 4px 25px;   /* the radio's centre is 26px in; the 2px line sits on it */
  padding: 14px 0 2px 22px;
  border-left: 2px solid var(--accent-100);
}
@media (max-width: 640px) {
  .conditional { padding-left: 14px; }
}
.conditional[hidden] { display: none; }
.conditional .form-group { margin-bottom: 14px; }
.conditional .hint { margin-bottom: 0; }

/* ---------- File upload: the browser's own file button, in a drop zone ---------- */
/* minmax(0, ...) and min-width: 0: a file input has a minimum width of its own,
   which otherwise pushes the columns past the card on a phone */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 42em; }
@media (min-width: 641px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.grid-2 .form-group { margin-bottom: 0; min-width: 0; }
.grid-2 + .form-group { margin-top: 24px; }
/* One row: the icon, then the browser's own button with its "No file chosen" /
   file name. Chrome lays out the inside of a file input itself and will not
   centre it, so the row reads left to right. */
.file-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 4px;
  border: 1.5px dashed #b9b3aa;
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
  transition: border-color .15s, background-color .15s;
}
.file-upload:hover { border-color: var(--accent); background: var(--accent-50); }
.file-upload:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.file-upload__icon { flex: 0 0 26px; width: 26px; height: 26px; color: var(--accent); }
.file-upload input[type=file] {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-upload input[type=file]:focus { outline: 0; }
.file-upload input[type=file]::file-selector-button {
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 16px;
  margin: 0 10px 0 0;
  cursor: pointer;
  transition: border-color .15s;
}
.file-upload input[type=file]:hover::file-selector-button { border-color: var(--accent); }
.file-upload.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-50); }
.file-upload.has-file .file-upload__icon { color: var(--ok); }
.file-chosen {
  flex: 0 0 100%;
  font-size: 14px;
  font-weight: 650;
  color: var(--ok);
  word-break: break-all;
}
.file-chosen:empty { display: none; }

/* ---------- Character count ---------- */
.char-count-msg { margin-top: 6px; font-size: 14px; color: var(--muted); }
.char-count-msg.is-over { color: var(--error); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  padding: 15px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gradient); background-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255, 60, 0, .22); }
.btn--primary:hover { background: var(--accent-700); color: #fff; }
.btn--primary:focus-visible { box-shadow: var(--ring), 0 6px 16px rgba(255, 60, 0, .22); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn--secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hairline); }
@media (max-width: 640px) { .btn-row .btn { width: 100%; } }

/* ---------- Errors ---------- */
.error-summary {
  border-left: 4px solid var(--error);
  background: var(--error-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
  max-width: 42em;
}
/* focused by the script so screen readers read it out; not a control, no ring */
.error-summary:focus { outline: 0; box-shadow: none; }
.error-summary h2 { font-size: 17px; margin: 0 0 8px; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 18px; }
.error-summary li + li { margin-top: 4px; }
.error-summary a { color: var(--error); font-weight: 650; }
.error-summary[hidden] { display: none; }
.restore-note { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }

.form-group--error { border-left: 3px solid var(--error); padding-left: 14px; }
.form-group--error .label,
.form-group--error legend .h-m { color: var(--error); }
.error-msg { display: none; color: var(--error); font-weight: 650; font-size: 15px; margin-bottom: 8px; }
.form-group--error .error-msg { display: block; }
.form-group--error .input,
.form-group--error .select,
.form-group--error .textarea { border-color: var(--error); }
.form-group--error .file-upload { border-color: var(--error); }

/* ---------- Check answers ---------- */
.summary-list { margin-bottom: 24px; }
.pc-sum { border: 1px solid var(--hairline); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.pc-sum__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
}
.pc-sum__head h2 { font-size: 16px; margin: 0; }
.pc-sum__head a { font-size: 15px; font-weight: 650; }
.pc-sum dl { margin: 0; padding: 4px 16px; }
.summary-list__row { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
.summary-list__row + .summary-list__row { border-top: 1px solid var(--hairline); }
@media (min-width: 641px) { .summary-list__row { grid-template-columns: 38% 1fr; gap: 16px; } }
.summary-list__key { font-weight: 600; color: var(--ink-2); font-size: 15px; }
.summary-list__val { margin: 0; color: var(--ink); word-break: break-word; white-space: pre-line; }
.summary-list__val--muted { color: var(--muted); }

/* ---------- "How we use your data" ---------- */
details.data-drawer { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); margin: 20px 0; max-width: 42em; }
details.data-drawer > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 650;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--radius);
}
details.data-drawer > summary::-webkit-details-marker { display: none; }
details.data-drawer > summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border: solid var(--ink-2);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .15s ease;
}
details.data-drawer[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.data-drawer > summary:hover { background: var(--surface-2); }
.data-drawer__body { padding: 2px 16px 12px; border-top: 1px solid var(--hairline); font-size: 15px; color: var(--ink-2); }
.data-drawer__body h3 { font-size: 16px; margin: 14px 0 6px; }
.data-drawer__body p { margin: 6px 0; }
.data-drawer__body ul { margin: 4px 0 12px; padding-left: 20px; }
.data-drawer__body li { margin-bottom: 4px; }

/* ---------- Confirmation ---------- */
.panel { text-align: center; padding: 8px 0 20px; }
.panel__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-50);
  color: var(--ok);
}
.panel__icon svg { width: 30px; height: 30px; }
.panel--notice .panel__icon { background: var(--accent-50); color: var(--accent-700); }
.panel h1 { margin-bottom: 10px; }
.panel__ref { font-size: 18px; color: var(--ink-2); margin: 0 auto; }
.panel + .h-m { margin-top: 8px; }
.pc-card .panel ~ .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.app-footer { flex-shrink: 0; }
.app-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
.hp-field { position: absolute !important; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
