/* Cresta coach hiring site. Tokens and type follow crestachess.com (Cresta Website/docs/design.md).
   No inline styles anywhere: the CSP has no 'unsafe-inline', so every look lives in this file. */

/* Fonts are hosted on this site, so visitors' IP addresses are not sent to Google. Licence: SIL OFL 1.1. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-700.woff2") format("woff2");
}
@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/young-serif-400.woff2") format("woff2");
}

:root {
  --ink: #172044;
  --indigo: #2B3A86;
  --indigo-dark: #1F2B6A;
  --sky: #E4EBF8;
  --page: #F6F8FC;
  --paper: #FFFFFF;
  --marker: #FFD84D;
  --muted: #4D5878;
  --line: #D3DAEA;
  --ok: #2F7A55;
  --ok-soft: #E3F2EA;
  --wip: #7A5000;
  --wip-soft: #FFF3C4;
  --warn: #B4322F;
  --warn-soft: #FBE7E6;

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.889rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 3.6vw, 2.5rem);
  --step-4: clamp(2.3rem, 5.4vw, 3.4rem);

  --wrap: 1120px;
  --gutter: 16px;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: 1.5rem; line-height: 1.3; }
p, ul, ol, dl { margin: 0 0 1em; }
p, li { max-width: 68ch; }
a { color: var(--indigo); text-underline-offset: 0.18em; }
a:hover { color: var(--indigo-dark); }
strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--marker);
  border-radius: 4px;
}
/* Headings get focus from script after a step changes; they don't need a ring. */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 760px; }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--paper);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { left: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; }
.brand-sep { display: none; }
.brand-tag { font-size: 0.8rem; color: var(--muted); }
@media (min-width: 720px) {
  .brand-text { flex-direction: row; align-items: baseline; gap: 8px; }
  .brand-name { font-size: 1.3rem; }
  .brand-sep { display: inline; color: var(--muted); }
  .brand-tag { font-size: var(--step--1); }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--paper);
  background: var(--indigo);
  border: 2px solid var(--indigo);
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
}
.button:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); color: var(--paper); }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.button-small { padding: 9px 16px; font-size: var(--step--1); white-space: nowrap; }
.button-quiet { background: transparent; color: var(--indigo); }
.button-quiet:hover { background: var(--sky); color: var(--indigo-dark); }
.button-danger { background: var(--warn); border-color: var(--warn); }
.button-danger:hover { background: #8F2624; border-color: #8F2624; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--indigo);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link-button:hover { color: var(--indigo-dark); }
.link-button.is-danger { color: var(--warn); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-sky { background: var(--sky); }
.section-ink { background: var(--ink); color: var(--paper); }
.section-ink a:not(.button) { color: var(--marker); }
.section-ink .button { background: var(--marker); border-color: var(--marker); color: var(--ink); }
.section-ink .button:hover { background: #FFE47F; border-color: #FFE47F; }
.section-ink .button-quiet { background: transparent; color: var(--paper); border-color: var(--paper); }
.section-ink .button-quiet:hover { background: rgba(255, 255, 255, 0.1); color: var(--paper); }
@media (min-width: 720px) { .section { padding: 88px 0; } }

.lead { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 44ch; }
.section-ink .lead, .section-ink .muted { color: #C9D2EC; }
.intro { max-width: 62ch; margin-bottom: 36px; }
.intro p { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(2.25rem, 5vw, 3.2rem); max-width: 24ch; }
.page-head .lead { max-width: 52ch; }
@media (min-width: 720px) { .page-head { padding: 64px 0 16px; } }
.page-head + .section { padding-top: 24px; }
@media (min-width: 720px) { .page-head + .section { padding-top: 40px; } }

/* ---------- Welcome: hero ---------- */
.hero { padding: 40px 0 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { max-width: 14ch; font-size: clamp(2.75rem, 7vw, 4.5rem); line-height: 1.05; }
@media (min-width: 900px) {
  .hero { padding: 80px 0 104px; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 64px; }
}
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: baseline; }
.facts li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--marker);
  border: 2px solid var(--ink);
  transform: translateY(-1px);
}

/* The memorable element: the pay card, like a sheet pinned to the page */
.pay-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(23, 32, 68, 0.45);
  padding: 22px 22px 18px;
  max-width: 460px;
}
.pay-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pay-card h2 { font-size: var(--step-1); margin: 0; }
.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--sky);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table caption { text-align: left; color: var(--muted); font-size: var(--step--1); padding-bottom: 6px; }
.pay-table th, .pay-table td { text-align: left; padding: 11px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.pay-table thead th { font-size: var(--step--1); color: var(--muted); border-top: 0; padding-top: 4px; }
.pay-table td { text-align: right; font-family: var(--serif); font-size: var(--step-1); white-space: nowrap; }
.pay-table thead th:last-child { text-align: right; }
.pay-table tbody th { font-weight: 400; }
.pay-table .per { font-family: var(--sans); font-size: var(--step--1); color: var(--muted); }
.pay-card-foot { margin: 12px 0 0; font-size: var(--step--1); color: var(--muted); }
.hl { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); padding: 0 2px; }

/* ---------- Welcome: bonuses and growth ---------- */
.bonus-grid { display: grid; gap: 20px; }
@media (min-width: 820px) { .bonus-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.bonus {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.bonus-amount { font-family: var(--serif); font-size: var(--step-3); line-height: 1.1; margin: 0; }
.bonus-unit { font-weight: 700; margin: 2px 0 12px; }
.bonus p:last-child { margin-bottom: 0; }
.bonus .small { color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 12px; }

.promise { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 820px) { .promise { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.promise div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.promise strong::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--marker);
  border: 2px solid var(--ink);
  vertical-align: 1px;
}
.promise strong { display: block; }
.promise p { margin: 0; color: var(--muted); }

/* ---------- Six steps (a real sequence, so numbered) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 60px; max-width: none; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -4px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--indigo);
  color: var(--indigo);
  font-family: var(--serif);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  background: var(--paper);
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--muted); margin: 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 32px 40px; } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.cta { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr auto; gap: 48px; } }
.cta h2 { margin-bottom: 0.3em; }
.cta p { margin: 0; }
.cta .button-row { margin-top: 0; }

/* ---------- Cards, notices ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
}
@media (min-width: 720px) { .card { padding: 32px; } }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: var(--step-2); }

.notice {
  background: var(--sky);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.notice > :last-child { margin-bottom: 0; }
.notice h2, .notice h3 { font-size: var(--step-1); margin-bottom: 0.4em; }

.gate-list { padding-left: 1.4em; margin: 0 0 20px; }
.gate-list li { padding-left: 4px; margin-bottom: 10px; }
.gate-list li::marker { font-family: var(--serif); color: var(--indigo); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 24px; }
.form-part { display: grid; gap: 22px; }
.part-head h2 { font-size: var(--step-2); margin-bottom: 0.2em; }
.part-head p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 700; line-height: 1.4; padding: 0; }
.field > legend { margin-bottom: 6px; }
.field .hint { font-size: var(--step--1); color: var(--muted); margin: 0; }
.optional { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"],
.field input[type="number"], .field select, .field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid #7C88A8;
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  min-height: 52px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--indigo); }
.field textarea { min-height: 140px; resize: vertical; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%232B3A86' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--warn); }
.counter { font-size: var(--step--1); color: var(--muted); margin: 0; text-align: right; }
.counter.is-over { color: var(--warn); font-weight: 700; }

.choices { display: grid; gap: 8px; }
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 400;
}
.choice:hover { border-color: #7C88A8; }
.choice:has(input:checked) { border-color: var(--indigo); background: #F1F4FC; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--indigo); }
.field[data-invalid] .choice { border-color: #E2A9A7; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; cursor: pointer; }
.consent input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--indigo); }

.error {
  margin: 0;
  color: var(--warn);
  font-weight: 700;
  font-size: var(--step--1);
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--paper);
  font-size: 0.75rem;
  transform: translateY(2px);
}

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-status { padding: 14px 18px; border-radius: 8px; font-weight: 700; margin: 0; }
.form-status:empty { display: none; }
.form-status.is-ok { background: var(--ok-soft); color: var(--ok); }
.form-status.is-info { background: var(--wip-soft); color: var(--wip); }
.form-status.is-error { background: var(--warn-soft); color: var(--warn); }

.form-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.form-nav .button { min-width: 112px; padding-left: 22px; padding-right: 22px; }
.form-nav .spacer { flex: 1 1 auto; }

/* Progress through the three parts of the application */
.progress { margin: 0 0 4px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: var(--step--1); color: var(--muted); margin: 0 0 8px; }
.progress-label strong { color: var(--ink); }
.progress-track { height: 8px; border-radius: 999px; background: var(--sky); overflow: hidden; }
.progress-bar { height: 100%; width: 33.34%; background: var(--indigo); border-radius: 999px; transition: width 0.25s ease; }
.progress[data-part="2"] .progress-bar { width: 66.67%; }
.progress[data-part="3"] .progress-bar { width: 100%; }
@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }

.privacy { border: 1px solid #C3CFEA; }
.privacy ul { padding-left: 1.2em; margin-bottom: 0.8em; }
.privacy li { margin-bottom: 4px; }

/* ---------- Applied ---------- */
.sent-to {
  font-family: var(--serif);
  font-size: var(--step-2);
  line-height: 1.25;
  overflow-wrap: anywhere;
  margin: 4px 0 16px;
}
.next-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: next; }
.next-list li { counter-increment: next; position: relative; padding-left: 44px; }
.next-list li::before {
  content: counter(next);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--indigo);
  font-family: var(--serif);
  display: grid;
  place-items: center;
}

/* ---------- Tracker ---------- */
.number-line { font-size: var(--step--1); color: var(--muted); margin: 0 0 24px; }
.number-line strong { color: var(--ink); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.04em; font-size: 1rem; }
.mono-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace !important; letter-spacing: 0.06em; text-transform: uppercase; }

.now {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 36px;
}
@media (min-width: 720px) { .now { padding: 28px 32px; } }
.now h2 { font-size: var(--step-2); margin-bottom: 0.4em; }
.now p:last-child { margin-bottom: 0; }
.now .button-row { margin-top: 16px; }
.now-due { font-weight: 700; }

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
  background: var(--sky);
  color: var(--ink);
  white-space: nowrap;
}
.badge-you { background: var(--marker); color: var(--ink); }
.badge-us { background: var(--sky); color: var(--indigo); }
.badge-done { background: var(--ok-soft); color: var(--ok); }
.badge-closed { background: #ECEEF3; color: var(--muted); }

.timeline { list-style: none; margin: 0 0 36px; padding: 0; }
.timeline li { position: relative; padding: 0 0 26px 44px; max-width: none; }
.timeline li::before {
  /* the line joining the dots */
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #A9B4CF;
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.timeline .is-done .dot { background: var(--indigo); border-color: var(--indigo); color: var(--paper); }
.timeline .is-done::before { background: var(--indigo); }
.timeline .is-current .dot { background: var(--marker); border-color: var(--ink); color: var(--ink); }
.timeline .is-closed .dot { background: #ECEEF3; border-color: #A9B4CF; }
.timeline-title { font-weight: 700; margin: 0; line-height: 1.6; }
.timeline .is-upcoming .timeline-title { color: var(--muted); font-weight: 400; }
.timeline-meta { margin: 0; font-size: var(--step--1); color: var(--muted); }
.timeline .is-current .timeline-meta { color: var(--ink); }

.tracker-foot { border-top: 1px solid var(--line); padding-top: 24px; display: grid; gap: 14px; }
.tracker-foot p { margin: 0; }
.tracker-actions { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }

dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 60px -20px rgba(23, 32, 68, 0.6);
}
dialog::backdrop { background: rgba(23, 32, 68, 0.55); }
.dialog-body { padding: 24px 22px; }
.dialog-body h2 { font-size: var(--step-2); }
.dialog-body .button-row { margin-top: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C9D2EC; padding: 40px 0 28px; font-size: var(--step--1); margin-top: 0; }
.site-footer a { color: var(--paper); }
.footer-inner { display: grid; gap: 12px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1fr auto; align-items: end; gap: 32px; } }
.footer-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--paper); margin: 0; }
.site-footer p { margin: 0; max-width: none; }

.section-title-gap { font-size: var(--step-2); margin-top: 48px; }
.section-gap { margin-top: 32px; }
.section-tight { padding-top: 16px; }
@media (min-width: 720px) { .section-tight { padding-top: 24px; } }
.timeline-heading { font-size: var(--step-2); }
#tracker-status:not(:empty) { margin-bottom: 20px; }
/* Short header link on phones; screen readers still hear the whole label */
@media (max-width: 479px) {
  .narrow-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .brand-name { font-size: 1.05rem; }
  .brand-mark { width: 30px; height: 30px; }
}
