/* CATALYST Employer Commitment — mobile-first, USA-branded */
:root {
  --navy: #00205b;
  --navy-2: #0a2e6e;
  --red: #ba0c2f;
  --cyan: #22d3ee;
  --ink: #1a1d24;
  --muted: #5b6472;
  --line: #e2e6ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #1a7f4b;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(0, 32, 91, 0.08);
  --tap: 52px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-logo {
  height: 38px;
  width: auto;
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
}
.topbar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.topbar-program {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 16px;
}
.topbar-sub {
  font-size: 12px;
  color: #b9c6e6;
}

/* ---------- Progress ---------- */
.progress {
  padding: 12px 18px 0;
  max-width: 620px;
  margin: 0 auto;
}
.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--navy), var(--cyan));
  border-radius: 99px;
  transition: width 0.3s ease;
}
.progress-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 600;
}

/* ---------- Layout ---------- */
main {
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 18px 40px;
}
.screen {
  display: none;
  animation: fade 0.25s ease;
}
.screen.active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Hero / intro ---------- */
.hero h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 8px 0 8px;
  color: var(--navy);
}
.hero-sub {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 15px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.about h2 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--navy);
}
.about p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ink);
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
  font-size: 14.5px;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ok);
  font-weight: 800;
}
.fineprint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

/* ---------- Steps ---------- */
.step-title {
  font-size: 21px;
  color: var(--navy);
  margin: 4px 0 6px;
}
.step-title.center {
  text-align: center;
}
.step-help {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14.5px;
}

/* ---------- Fields ---------- */
.field {
  display: block;
  margin-bottom: 16px;
}
.field > span {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink);
}
.field em {
  color: var(--red);
  font-style: normal;
}
.field .opt {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.field input,
.field textarea {
  width: 100%;
  font-size: 16px; /* 16px avoids iOS zoom */
  padding: 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0, 32, 91, 0.12);
}
.field input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(186, 12, 47, 0.12);
}
.field small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 6px;
}
.field input[type="file"] {
  padding: 11px;
  font-size: 14px;
}
.row {
  display: flex;
  gap: 12px;
}
.row .field {
  flex: 1;
}

/* ---------- Steppers ---------- */
.stepper-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}
.stepper-text strong {
  display: block;
  font-size: 16px;
  color: var(--navy);
}
.stepper-text span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.step-btn {
  width: var(--tap);
  height: var(--tap);
  border: 1.5px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font-size: 26px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.step-btn:active {
  background: var(--navy);
  color: #fff;
}
.step-val {
  min-width: 44px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}
.fixed-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 14.5px;
}
.advanced {
  margin-bottom: 16px;
}
.advanced summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 0;
}
.advanced textarea {
  resize: vertical;
}

/* ---------- Letter preview ---------- */
.letter-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  max-height: 58vh;
  overflow-y: auto;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 14px;
  line-height: 1.55;
  color: #222;
  -webkit-overflow-scrolling: touch;
}
.letter-preview .lh {
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
  font-family: inherit;
}
.letter-preview .laddr {
  color: #555;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.letter-preview .ldate {
  text-align: right;
  margin-bottom: 14px;
}
.letter-preview p {
  margin: 0 0 11px;
}
.letter-preview .lblock {
  margin-bottom: 12px;
}
.letter-preview ul {
  padding-left: 20px;
  margin: 0 0 11px;
}
.letter-preview li {
  margin-bottom: 7px;
}
.letter-preview .lsig {
  margin-top: 18px;
}
.letter-preview .lsig-line {
  border-top: 1px solid #333;
  width: 220px;
  margin: 22px 0 4px;
}

/* ---------- Sign ---------- */
.attest {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  cursor: pointer;
  font-size: 15px;
}
.attest input {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  accent-color: var(--navy);
}
.sig-block {
  margin-bottom: 16px;
}
.sig-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
}
.sigpad {
  width: 100%;
  height: 180px;
  background: #fff;
  border: 2px dashed var(--navy);
  border-radius: 12px;
  touch-action: none;
  display: block;
}
.sig-or {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 8px;
}
.typed-sig {
  width: 100%;
  font-size: 20px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-family: "Segoe Script", "Brush Script MT", cursive;
}
.date-line {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Buttons / nav ---------- */
.btn {
  font-size: 16px;
  font-weight: 700;
  padding: 15px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  min-height: var(--tap);
  font-family: inherit;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  width: 100%;
}
.btn-primary:active {
  background: var(--navy-2);
}
.btn-primary:disabled {
  opacity: 0.55;
}
.btn-big {
  font-size: 18px;
  padding: 17px 20px;
}
.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.nav {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.nav .btn-ghost {
  flex: 0 0 34%;
}
.nav .btn-primary {
  flex: 1;
}
.err {
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

/* ---------- Done ---------- */
.done-check {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 6px;
}
.done-text {
  text-align: center;
  color: var(--ink);
  font-size: 15.5px;
  margin: 0 auto 22px;
  max-width: 420px;
}

/* ---------- Footer ---------- */
.sitefoot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 20px;
  border-top: 1px solid var(--line);
}

/* spinner state */
.btn.loading {
  position: relative;
  color: transparent !important;
}
.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 560px) {
  .hero h1 {
    font-size: 30px;
  }
}
