/* Reverse Mortgage California | HEI — the 9-step application (client portal + LOS embed).
   Layout follows the Splitero screens George saved; colours are the RMC brand. */
:root {
  --hei-navy: #1B365D;
  --hei-navy-2: #2a4974;
  --hei-ink: #1d2635;
  --hei-muted: #5a6678;
  --hei-line: #cfd5de;
  --hei-line-soft: #e7e2d9;
  --hei-ground: #faf6f0;
  --hei-panel: #fdf8f1;
  --hei-card: #ffffff;
  --hei-orange: #E8962E;
  --hei-cta: #c9670f;
  --hei-cta-hover: #b35a0a;
  --hei-cta-soft: #f6dcc0;
  --hei-pill: #fdeedc;
  --hei-pill-ink: #a8540a;
  --hei-good: #2f7d4f;
  --hei-good-bg: #eaf6ee;
  --hei-blue-bg: #eef1fb;
  --hei-blue-line: #c9d2f0;
  --hei-err: #b3261e;
  --hei-radius: 18px;
  --hei-shadow: 0 1px 2px rgba(27, 54, 93, .05), 0 8px 24px rgba(27, 54, 93, .07);
  --hei-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Los Angeles Mortgage Lender door: the LA navy and background, the green of the LA logo.
   Only the tokens change - every component reads them. */
[data-theme="laml"] {
  --hei-navy: #102130;
  --hei-navy-2: #23405a;
  --hei-orange: #3a7d0a;
  --hei-cta: #3a7d0a;
  --hei-cta-hover: #2f6608;
  --hei-cta-soft: #cfe3c2;
  --hei-pill: #e8f2df;
  --hei-pill-ink: #2f6608;
  --hei-ground: #f5f8f7;
  --hei-panel: #f1f6ee;
  --hei-line-soft: #e1e8e3;
  --hei-blue-bg: #eef4f8;
  --hei-blue-line: #c8d9e6;
}
[data-theme="laml"] .hei-logo img { height: 54px; }
[data-theme="laml"] .hei-btn-cta { box-shadow: 0 2px 6px rgba(58, 125, 10, .25); }
[data-theme="laml"] .hei-yn input:focus-visible { outline-color: rgba(58, 125, 10, .35); }

* { box-sizing: border-box; }
body.hei-body { margin: 0; background: var(--hei-ground); color: var(--hei-ink); font-family: var(--hei-font);
  font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* header (client portal) */
.hei-top { background: #fff; border-bottom: 1px solid var(--hei-line-soft); }
.hei-top-in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; }
.hei-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--hei-navy); }
.hei-logo img { height: 40px; width: auto; }
.hei-logo span { font-weight: 800; font-size: 18px; letter-spacing: .01em; border-left: 2px solid var(--hei-orange); padding-left: 10px; }
.hei-top-right { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 15px; }
.hei-top-right a { color: var(--hei-navy); font-weight: 700; text-decoration: none; }
.hei-linkbtn { background: none; border: 0; color: var(--hei-muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; padding: 4px; }

/* page grid */
.hei-page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; display: grid;
  grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.hei-page.is-embed { padding: 18px 18px 40px; max-width: none; }
@media (max-width: 900px) { .hei-page { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 40px; } }

/* main card */
.hei-card { background: var(--hei-card); border-radius: var(--hei-radius); box-shadow: var(--hei-shadow); overflow: hidden; }
.hei-card-body { padding: 30px 32px 26px; }
@media (max-width: 600px) { .hei-card-body { padding: 22px 18px 18px; } }
.hei-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.hei-title { margin: 0; color: var(--hei-navy); font-weight: 800; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; text-wrap: balance; }
.hei-pillstep { flex: 0 0 auto; background: var(--hei-pill); color: var(--hei-pill-ink); font-size: 12px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; border-radius: 6px; white-space: nowrap; }
.hei-sub { margin: 4px 0 18px; color: var(--hei-ink); max-width: 60ch; }

/* stepper (LOS only) */
.hei-stepper { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.hei-stepper button { border: 1px solid var(--hei-line); background: #fff; color: var(--hei-navy); border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 700; padding: 4px 11px; cursor: pointer; }
.hei-stepper button.on { background: var(--hei-navy); color: #fff; border-color: var(--hei-navy); }
.hei-stepper button.done { border-color: var(--hei-good); color: var(--hei-good); }

/* fields */
.hei-fields { display: flex; flex-direction: column; gap: 22px; }
.hei-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
@media (max-width: 600px) { .hei-row { grid-template-columns: 1fr; } }
.hei-field { display: flex; flex-direction: column; gap: 8px; max-width: 680px; }
.hei-field.narrow { max-width: 340px; }
.hei-label { font-weight: 700; color: var(--hei-navy); font-size: 16px; line-height: 1.4; }
.hei-label .opt { font-weight: 400; color: var(--hei-muted); }
.hei-input, .hei-select, .hei-textarea { width: 100%; font: inherit; font-size: 17px; color: var(--hei-ink); background: #fff;
  border: 1px solid var(--hei-line); border-radius: 7px; padding: 11px 15px; min-height: 50px; }
.hei-input:focus, .hei-select:focus, .hei-textarea:focus { outline: none; border-color: var(--hei-navy-2);
  box-shadow: 0 0 0 3px rgba(42, 73, 116, .15); }
.hei-input[disabled] { background: #f6f7f9; color: var(--hei-muted); }
.hei-select { appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231B365D' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.hei-textarea { min-height: 66px; resize: vertical; }
.hei-money { display: flex; max-width: 280px; border: 1px solid var(--hei-line); border-radius: 7px; overflow: hidden; background: #fff; }
.hei-money:focus-within { border-color: var(--hei-navy-2); box-shadow: 0 0 0 3px rgba(42, 73, 116, .15); }
.hei-money span { background: var(--hei-panel); color: var(--hei-ink); display: flex; align-items: center; padding: 0 16px; }
.hei-money span:first-child { border-right: 1px solid var(--hei-line); }
.hei-money span:last-child { border-left: 1px solid var(--hei-line); padding: 0 12px; }
.hei-money input { border: 0; outline: none; font: inherit; font-size: 17px; text-align: center; min-width: 0; flex: 1; padding: 11px 8px; min-height: 48px; }

/* yes / no */
.hei-yn { display: inline-flex; border: 1px solid var(--hei-navy); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.hei-yn label { display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; font-size: 16px; min-width: 80px; }
.hei-yn label + label { border-left: 1px solid var(--hei-navy); }
.hei-yn input { appearance: none; width: 20px; height: 20px; border: 1.5px solid #b8bfca; border-radius: 50%; margin: 0; display: grid; place-items: center; }
.hei-yn input:checked { border-color: var(--hei-cta); }
.hei-yn input:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--hei-cta); }
.hei-yn input:focus-visible { outline: 3px solid rgba(201, 103, 15, .35); outline-offset: 2px; }
.hei-yn label:has(input:checked) { background: var(--hei-panel); }

/* follow-up box */
.hei-panel { background: var(--hei-panel); border-radius: 10px; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; max-width: 680px; }
@media (max-width: 600px) { .hei-panel { padding: 16px; } }

/* banners */
.hei-offer { border-radius: 12px; padding: 16px 20px; margin: 0 0 22px; background: var(--hei-good-bg); color: var(--hei-ink); }
.hei-offer b { color: var(--hei-good); font-size: 22px; }
.hei-offer.soft { background: var(--hei-blue-bg); }
.hei-err { color: var(--hei-err); font-weight: 700; margin: 14px 0 0; }
.hei-consent { margin: 22px 0 0; font-size: 14px; color: var(--hei-muted); max-width: 70ch; line-height: 1.5; }
.hei-bullets { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.hei-bullets li { display: flex; gap: 10px; align-items: baseline; }
.hei-bullets li::before { content: "\2713"; color: var(--hei-good); font-weight: 800; }

/* footer */
.hei-foot { border-top: 1px solid var(--hei-line-soft); padding: 16px 18px; display: flex; gap: 12px; align-items: center; }
.hei-foot .sp { flex: 1; }
.hei-btn { font: inherit; font-size: 15px; font-weight: 800; border-radius: 6px; padding: 13px 24px; cursor: pointer;
  border: 1px solid var(--hei-line); background: #fff; color: var(--hei-ink); min-height: 48px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.hei-btn:hover { border-color: var(--hei-navy); }
.hei-btn:focus-visible { outline: 3px solid rgba(42, 73, 116, .3); outline-offset: 2px; }
.hei-btn-cta { background: var(--hei-cta); border-color: var(--hei-cta); color: #fff; box-shadow: 0 2px 6px rgba(201, 103, 15, .25); }
.hei-btn-cta:hover { background: var(--hei-cta-hover); border-color: var(--hei-cta-hover); }
.hei-btn-cta[disabled] { background: var(--hei-cta-soft); border-color: var(--hei-cta-soft); color: #8a6a50; box-shadow: none; cursor: not-allowed; }
.hei-btn-navy { background: var(--hei-navy); border-color: var(--hei-navy); color: #fff; }
.hei-btn-sm { padding: 7px 14px; min-height: 0; font-size: 14px; }
@media (max-width: 600px) { .hei-foot { flex-wrap: wrap; } .hei-foot .hei-btn-cta { flex: 1 1 100%; order: -1; } }

/* documents */
.hei-docs-head { display: grid; grid-template-columns: 1fr 160px; font-weight: 800; color: var(--hei-navy); padding: 0 4px 8px; }
.hei-doc { border: 1px solid var(--hei-line-soft); border-radius: 12px; padding: 18px 22px; display: grid;
  grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 14px; }
.hei-doc h4 { margin: 0 0 4px; font-size: 17px; color: var(--hei-navy); }
.hei-doc h4 em { font-style: normal; color: var(--hei-cta); font-weight: 700; }
.hei-doc p { margin: 0; font-size: 15px; color: var(--hei-ink); max-width: 48ch; }
.hei-doc .files { margin-top: 8px; font-size: 14px; color: var(--hei-good); display: flex; flex-direction: column; gap: 2px; }
.hei-doc .files a { color: var(--hei-navy); }
@media (max-width: 600px) { .hei-doc { grid-template-columns: 1fr; } .hei-docs-head { display: none; } }

/* final page */
.hei-next { display: grid; gap: 12px; margin: 18px 0 22px; padding: 0; list-style: none; counter-reset: n; }
.hei-next li { counter-increment: n; display: flex; gap: 14px; align-items: baseline; }
.hei-next li::before { content: counter(n) "."; color: var(--hei-orange); font-weight: 800; font-size: 19px; }
.hei-video { aspect-ratio: 16 / 9; width: 100%; max-width: 680px; border: 0; border-radius: 12px; background: #0e1a2c; margin: 6px 0 22px; }
.hei-contact { display: flex; flex-wrap: wrap; gap: 12px; }

/* aside cards */
.hei-aside { display: flex; flex-direction: column; gap: 22px; }
.hei-acard { background: #fff; border: 1px solid var(--hei-line-soft); border-radius: 12px; padding: 24px 22px; }
.hei-acard.lift { box-shadow: var(--hei-shadow); border-color: transparent; }
.hei-eyebrow { font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--hei-navy); margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.hei-amount { font-size: 30px; font-weight: 800; color: var(--hei-navy); margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.hei-note { background: var(--hei-blue-bg); border: 1px solid var(--hei-blue-line); border-radius: 8px; padding: 12px 15px; font-size: 14px; color: var(--hei-ink); line-height: 1.55; }
.hei-fees { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--hei-muted); }
.hei-offer .hei-fees { margin-top: 8px; }
.hei-asked { margin: -6px 0 12px; font-size: 15px; color: var(--hei-ink); }
.hei-addr { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--hei-navy); padding-bottom: 12px; border-bottom: 1px solid var(--hei-line-soft); margin: 0 0 12px; }
.hei-addr-l1 { font-weight: 700; font-size: 15px; }
.hei-addr-l2 { color: var(--hei-muted); font-size: 15px; }
.hei-adv { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.hei-adv img, .hei-adv .ini { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.hei-adv .ini { background: var(--hei-navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 26px; }
.hei-adv b { display: block; color: var(--hei-navy); font-size: 17px; }
.hei-adv span { font-size: 16px; }
.hei-advbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; margin-top: 12px;
  border: 1px solid var(--hei-cta); border-radius: 6px; color: var(--hei-cta-hover); background: #fff; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; font-family: inherit; }
.hei-advbtn:hover { background: var(--hei-pill); }
.hei-advbtn svg { width: 20px; height: 20px; }
.hei-staff { font-size: 14px; display: grid; gap: 6px; }
.hei-staff .row { display: flex; justify-content: space-between; gap: 10px; }
.hei-staff .row span { color: var(--hei-muted); }
.hei-staff .why { color: var(--hei-err); font-size: 13px; }

/* sign-in (coming back) */
.hei-signin { max-width: 520px; margin: 40px auto; }
.hei-code { letter-spacing: .4em; text-align: center; font-size: 26px; max-width: 260px; }

/* LOS start page */
.hei-los-wrap { background: var(--hei-ground); min-height: 100vh; padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 20px; }
.hei-los { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.hei-los-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.hei-los-head h1 { margin: 0; color: var(--hei-navy); font-size: 26px; font-weight: 800; }
.hei-los-head p { margin: 4px 0 0; color: var(--hei-muted); font-size: 14px; }
.hei-los-head p a { color: var(--hei-navy); }

/* the New HEI application button: the one thing on this page that must be found instantly */
.hei-newapp { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 24px 10px 10px;
  border: 0; border-radius: 14px; background: var(--hei-cta); color: #fff; font: inherit; font-size: 18px; font-weight: 800;
  letter-spacing: .01em; cursor: pointer; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 20px rgba(201, 103, 15, .30);
  transition: background-color .15s ease-out, transform .15s ease-out, box-shadow .15s ease-out; }
.hei-newapp .ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--hei-cta);
  display: grid; place-items: center; flex: 0 0 auto; transition: transform .2s ease-out; }
.hei-newapp:hover { background: var(--hei-cta-hover); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 12px 26px rgba(201, 103, 15, .36); }
.hei-newapp:active { transform: translateY(0); }
.hei-newapp:focus-visible { outline: 3px solid var(--hei-navy-2); outline-offset: 3px; }
.hei-newapp.open { background: var(--hei-navy); box-shadow: 0 8px 20px rgba(27, 54, 93, .25); }
.hei-newapp.open .ic { color: var(--hei-navy); transform: rotate(45deg); }
@media (max-width: 600px) { .hei-newapp { width: 100%; justify-content: center; } }

/* the "who is it for" box */
.hei-newbox { border: 2px solid var(--hei-orange); }
.hei-newbox h2 { margin: 0 0 14px; }
.hei-seg { display: inline-flex; border: 1px solid var(--hei-navy); border-radius: 10px; overflow: hidden; margin: 0 0 16px; }
.hei-seg button { border: 0; background: #fff; color: var(--hei-navy); font: inherit; font-size: 15px; font-weight: 700; padding: 10px 18px; cursor: pointer; }
.hei-seg button + button { border-left: 1px solid var(--hei-navy); }
.hei-seg button.on { background: var(--hei-navy); color: #fff; }
.hei-seg button:focus-visible { outline: 3px solid rgba(42, 73, 116, .35); outline-offset: -3px; }
@media (max-width: 1000px) { .hei-los { grid-template-columns: 1fr; } }
.hei-los h2 { margin: 0 0 6px; color: var(--hei-navy); font-size: 22px; }
.hei-los .hei-card-body { padding: 22px 24px; }
.hei-hint { color: var(--hei-muted); font-size: 14px; margin: 0 0 14px; }
.hei-results { margin-top: 12px; display: flex; flex-direction: column; border: 1px solid var(--hei-line-soft); border-radius: 10px; overflow: hidden; }
.hei-results:empty { display: none; }
.hei-res { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--hei-line-soft); font-size: 15px; }
.hei-res:first-child { border-top: 0; }
.hei-res .who { flex: 1; min-width: 0; }
.hei-res .who b { display: block; color: var(--hei-navy); }
.hei-res .who small { color: var(--hei-muted); }
.hei-chip { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #eef1f5; color: var(--hei-navy); }
.hei-chip.lead { background: var(--hei-pill); color: var(--hei-pill-ink); }
.hei-chip.submitted { background: var(--hei-good-bg); color: var(--hei-good); }
.hei-chip.hei-brand-rmc { background: #1B365D; color: #fff; }
.hei-chip.hei-brand-la { background: #3a7d0a; color: #fff; }
.hei-seg-brand button { font-size: 14px; }
.hei-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hei-table th { text-align: left; color: var(--hei-muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--hei-line-soft); }
.hei-table td { padding: 9px 8px; border-bottom: 1px solid var(--hei-line-soft); font-variant-numeric: tabular-nums; }
.hei-table tr.click { cursor: pointer; }
.hei-table tr.click:hover td { background: var(--hei-panel); }
.hei-tablewrap { overflow-x: auto; }
.hei-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.hei-grid2 > * { min-width: 0; }
.hei-grid2 .hei-money { max-width: none; }
@media (max-width: 600px) { .hei-grid2 { grid-template-columns: 1fr; } }
.hei-calc-res { margin-top: 18px; display: grid; gap: 12px; }
.hei-inv { border: 1px solid var(--hei-line-soft); border-radius: 12px; padding: 16px 18px; }
.hei-inv.ok { border-color: #bfe0cb; background: #f6fbf7; }
.hei-inv.no { background: #fcf5f4; border-color: #efd2cf; }
.hei-inv h3 { margin: 0 0 6px; font-size: 16px; color: var(--hei-navy); display: flex; gap: 8px; align-items: center; }
.hei-inv .big { font-size: 26px; font-weight: 800; color: var(--hei-navy); font-variant-numeric: tabular-nums; }
.hei-inv ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.hei-los-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px 0; }
.hei-los-bar .lnk { font-size: 13px; color: var(--hei-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.hei-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--hei-navy); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 15px; z-index: 50; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
