/* Shared by every client page. Per-client values arrive as CSS variables:
   --brand (headings, bands, footer), --accent (buttons), --highlight (tints,
   icons), --display / --body (fonts), --radius / --radius-card (corners).
   Layouts follow the original Finit templates: First Commonwealth's join page
   (landing) and NSB's referral form (referral). */

:root {
  --ink: color-mix(in oklab, var(--brand) 40%, #000);
  --text: color-mix(in oklab, var(--brand) 12%, #2a2a2a);
  --muted: color-mix(in oklab, var(--brand) 10%, #5a5a5a);
  --tint: var(--tint-override, color-mix(in oklab, var(--brand) 7%, #fff));
  --soft: color-mix(in oklab, var(--brand) 4%, #f7f8fa);
  --line: color-mix(in oklab, var(--brand) 14%, #fff);
  --foot: color-mix(in oklab, var(--brand) 28%, #1f272c);
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 10px 30px -12px rgb(0 0 0 / .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--text-scale, 1)); -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--text); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* ---------- header: sticky; gains a title + button once scrolled ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / .97); border-bottom: 1px solid transparent; transition: border-color .2s ease, box-shadow .2s ease; }
.top.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgb(0 0 0 / .4); }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.top-logo img { height: 34px; width: auto; max-width: 220px; object-fit: contain; }
.top-title { display: none; font: 600 1.125rem/1.2 var(--display); color: var(--ink); }
.top-cta { margin-left: auto; min-height: 40px; padding: 8px 18px; }
.top-tabs { display: flex; gap: 4px; align-self: stretch; }
.top-tabs a {
  display: flex; align-items: center; padding: 0 14px; position: relative;
  font-weight: 600; font-size: .9375rem; color: var(--brand); text-decoration: none;
}
.top-tabs a::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--brand); transform: scaleX(0); transition: transform .2s ease; }
.top-tabs a:hover::after, .top-tabs a[aria-current="true"]::after { transform: scaleX(1); }
/* landing: tabs only appear once the header is stuck (desktop), replacing the logo with the title */
[data-top] .top-tabs { display: none; }
@media (min-width: 900px) {
  [data-top].is-stuck .top-logo { display: none; }
  [data-top].is-stuck .top-title { display: block; margin-right: 24px; }
  [data-top].is-stuck .top-tabs { display: flex; }
}
.top:not([data-top]) .top-tabs { margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 13px 26px;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: #fff;
  font: 700 1.0625rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: color-mix(in oklab, var(--accent) 85%, #000); text-decoration: none; }
.btn-sm { min-height: 42px; padding: 9px 18px; font-size: .9375rem; }
.btn-quiet { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-quiet:hover { background: var(--soft); }
.btn-on-brand { background: #fff; color: var(--brand); }
.btn-on-brand:hover { background: color-mix(in oklab, var(--brand) 8%, #fff); }
.cta-note { margin: 12px 0 0; font-size: .9375rem; color: var(--muted); }
.cta-note strong { color: var(--text); font-weight: 600; }

.offer-label { font: 700 .875rem/1.2 var(--body); letter-spacing: .02em; color: var(--brand); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.offer-label::before { content: ''; width: 24px; height: 3px; border-radius: 2px; background: var(--highlight); }
.offer-label.on-brand { color: #fff; }

/* ---------- landing hero: photo with the offer card over it ---------- */
.hero { position: relative; background: var(--tint); padding: 0 0 28px; }
/* phones: the photo gets its own strip, cropped on the subject, card tucked under it */
.hero::before { content: ''; display: block; height: min(72vw, 360px); background: var(--hero-img) var(--hero-pos, 70% 30%) / cover no-repeat; }
.hero .offer { margin-top: -36px; background: var(--tint); text-align: center; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.hero .offer-label { justify-content: center; }
.hero .cta-note { text-align: center; }
.offer {
  position: relative; background: #fff; border-radius: var(--radius-card);
  padding: clamp(24px, 4vw, 40px); max-width: 500px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 24px 48px -20px rgb(0 0 0 / .4);
}
.offer h1 { font-weight: 800; font-size: clamp(2rem, 4.4vw, 2.875rem); letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 16px; }
.lede { font-size: 1.0625rem; margin-bottom: 24px; }
.offer-cta .btn { width: 100%; }

/* ---------- steps ---------- */
.band { padding: 64px 0; }
.section-h { font-weight: 700; font-size: clamp(1.625rem, 3vw, 2.25rem); letter-spacing: -0.015em; margin-bottom: 40px; }
.section-h.center { margin-left: auto; margin-right: auto; max-width: 28ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; }
.step { text-align: center; max-width: 380px; margin: 0 auto; }
.steps-cards .step { max-width: none; background: #fff; border-radius: var(--radius-card); padding: 32px 24px; box-shadow: var(--shadow); }
.step-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 50%; background: var(--tint); color: var(--brand); }
.step-icon.solid { background: var(--brand); color: #fff; }
.step h3 { font-size: 1.25rem; margin-bottom: 8px; }
.step-n { color: var(--brand); }
.step p { color: var(--muted); }

/* ---------- photo + requirements / reasons ---------- */
.split { display: grid; background: var(--tint); }
.split-img { position: relative; min-height: 280px; }
.split-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split-body { padding: 48px 20px; }
.points { margin: 0; display: grid; gap: 22px; }
.points > div { padding-left: 18px; border-left: 3px solid var(--highlight); }
.points dt { font: 700 1.125rem/1.3 var(--display); color: var(--ink); margin-bottom: 4px; }
.points dd { margin: 0; }

/* ---------- closing banners ---------- */
.invite-band { padding: 72px 0; }
.invite-band h2 { font-weight: 800; font-size: clamp(1.75rem, 3.6vw, 2.5rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.invite-band p { font-size: 1.1875rem; color: var(--muted); margin-bottom: 28px; }
.brand-band { background: var(--brand); padding: 64px 0; }
.brand-band h2 { color: #fff; font-weight: 800; font-size: clamp(1.625rem, 3.4vw, 2.25rem); margin-bottom: 24px; }

/* ---------- footer (holds the terms, as on the original) ---------- */
.site-foot { background: var(--foot); color: rgb(255 255 255 / .82); padding: 56px 0 40px; font-size: .9375rem; }
.site-foot a { color: #fff; }
.terms h2 { color: #fff; font-size: 1.25rem; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid rgb(255 255 255 / .18); }
.terms h3 { color: #fff; font-size: 1rem; margin: 24px 0 10px; }
.terms ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 92ch; }
.terms + .foot-row { margin-top: 40px; padding-top: 28px; border-top: 1px solid rgb(255 255 255 / .18); }
.foot-row { display: grid; gap: 20px; }
.foot-contact { color: #fff; font-size: 1.0625rem; }
.foot-legal { display: flex; gap: 16px; align-items: center; }
.insurer { background: #fff; border-radius: 4px; padding: 4px; width: 96px; height: auto; flex: none; }
.powered { margin-top: 28px; font-size: .875rem; opacity: .75; }

/* ---------- referral page (NSB layout) ---------- */
.refer-hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; }
.refer-hero-img { height: 190px; background: center / cover no-repeat; }
.refer-hero-copy { padding: 36px 0 44px; max-width: 560px; }
.refer-hero h1 { color: #fff; font-weight: 800; font-size: clamp(2.125rem, 4.6vw, 3rem); letter-spacing: -0.02em; margin-bottom: 14px; }
.refer-hero .lede { color: rgb(255 255 255 / .9); margin: 0; }
.refer-main { background: var(--soft); padding: 40px 0 56px; }
.refer-grid { display: grid; gap: 24px; align-items: start; }
.info-blocks { display: grid; gap: 16px; order: 2; }
.info-block { background: #fff; border-radius: var(--radius-card); padding: 22px 24px; box-shadow: var(--shadow); }
.info-block h2 { font-size: 1.125rem; margin-bottom: 6px; }
.info-block p { color: var(--muted); font-size: 1rem; }
.refer-form { background: #fff; border-radius: var(--radius-card); padding: clamp(22px, 3.5vw, 32px); box-shadow: var(--shadow); }
.refer-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
.refer-form legend { font: 700 1.25rem/1.25 var(--display); color: var(--ink); padding: 0; margin-bottom: 6px; }
.legend-step { display: block; font: 400 .875rem/1.4 var(--body); color: var(--muted); margin-bottom: 4px; }
.js .refer-form fieldset:not(.is-active) { display: none; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: .9375rem; color: var(--ink); }
.field input {
  font: 400 1.0625rem/1.3 var(--body); color: var(--text); width: 100%;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1.5px solid color-mix(in oklab, var(--brand) 18%, #cfcfcf); background: #fff;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 20%, transparent); }
.field input[aria-invalid="true"] { border-color: #b3261e; }
.field-row { display: grid; gap: 14px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: .9375rem; align-items: start; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form-actions .btn:last-child { flex: 1; }
.form-error { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius); background: #fdecea; color: #8c1d18; font-size: .9375rem; }
.form-done { text-align: center; }
.form-done h2 { font-size: 1.5rem; margin-bottom: 8px; }
.form-done .btn { margin-top: 16px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- Finit Refer's own pages (directory, 404, ended) ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 700 1.25rem/1 var(--display); color: var(--ink); text-decoration: none; }
.page-hero { padding: 64px 0 24px; }
.page-hero h1 { font-weight: 800; font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.025em; line-height: 1.04; max-width: 18ch; margin-bottom: 18px; }
.page-hero .lede { max-width: 56ch; }
.offers { list-style: none; margin: 0; padding: 0; }
.offer-row { display: grid; gap: 16px; padding: 28px 0; border-top: 1px solid var(--line); align-items: center; }
.offer-row:last-child { border-bottom: 1px solid var(--line); }
.offer-logo { height: 42px; width: auto; max-width: 200px; object-fit: contain; object-position: left center; }
.offer-row h2 { font: 600 1rem/1.3 var(--body); color: var(--muted); margin-bottom: 4px; }
.offer-amt { font: 800 clamp(1.5rem, 3vw, 2rem)/1.1 var(--display); color: var(--ink); margin-bottom: 6px; }
.plain { padding-left: 1.2em; margin: 0 0 28px; }
.site-foot.slim { padding: 36px 0; }

/* FinIT Refer's own pages use finitloyalty.com's type scale. */
.fin { font-size: 1.125rem; line-height: 1.7; }
.fin h1, .fin h2, .fin h3 { font-weight: 600; letter-spacing: -0.02em; }
.fin .page-hero h1 { font-weight: 600; font-size: clamp(2.5rem, 6vw, 3.75rem); line-height: 1.1; max-width: 16ch; }
.fin .page-hero .lede { font-size: 1.125rem; color: var(--muted); }
.fin .offer-amt { font-weight: 600; letter-spacing: -0.02em; }
.fin .offer-row h2 { font-weight: 500; letter-spacing: 0; }
.fin .btn { font-weight: 600; }
.fin .page-hero + .band { padding-top: 16px; }

/* ---------- larger screens ---------- */
@media (max-width: 520px) {
  .top:not([data-top]) .top-tabs a:not(:first-child) { display: none; }
}
@media (min-width: 640px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .hero { padding: 72px 0; min-height: 540px; display: flex; align-items: center; background: var(--tint) var(--hero-img) var(--hero-pos, center) / cover no-repeat; }
  .hero::before { display: none; }
  .hero .offer { margin-top: 0; background: #fff; text-align: left; box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 24px 48px -20px rgb(0 0 0 / .4); }
  .hero .offer-label { justify-content: flex-start; }
  .hero .cta-note { text-align: left; }
  .hero > .wrap { width: 100%; }
  .offer-cta .btn { width: auto; }
  .band { padding: 88px 0; }
  .steps { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
  .split { grid-template-columns: 1fr 1fr; }
  .split-img { min-height: 440px; }
  .split-body { padding: 72px clamp(32px, 6vw, 88px); align-self: center; }
  .foot-row { grid-template-columns: 1fr 1fr; }

  .refer-hero { min-height: 300px; display: flex; align-items: center; }
  .refer-hero > .wrap { width: 100%; }
  .refer-hero-img {
    position: absolute; inset: 0 0 0 45%; height: auto;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%);
    mask-image: linear-gradient(90deg, transparent, #000 30%);
  }
  .refer-hero-copy { position: relative; padding: 64px 0; }
  .refer-main { padding: 56px 0 72px; }
  .refer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .info-blocks { order: 0; }
  .offer-row { grid-template-columns: 200px 1fr auto; gap: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .top { transition: none; }
}
