/* All 4 Job Application - shared styles for the application page and the admin page. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo.woff2") format("woff2");
}

:root {
  --paper: #FBF9F4;
  --surface: #FFFFFF;
  --navy: #23306B;
  --navy-deep: #182250;
  --navy-tint: #EDEFF7;
  --red: #D8232A;
  --red-deep: #B31B21;
  --red-tint: #FCECEC;
  --ink: #1B1D2A;
  --muted: #5B6072;
  --line: #D9D4C7;
  --line-soft: #EAE6DB;
  --ok: #1C7A4C;
  --ok-tint: #E7F4EC;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --r-field: 10px;
  --r-tile: 12px;
  --r-panel: 22px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  font-stretch: 100%;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; font-family: var(--display); color: var(--navy); }

p { margin: 0; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* ---------- Top bar ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px;
  max-width: 1160px; margin: 0 auto;
}
.top .logo { height: 54px; width: auto; }
.top .logo-link { text-decoration: none; }
.top .logo-fallback {
  font-family: var(--display); font-stretch: 62%; font-weight: 900; font-size: 1.7rem;
  color: var(--navy); letter-spacing: 0.01em; text-decoration: none;
}
.top .top-note { color: var(--muted); font-size: 0.94rem; text-align: right; }

/* ---------- Application layout ---------- */

.shell { max-width: 1160px; margin: 0 auto; padding: 0 0 56px; }

.side {
  position: relative; overflow: hidden;
  background: var(--navy); color: #fff;
  padding: 30px 22px 30px;
}
.side .big4 {
  position: absolute; right: 0.02em; bottom: -0.12em;
  font-family: var(--display); font-stretch: 62%; font-weight: 900;
  font-size: 17rem; line-height: 0.8; color: rgba(255, 255, 255, 0.07);
  pointer-events: none; user-select: none;
}
.side .tagline {
  position: relative;
  font-family: var(--display); font-stretch: 62%; font-weight: 900;
  font-size: clamp(3.6rem, 17vw, 5.2rem); line-height: 0.86; letter-spacing: -0.005em;
  text-transform: uppercase; color: #fff; margin: 0;
}
.side .values {
  position: relative; margin-top: 16px; max-width: 24ch;
  font-weight: 500; font-size: 1.06rem; line-height: 1.4; color: rgba(255, 255, 255, 0.86);
}
.side .steps { display: none; }

.stage { padding: 26px 20px 0; }

.progress { margin-bottom: 22px; }
.progress .count { font-weight: 600; font-size: 0.94rem; color: var(--muted); }
.progress .bar { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--red); border-radius: 3px; transition: width 0.25s ease; }

/* When the applicant is inside a step, the phone layout drops the big banner. */
body[data-step]:not([data-step="0"]) .side { display: none; }
body[data-step="0"] .progress,
body[data-step="done"] .progress { display: none; }

.panel[hidden] { display: none; }

.panel h1, .panel h2.title {
  font-stretch: 75%; font-weight: 800; font-size: clamp(2rem, 7vw, 2.6rem); line-height: 1.02;
  letter-spacing: -0.005em;
}
.panel .lede { margin-top: 10px; color: var(--muted); max-width: 56ch; }

.ready { margin: 24px 0 0; padding: 0; list-style: none; max-width: 52ch; }
.ready li { position: relative; padding: 10px 0 10px 30px; border-top: 1px solid var(--line-soft); }
.ready li:last-child { border-bottom: 1px solid var(--line-soft); }
.ready li::before {
  content: ""; position: absolute; left: 4px; top: 19px; width: 10px; height: 10px;
  background: var(--red); transform: rotate(45deg);
}
.fineprint { margin-top: 18px; font-size: 0.94rem; color: var(--muted); max-width: 56ch; }

/* ---------- Fields ---------- */

.fields { margin-top: 26px; display: grid; gap: 20px; }
.row { display: grid; gap: 20px; }
.row.three { grid-template-columns: 1.5fr 1fr 1.1fr; gap: 10px; }
.row.three select { padding-left: 12px; padding-right: 30px; background-position: right 10px center; }

.field { min-width: 0; }
.field > label, .group > legend, .field > .label {
  display: block; font-weight: 650; font-size: 1rem; color: var(--ink); margin-bottom: 7px; padding: 0;
}
.optional { font-weight: 400; color: var(--muted); }
.hint { font-size: 0.92rem; color: var(--muted); margin: -3px 0 8px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"],
input[type="search"], select, textarea {
  width: 100%; min-height: 50px;
  padding: 12px 14px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-field);
  appearance: none; -webkit-appearance: none;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
select {
  padding-right: 38px;
  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 d='M1 1.5l5 5 5-5' fill='none' stroke='%2323306B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:hover, select:hover, textarea:hover { border-color: #B9B3A3; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(35, 48, 107, 0.2);
}
[aria-invalid="true"] { border-color: var(--red) !important; }

.prefix { position: relative; }
.prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.prefix > input { padding-left: 30px; }

.group { border: 0; margin: 0; padding: 0; min-width: 0; }

.err { margin-top: 7px; font-size: 0.93rem; font-weight: 600; color: var(--red-deep); }
.err:empty { display: none; }

.alert {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--r-tile);
  background: var(--red-tint); border: 1.5px solid #F1B9BB; color: #7D1318; font-weight: 550;
}
.alert[hidden] { display: none; }
.notice {
  margin-top: 12px; padding: 14px 16px; border-radius: var(--r-tile);
  background: var(--navy-tint); color: var(--navy-deep);
}
.notice[hidden] { display: none; }

/* Choice tiles (checkbox and radio) */
.tiles { display: grid; gap: 10px; }
.tiles.pair { grid-template-columns: 1fr 1fr; }
.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; width: 100%; height: 100%; left: 0; top: 0; margin: 0; cursor: pointer; }
.tile span {
  display: flex; align-items: center; gap: 12px;
  min-height: 54px; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-tile);
  font-weight: 550;
}
.tile span::before {
  content: ""; flex: none; width: 22px; height: 22px;
  border: 2px solid #A9A392; border-radius: 6px; background: var(--surface);
}
.tile input[type="radio"] + span::before { border-radius: 50%; }
.tile input:hover + span { border-color: #B9B3A3; }
.tile input:checked + span { border-color: var(--navy); background: var(--navy-tint); box-shadow: inset 0 0 0 1px var(--navy); }
.tile input:checked + span::before {
  border-color: var(--navy); background-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11' viewBox='0 0 14 11'%3E%3Cpath d='M1.5 5.5l3.5 3.5 7.5-7.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.tile input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Availability */
.days { display: grid; gap: 10px; }
.day { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-tile); padding: 6px 12px 6px 6px; }
.day.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.day .tile span { border: 0; background: transparent; box-shadow: none !important; min-height: 46px; padding: 8px; }
.day .times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 2px 2px 8px 8px; }
.day .times[hidden] { display: none; }
.day .times label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.day .times select { min-height: 46px; }
.day .err { padding: 0 8px 8px; margin-top: 0; }

/* Employers */
.job { border: 1.5px solid var(--line); border-radius: var(--r-tile); background: var(--surface); padding: 18px 16px 20px; }
.job h3 { font-stretch: 85%; font-weight: 750; font-size: 1.2rem; }
.job .fields { margin-top: 16px; gap: 16px; }
.job .row { gap: 16px; }
.job[hidden] { display: none; }

/* File picker */
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.file input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file .picked { color: var(--muted); font-size: 0.96rem; overflow-wrap: anywhere; }

/* Signature */
.sigwrap { position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-tile); overflow: hidden; }
.sigwrap canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sigwrap .baseline { position: absolute; left: 18px; right: 18px; bottom: 46px; border-bottom: 1.5px dashed #BDB7A6; pointer-events: none; }
.sigwrap .placeholder { position: absolute; left: 18px; bottom: 16px; color: var(--muted); font-size: 0.92rem; pointer-events: none; }
.sigwrap .clear { position: absolute; right: 8px; top: 8px; }
.sigwrap.bad { border-color: var(--red); }
.signing-as { margin-top: 8px; font-size: 0.94rem; color: var(--muted); }

.legal {
  max-height: 260px; overflow: auto; padding: 16px; font-size: 0.95rem; line-height: 1.5;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-tile);
}
.legal p + p { margin-top: 12px; }

/* Review summary */
.review { margin-top: 26px; display: grid; gap: 14px; }
.review section { border-top: 2px solid var(--navy); padding-top: 12px; }
.review .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.review h3 { font-stretch: 85%; font-weight: 750; font-size: 1.15rem; }
.review dl { margin: 8px 0 0; display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 5px 14px; font-size: 0.97rem; }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px;
  font: inherit; font-weight: 700; font-size: 1.04rem;
  border-radius: var(--r-tile); border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-deep); }
.btn.primary:disabled { background: #C9C4B8; color: #fff; cursor: not-allowed; }
.btn.quiet { background: var(--surface); color: var(--navy); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--navy); }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 0.92rem; border-radius: 8px; }
.linkbtn { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 650; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.actions { margin-top: 30px; display: flex; flex-direction: column-reverse; gap: 12px; }
.actions .btn { width: 100%; }

/* ---------- Done ---------- */

.done-mark {
  width: 64px; height: 64px; border-radius: 50%; background: var(--ok-tint); color: var(--ok);
  display: grid; place-items: center; margin-bottom: 18px;
}

/* ---------- Wider screens ---------- */

@media (min-width: 560px) {
  .row.two { grid-template-columns: 1fr 1fr; }
  .row.three { gap: 20px; }
  .row.addr { grid-template-columns: 1.3fr 1fr 0.8fr; }
  .tiles.cols { grid-template-columns: 1fr 1fr; }
  .actions { flex-direction: row; justify-content: space-between; align-items: center; }
  .actions .btn { width: auto; }
  .actions .btn.primary { min-width: 200px; margin-left: auto; }
  .actions.start .btn.primary { margin-left: 0; }
  .day { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr; align-items: center; column-gap: 10px; }
  .day .times { padding: 6px 0; }
  .day .err { grid-column: 1 / -1; }
  .stage { padding: 34px 32px 0; }
  .side { padding: 40px 32px; }
}

@media (min-width: 940px) {
  .shell {
    display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 56px; align-items: start;
    padding: 8px 20px 72px;
  }
  .side, body[data-step]:not([data-step="0"]) .side {
    display: block; position: sticky; top: 20px;
    border-radius: var(--r-panel); padding: 40px 34px 44px; min-height: 620px;
  }
  .side .tagline { font-size: 6.2rem; }
  .side .big4 { font-size: 27rem; right: -0.04em; bottom: -0.17em; }
  .side .steps {
    display: block; position: relative; list-style: none; margin: 44px 0 0; padding: 0;
    counter-reset: step;
  }
  .side .steps li { counter-increment: step; }
  .side .steps button {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 9px 0; background: none; border: 0; text-align: left;
    font: inherit; font-weight: 550; font-size: 1.05rem; color: rgba(255, 255, 255, 0.62); cursor: default;
  }
  .side .steps button::before {
    content: counter(step); flex: none; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: 0.95rem;
    border: 1.5px solid rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.75);
  }
  .side .steps li.current button { color: #fff; font-weight: 700; }
  .side .steps li.current button::before { background: #fff; border-color: #fff; color: var(--navy); }
  .side .steps li.done button { color: rgba(255, 255, 255, 0.9); cursor: pointer; }
  .side .steps li.done button::before {
    content: ""; background-color: var(--red); border-color: var(--red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='11' viewBox='0 0 14 11'%3E%3Cpath d='M1.5 5.5l3.5 3.5 7.5-7.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center;
  }
  .side .steps li.done button:hover { text-decoration: underline; text-underline-offset: 4px; }
  .side .steps button:focus-visible { outline-color: #fff; }
  .progress { display: none; }
  .stage { padding: 30px 0 0; max-width: 640px; }
}

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

/* The hidden attribute always wins, whatever display a class sets. */
[hidden] { display: none !important; }
