/* Lending Sphere theme — Beacon Brand Guidelines v1.2 + Tributary/CLG centered layout.
   Colors: Sphere Navy #355176 (primary), Sphere Green #8CBE41 (accents/borders & secondary button bg with Ink text),
   Ink #1D1E20 (text), Soft Cloud #EAF0F8 (section panels), Rule #C8D6E8 (card/section lines).
   Type: Nunito (headings, buttons, labels) + Lato (body, forms, legal), self-hosted woff2. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/nunito-700.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/nunito-800.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/lato-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/lato-700.woff2") format("woff2"); }

:root {
  --brand-font: "Lato", "Segoe UI", Helvetica, Arial, sans-serif;
  --heading-font: "Nunito", "Trebuchet MS", Verdana, Arial, sans-serif;
  --navy: #355176;
  --navy-dark: #263d5a;
  --green: #8cbe41;
  --green-dark: #7aab33;
  --brand-primary: var(--navy);
  --brand-primary-dark: var(--navy-dark);
  --brand-accent: var(--navy);   /* links are Navy, underlined */
  --brand-tint: #eaf0f8;         /* Soft slate-tinted Cloud */
  --ink: #1d1e20;
  --ink-muted: #454b52;          /* >8:1 on white, >7:1 on #eaf0f8 */
  --line: #c8d6e8;               /* Card and section border */
  --field-line: #355176;         /* form fields need >=3:1, so Navy */
  --bg: #ffffff;
  --footer-bg: #355176;
  --error: #b42318;
  --error-bg: #fdf0ef;
  --ok-bg: #efefef;
  --ok-line: var(--navy);
  --ph-bg: #fff7d6;
  --ph-line: #c9a227;
  --focus: #355176;
  /* Strict 4-size scale (CA DRE Reg. 2773 / 2847.3(b)):
     Footer/fine print use --fs-sm (15px), the smallest size anywhere on the site. */
  --fs-sm: 0.9375rem;   /* 15px: footer, hints, tagline badge */
  --fs-base: 1.0625rem; /* 17px: body, buttons, labels, table cells */
  --fs-lg: 1.375rem;    /* 22px: h2 / card h3 */
  --fs-xl: 1.875rem;    /* 30px: h1 (36px desktop) */
  --radius: 8px;
  --card-radius: 12px;
  --wrap: 72rem;
  --shadow-sm: 0 4px 14px rgba(38, 61, 90, 0.06);
}
@media (min-width: 48rem) { :root { --fs-xl: 2.25rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--brand-font); font-size: var(--fs-base); line-height: 1.6; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
h1, h2, h3, .btn, label, legend, .logo, .nav-toggle, .site-nav a, .steps li::before, th { font-family: var(--heading-font); }
h1, h2, h3 { color: var(--brand-primary); line-height: 1.25; margin: 0 0 0.55em; text-wrap: balance; }
h1 { font-size: var(--fs-xl); font-weight: 800; }
h2 { font-size: var(--fs-lg); font-weight: 700; margin-top: 1.4em; }
h3 { font-size: var(--fs-lg); font-weight: 700; margin-top: 1em; }
p, ul, ol { margin: 0 0 1em; }
p { text-wrap: pretty; }
.page-head p,
.sec-sub,
.hero .lead,
.callout-block p,
.card p,
.steps p,
.disclosure-grid p,
.site-footer > .wrap > p {
  text-wrap: balance;
}
a { color: var(--brand-accent); text-underline-offset: 3px; }
a:hover { color: var(--brand-primary-dark); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.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; }
.skip-link { position: absolute; left: 0.5rem; top: -4rem; background: var(--brand-primary); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius); z-index: 100; font-weight: 700; }
.skip-link:focus { top: 0.5rem; color: #fff; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header { background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, 0.14); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(29, 30, 32, 0.12); }
.site-header :focus-visible { outline-color: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5.25rem; padding: 0.55rem 0; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: #fff; font-weight: 700; font-size: var(--fs-lg); padding: 0.35rem 0.75rem 0.35rem 0; margin-left: 0; }
.logo img { display: block; height: 4.35rem; width: auto; }
.nav-toggle { display: none; font: inherit; font-size: var(--fs-base); font-weight: 700; color: #fff; background: var(--navy-dark); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius); padding: 0.5rem 0.95rem; cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; align-items: center; }
.site-nav a { color: rgba(255, 255, 255, 0.92); text-decoration: none; font-weight: 700; padding: 0.45rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.85); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.site-nav a.btn { background: #fff; border-color: #fff; color: var(--navy); padding: 0.55rem 1.15rem; text-decoration: none; min-height: 2.65rem; }
.site-nav a.btn:hover, .site-nav a.btn[aria-current="page"] { background: #e6eef8; border-color: #e6eef8; color: var(--navy-dark); text-decoration: none; }
.js .nav-toggle { display: none; }
@media (max-width: 56rem) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.open { display: block; }
  .header-row { flex-wrap: wrap; }
  .site-nav { width: 100%; padding: 0.15rem 0 0.75rem; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding-left: 0.35rem; padding-right: 0.35rem; }
  .site-nav li { border-top: 1px solid rgba(255, 255, 255, 0.16); }
  .site-nav a { display: block; padding: 0.75rem 0.85rem; }
  .site-nav a.btn { margin-top: 0.75rem; text-align: center; }
}

/* Buttons (8px radius, centered flex alignment) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-family: var(--heading-font); font-size: var(--fs-base); font-weight: 700; line-height: 1.3;
  text-align: center; text-decoration: none; border-radius: var(--radius);
  padding: 0.78rem 1.45rem; min-height: 2.85rem;
  border: 2px solid var(--brand-primary); background: var(--brand-primary); color: #fff;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); color: #fff; }
.btn-secondary { background: var(--green); border-color: var(--green); color: var(--ink); }
.btn-secondary:hover { background: var(--green-dark); border-color: var(--green-dark); color: var(--ink); }
.btn-outline { background: #fff; border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-outline:hover { background: var(--brand-tint); border-color: var(--brand-primary-dark); color: var(--brand-primary-dark); }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.85rem; margin: 1.5rem 0 0; }
@media (max-width: 32rem) { .btn-row .btn { width: 100%; } }
.section-cta { text-align: center; margin: 1.75rem 0 0; }

/* Hero & Page Headers (Centered Tributary/CLG layout) */
main { display: block; }
.hero {
  background-color: #eaf1f8;
  background-image: radial-gradient(120% 100% at 50% 0%, #e3ecf7 0%, #edf2f9 62%, #f4f7fb 100%);
  border-bottom: 1px solid #c8d6e8;
  padding: 2.85rem 0 2.75rem;
  text-align: center;
}
.hero h1 { max-width: 24ch; margin: 0 auto 0.65rem; }
.hero p.lead { max-width: 40rem; margin: 0 auto; color: var(--ink-muted); }

.page-head {
  background-color: #eaf1f8;
  background-image: radial-gradient(120% 100% at 50% 0%, #e3ecf7 0%, #edf2f9 62%, #f4f7fb 100%);
  border-bottom: 1px solid #c8d6e8;
  padding: 2.35rem 0 2.1rem;
  text-align: center;
}
.page-head h1 { max-width: 28ch; margin: 0 auto 0.5rem; }
.page-head p { max-width: 38rem; margin: 0 auto; color: var(--ink-muted); }

/* Sections & Section Headers */
.section { padding: 3.15rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--brand-tint); }
.section > .wrap > h2:first-child { margin-top: 0; text-align: center; }
.sec-head { text-align: center; max-width: 44rem; margin: 0 auto 2rem; }
.sec-head:last-child { margin-bottom: 0; }
.sec-head h2 { margin: 0 0 0.6rem; }
.sec-head .sec-sub { margin: 0 auto 0.85rem; color: var(--ink-muted); max-width: 40rem; }
.sec-head .sec-sub:last-child { margin-bottom: 0; }
.prose { max-width: 46rem; margin-left: auto; margin-right: auto; }

/* Grids & Equal-Height Cards */
.grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 44rem) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 58rem) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  border: 1px solid #c8d6e8;
  border-radius: var(--card-radius);
  padding: 1.75rem 1.6rem;
  background: #f4f7fc;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.section:not(.section-alt) .card {
  background: #f4f7fc;
  border-color: #c8d6e8;
}
.section-alt .card {
  background: #ffffff;
  border-color: #c8d6e8;
  box-shadow: 0 4px 14px rgba(38, 61, 90, 0.06);
}
.card h2, .card h3 { margin-top: 0; font-size: var(--fs-lg); }
.card > p:last-child, .card > ul:last-child, .card > div:last-child { margin-bottom: 0; }

/* Center content inside multi-column feature & person cards */
.grid-3 > .card,
.person-card {
  text-align: center;
  align-items: center;
}
.person-card .verify-links {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  width: 100%;
}

/* Soft slate-tinted callout / note block */
.callout-block {
  background: #eaf0f8;
  border: 1px solid #c8d6e8;
  border-radius: var(--card-radius);
  padding: 1.75rem;
  max-width: 46rem;
  margin: 2.25rem auto 0;
  text-align: center;
}
.section > .wrap > .callout-block:first-child {
  margin-top: 0;
}
.callout-block p {
  color: var(--ink-muted);
}
.apply-panel {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
  align-items: center;
}
.hint-after-btn {
  margin-top: 0.75rem;
  color: var(--ink-muted);
}

/* Steps: 3-column x 2-row equal-height card grid on How It Works (no green top border) */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}
@media (min-width: 44rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 58rem) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li {
  counter-increment: step;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
}
.steps li::before {
  content: counter(step);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.85rem;
  flex: none;
}
.steps h3 { margin: 0 0 0.5rem; font-size: var(--fs-lg); }
.steps p { margin: 0; color: var(--ink-muted); }

/* Checklist cards */
.checklist-card {
  text-align: left;
  align-items: stretch;
}
.checklist-card h3 {
  padding-bottom: 0.65rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.checklist {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.checklist li {
  position: relative;
  padding-left: 1.65rem;
  margin-bottom: 0.55rem;
}
.checklist li:last-child { margin-bottom: 0; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.48rem;
  width: 0.85rem;
  height: 0.45rem;
  border-left: 3px solid var(--navy);
  border-bottom: 3px solid var(--navy);
  transform: rotate(-45deg);
}

/* Contact list & Credential strip: Open, borderless 3-column grid with subtle bottom hairlines */
.contact-list,
.cred-strip {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 64rem;
  display: grid;
  gap: 1.5rem 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 44rem) {
  .contact-list, .cred-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 58rem) {
  .contact-list, .cred-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.contact-list li,
.cred-strip li {
  display: block;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 1.25rem;
  text-align: center;
  margin: 0;
}
.contact-list strong,
.cred-strip strong {
  display: block;
  font-family: var(--heading-font);
  color: var(--brand-primary);
  margin-bottom: 0.2rem;
}
.contact-aside {
  background: var(--brand-tint);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 1.75rem 1.5rem;
}
.contact-aside .contact-list {
  display: block;
}
.contact-aside .contact-list li {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
  text-align: left;
}
.contact-aside .contact-list li:first-child { padding-top: 0; }
.contact-aside .contact-list li:last-child { border-bottom: 0; margin-bottom: 0.5rem; }

.license-line { color: var(--ink-muted); font-weight: 700; }

/* Tables & Licensing (unboxed clean layout) */
.table-wrap { max-width: 58rem; margin: 0 auto 2.5rem; }
.table-foot { margin: 0.65rem 0 0; color: var(--ink-muted); text-align: center; font-weight: 700; }
.disclosure-grid {
  max-width: 58rem;
  margin: 0 auto 0.5rem;
  gap: 2rem 3rem;
}
.disclosure-grid > div {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.disclosure-grid h2 {
  margin-top: 0;
}
table { border-collapse: collapse; width: 100%; margin: 0 0 0.75rem; background: #fff; }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 0.9rem; border: 1px solid var(--line); }
th { background: var(--brand-tint); color: var(--brand-primary); font-weight: 700; }
.table-scroll { overflow-x: auto; width: 100%; }

/* Placeholder marks */
.ph { background: var(--ph-bg); border: 1px dashed var(--ph-line); border-radius: 4px; padding: 0 0.3em; }
p.ph, div.ph { display: block; padding: 0.6rem 0.9rem; }

/* Notices */
.notice { border-left: 5px solid var(--navy); background: var(--brand-tint); padding: 1rem 1.25rem; border-radius: var(--radius); margin: 0 0 1.25rem; width: 100%; text-align: left; }
.notice p:last-child { margin-bottom: 0; }
.notice h2 { margin-top: 0; }
.notice-ok { border-left-color: var(--navy); background: var(--ok-bg); }
.ext-url { word-break: break-all; color: var(--ink-muted); }

/* Form & Request a Call layout */
.form-layout { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 58rem) { .form-layout { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); } }
form { max-width: 100%; }
.field { margin: 0 0 1.25rem; }
label, legend { display: block; font-weight: 700; margin-bottom: 0.35rem; color: var(--ink); }
.req { color: var(--error); font-weight: 700; }
.opt { font-weight: 400; color: var(--ink-muted); }
.hint { font-size: var(--fs-sm); color: var(--ink-muted); margin: -0.15rem 0 0.4rem; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  display: block; width: 100%; font: inherit; font-size: var(--fs-base); color: var(--ink); background: #fff;
  border: 1px solid var(--field-line); border-radius: var(--radius); padding: 0.65rem 0.75rem; min-height: 2.9rem;
}
textarea { min-height: 7rem; resize: vertical; }
select { appearance: auto; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--brand-primary); }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; width: 100%; }
.choices { display: grid; gap: 0.45rem; }
.choice, .consent .choice { display: flex; align-items: flex-start; gap: 0.6rem; font-family: var(--brand-font); font-weight: 400; font-size: var(--fs-base); margin: 0; }
.choice input { width: 1.25rem; height: 1.25rem; margin: 0.2rem 0 0; flex: none; accent-color: var(--brand-primary); }
.consent { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.95rem 1.05rem; background: var(--brand-tint); }
[aria-invalid="true"] { border-color: var(--error) !important; box-shadow: 0 0 0 1px var(--error); }
.field-error { color: var(--error); font-weight: 700; margin: 0.35rem 0 0; font-size: var(--fs-base); }
.field-error:empty { display: none; }
.error-summary { border: 2px solid var(--error); background: var(--error-bg); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.error-summary h2 { color: var(--error); margin: 0 0 0.5rem; font-size: var(--fs-lg); }
.error-summary ul { margin: 0; padding-left: 1.25rem; }
.error-summary a { color: var(--error); font-weight: 700; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-note { max-width: 40rem; color: var(--ink-muted); }
.label-like { font-family: var(--heading-font); font-weight: 700; margin: 0 0 0.35rem; color: var(--ink); }
.cf-turnstile { min-height: 65px; }

/* Legal pages */
.legal { max-width: 50rem; margin: 0 auto; }
.legal h2 { margin-top: 1.6em; padding-top: 0.85em; border-top: 1px solid var(--line); }
.legal h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.legal .table-scroll { max-width: none; }
.legal th, .legal td { font-size: var(--fs-base); }
.legal td p { margin: 0; }

/* Responsive stacked tables on mobile */
@media (max-width: 40rem) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
  table.stack td { border: 0; border-bottom: 1px solid var(--line); padding: 0.55rem 0.75rem; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before { content: attr(data-label); display: block; font-family: var(--heading-font); font-weight: 700; color: var(--brand-primary); }
}

/* Footer: Navy band, reversed logo, White text, HUD EHO logo in white. Every line uses --fs-sm. */
.site-footer { background: var(--footer-bg); color: #fff; border-top: 1px solid #263d5a; padding: 2.5rem 0 2.75rem; margin-top: 0; font-size: var(--fs-sm); line-height: 1.65; }
.site-footer p { margin: 0 0 0.75rem; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:hover { color: #fff; text-decoration-thickness: 2px; }
.site-footer :focus-visible { outline-color: #fff; }
.footer-logo { margin: 0 0 1.25rem; padding: 0.25rem 0; }
.footer-logo img { display: block; height: 3.5rem; width: auto; }
.eho-line { display: flex; align-items: center; gap: 0.65rem; }
.eho-line img { width: auto; height: 2.25rem; flex: none; }
.mt0 { margin-top: 0; }
@media (min-width: 48rem) { .nowrap { white-space: nowrap; } }

/* Recovery/TEST deploy marker only (class emitted when LS_RECOVERY_TEST=1). CSP style-src is 'self' — no inline styles. */
.ls-recovery-banner {
  background: #7a1f1f;
  color: #fff;
  text-align: center;
  padding: 0.65rem 1rem;
  font-family: var(--brand-font);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.4;
}
