:root {
  /* Layout: a black band carries the Imperial Auto Leasing mark; under it, a printed application sheet in black and white.
     Numbered sections sit in a left rail, entries in ruled boxes beside them; one column on phones.
     Red appears only on a field that needs fixing. */
  --band: #000000;
  --on-band: #FFFFFF;
  --paper: #F1F1F1;
  --sheet: #FFFFFF;
  --ink: #0B0B0B;
  --muted: #595959;
  --rule: #D6D6D6;
  --field: #767676;
  --accent: #0B0B0B;
  --on-accent: #FFFFFF;
  --alert: #B3261E;
  --alert-wash: #FBEDEC;
  --font-display: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Public Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
/* Dark applies when the viewer's device or app asks for it, unless the switch on this page (data-mode) says otherwise. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-mode="light"]) {
    --paper: #000000;
    --sheet: #0C0C0C;
    --ink: #F4F4F4;
    --muted: #A6A6A6;
    --rule: #2B2B2B;
    --field: #7D7D7D;
    --accent: #FFFFFF;
    --on-accent: #000000;
    --alert: #FF8F85;
    --alert-wash: #2E1513;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]:not([data-mode="light"]),
:root[data-mode="dark"] {
  --paper: #000000;
  --sheet: #0C0C0C;
  --ink: #F4F4F4;
  --muted: #A6A6A6;
  --rule: #2B2B2B;
  --field: #7D7D7D;
  --accent: #FFFFFF;
  --on-accent: #000000;
  --alert: #FF8F85;
  --alert-wash: #2E1513;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}
/* Brand band: the mark, white on black, in both themes */
.brand { position: relative; display: flex; justify-content: center; padding: 2.75rem 1.25rem 1.5rem; background: var(--band); }

/* Light and dark switch, in the corner of the band */
.mode {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  grid-auto-flow: column;
  border: 1px solid var(--on-band);
  border-color: color-mix(in srgb, var(--on-band) 55%, transparent);
  border-radius: 3px;
  overflow: hidden;
}
.mode:focus-within { outline: 2px solid var(--on-band); outline-offset: 2px; }
.mode label { position: relative; display: block; margin: 0; }
.mode input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mode span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.25rem;
  color: var(--on-band);
  transition: background-color 120ms ease, color 120ms ease;
}
.mode svg { display: block; width: 1.125rem; height: 1.125rem; }
.mode input:checked + span { background: var(--on-band); color: var(--band); }
.brand img {
  display: block;
  width: min(100%, 23rem);
  height: auto;
  color: var(--on-band);
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-align: center;
}
.page { max-width: 47rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
.sheet {
  display: block;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

/* Spam trap: off screen for people, still filled in by robots */
.trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.masthead { padding: 1.5rem 1.25rem; }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.875rem, 1.2rem + 3.2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1:focus, .result:focus, .summary:focus { outline: none; }
.lead { margin: 0.75rem 0 0; max-width: 65ch; color: var(--muted); }
.noscript { margin: 0; padding: 0 1.25rem 1.5rem; color: var(--alert); font-weight: 600; }

/* Sections */
.section {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem 1.25rem 1.75rem;
  border-top: 1px solid var(--rule);
}
.rail { display: flex; align-items: baseline; gap: 0.625rem; }
.num { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; color: var(--accent); }
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.25;
  text-wrap: balance;
}
.fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.125rem 0.875rem;
  align-items: start;
}
.field { grid-column: span 12; min-width: 0; }
.p5 { grid-column: span 5; }
.p7 { grid-column: span 7; }

/* Labels, hints, errors */
label, .label { display: block; margin: 0 0 0.375rem; font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.opt { font-weight: 400; color: var(--muted); }
.hint { margin: 0.375rem 0 0; font-size: 0.8125rem; line-height: 1.4; color: var(--muted); }
.error { margin: 0.375rem 0 0; font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--alert); }

/* Entries */
input[type="text"], input[type="tel"], input[type="email"], select {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--field);
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder { color: var(--muted); opacity: 1; }
.num-entry { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.control { position: relative; }
.control .prefix, .control .suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.control .prefix { left: 0.75rem; }
.control .suffix { right: 0.75rem; font-size: 0.875rem; }
.control.has-prefix input { padding-left: 1.625rem; }
.control.has-suffix input { padding-right: 4.25rem; }
.control.select::after {
  content: "";
  position: absolute;
  right: 0.9375rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.control.select select { padding-right: 2.25rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }

/* Segmented choices */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--field);
  border-radius: 3px;
  overflow: hidden;
}
.seg.narrow { max-width: 14rem; }
.seg:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg label { position: relative; display: block; margin: 0; font-size: 1rem; font-weight: 500; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 0.75rem;
  border-left: 1px solid var(--field);
  transition: background-color 120ms ease, color 120ms ease;
}
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg input:checked + span::before { content: "\2713"; margin-right: 0.4em; }

/* Error state */
.field.has-error input[type], .field.has-error select, .field.has-error .seg {
  border-color: var(--alert);
  box-shadow: 0 0 0 1px var(--alert);
}
.summary {
  margin: 0 1.25rem 1.5rem;
  padding: 1rem 1.125rem;
  background: var(--alert-wash);
  border: 2px solid var(--alert);
  border-radius: 3px;
}
.summary h2 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.summary ul { margin: 0.5rem 0 0; padding-left: 1.125rem; font-size: 0.9375rem; line-height: 1.4; }
.summary li + li { margin-top: 0.375rem; }
.summary a { color: var(--alert); font-weight: 600; text-underline-offset: 2px; }

/* Signature block */
.signoff { grid-column: span 12; display: grid; gap: 1.25rem 2rem; margin-top: 0.25rem; }
.sigline {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  min-height: 3.75rem;
  padding: 0 0.25rem 0.375rem;
  border-bottom: 1.5px solid var(--ink);
}
.sig-x { font-family: var(--font-display); font-size: 1.125rem; line-height: 1.4; color: var(--muted); }
.sig-ink {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.date-ink { font-size: 1.0625rem; line-height: 1.6; white-space: nowrap; }
.sig-caption {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Actions */
.actions {
  display: grid;
  gap: 0.875rem;
  justify-items: start;
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--rule);
}
button { font: inherit; }
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
}
.primary { color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); }
.primary:hover { opacity: 0.86; }
.primary[disabled] { opacity: 0.6; cursor: progress; }
.secondary { color: var(--ink); background: transparent; border: 1px solid var(--field); }
.secondary:hover { background: var(--paper); }
.fine { margin: 0; max-width: 60ch; font-size: 0.8125rem; color: var(--muted); }
.send-error {
  margin: 0;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--alert);
  background: var(--alert-wash);
  border: 2px solid var(--alert);
  border-radius: 3px;
}

/* Result */
.result { padding: 0.5rem 1.25rem 2rem; }
.result h2 {
  font-weight: 400;
  font-size: clamp(1.5rem, 1.15rem + 1.8vw, 2rem);
  line-height: 1.15;
  color: var(--accent);
}
.result p { margin: 0.75rem 0 0; max-width: 65ch; }
.result .reference { font-size: 0.9375rem; color: var(--muted); }
.result .reference strong { margin-left: 0.375rem; color: var(--ink); font-size: 1.0625rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.recap-title { margin: 2rem 0 0; font-size: 1rem; font-weight: 700; }
.recap h4 {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.recap dl { margin: 0; border-top: 1px solid var(--rule); }
.recap .row { display: grid; gap: 0.125rem; padding: 0.625rem 0; border-bottom: 1px solid var(--rule); }
.recap dt { font-size: 0.875rem; color: var(--muted); }
.recap dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

@media (min-width: 36rem) {
  .brand { padding-top: 1.75rem; }
  .w3 { grid-column: span 3; }
  .w4 { grid-column: span 4; }
  .w5 { grid-column: span 5; }
  .w6 { grid-column: span 6; }
  .w8 { grid-column: span 8; }
  .signoff { grid-template-columns: minmax(0, 1fr) minmax(9rem, auto); align-items: end; }
  .primary, .secondary { width: auto; }
  .recap .row { grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; }
}
@media (min-width: 46rem) {
  .brand { padding: 2.25rem 2rem 2rem; }
  .brand img { width: 30rem; }
  .mode { top: 1.25rem; right: 1.5rem; }
  .page { padding-top: 2rem; }
  .masthead { padding: 2.25rem 2rem 2rem; }
  .noscript { padding-inline: 2rem; }
  .summary { margin-inline: 2rem; }
  .section { grid-template-columns: 10rem minmax(0, 1fr); gap: 2rem; padding: 2rem; }
  .rail { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .num { font-size: 2.5rem; }
  .actions { padding: 1.75rem 2rem 2.25rem 14rem; }
  .result { padding: 0.5rem 2rem 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
