/* ==========================================================================
   LoanRival — styles.css
   Dark fintech-marketplace design keyed to the logo: electric blue + signal
   green on near-black. AA-verified pairs on dark backgrounds.
   ========================================================================== */

:root {
  --bg: #07090D;
  --bg-2: #0D1119;
  --panel: #111623;
  --ink: #E9EEF6;        /* 15.6:1 on bg */
  --ink-soft: #A6B2C4;   /* 8.4:1 */
  --blue: #6D8DFF;       /* links/accents — 6.4:1 on bg */
  --blue-deep: #3D5EE0;
  --green: #3BE06B;      /* CTA — ink #07240F on it 9.8:1 */
  --green-ink: #07240F;
  --alert: #FFB35C;      /* 9.5:1 on bg */
  --line: #232B3C;
  --focus: #FFD166;

  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-mono: "DM Mono", Consolas, Menlo, monospace;

  --measure: 66ch;
  --r-lg: 16px; --r-md: 10px; --r-sm: 7px;
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem; --s6: 6rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 1.06rem; line-height: 1.66; color: var(--ink); background: var(--bg); }
img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .55em; color: #fff; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 1.95rem); }
h3 { font-family: var(--font-body); font-weight: 800; font-size: 1.18rem; }
h4 { font-family: var(--font-body); font-weight: 800; font-size: 1.02rem; }
p, ul, ol, dl { margin: 0 0 1em; max-width: var(--measure); }
li { margin-bottom: .35em; }
a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #9DB4FF; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
a:focus-visible, button:focus-visible { text-decoration: none; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--green); color: var(--green-ink); padding: .75rem 1.25rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 800; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.container { max-width: 72rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.narrow { max-width: 48rem; }
.section { padding-block: var(--s6); }
.band { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-header { max-width: 48rem; margin-bottom: var(--s4); }
.tag { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--green); margin-bottom: var(--s1); }

/* ---------- Header ---------- */
.site-header { background: rgba(7,9,13,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: var(--s3); padding-block: .8rem; }
.brand { display: flex; align-items: center; margin-right: auto; }
.brand img { height: 40px; width: auto; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .6rem .9rem; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; min-height: 44px; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.35rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-block; padding: .55rem .1rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .96rem; }
.site-nav a:hover { color: var(--green); }

.cta { display: inline-block; background: var(--green); color: var(--green-ink); font-weight: 800; text-decoration: none; padding: .85rem 1.6rem; border-radius: var(--r-md); border: 2px solid var(--green); min-height: 44px; cursor: pointer; font-size: 1rem; font-family: var(--font-body); }
.cta:hover { background: #5BEB84; border-color: #5BEB84; color: var(--green-ink); }
.cta-line { background: transparent; color: var(--ink); border-color: var(--line); }
.cta-line:hover { border-color: var(--green); color: var(--green); background: transparent; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s6); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(52rem 26rem at 85% -10%, rgba(61,94,224,.28), transparent 60%),
  radial-gradient(40rem 22rem at 0% 110%, rgba(59,224,107,.14), transparent 60%);
  pointer-events: none; }
.hero > .container { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s5); align-items: center; }
.hero .lede { font-size: 1.22rem; color: var(--ink-soft); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.hero-note { font-size: .86rem; color: var(--ink-soft); margin-top: var(--s2); }

/* Offer board (hero visual) */
.board { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); }
.board h2 { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--s2); }
.board-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); padding-block: .7rem; border-bottom: 1px dashed var(--line); }
.board-row:last-of-type { border-bottom: 0; }
.board-row .k { font-weight: 700; }
.board-row .v { font-family: var(--font-mono); color: var(--green); font-size: 1.02rem; white-space: nowrap; }
.board .fineprint { font-size: .8rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: var(--s2); margin: var(--s2) 0 0; }

/* ---------- Steps / cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: var(--s3); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); }
.card h3 { margin-top: 0; color: #fff; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.step-n { font-family: var(--font-mono); color: var(--blue); font-size: 1rem; display: block; margin-bottom: .4rem; }

/* Big numbers */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); }
.fig .n { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.5rem); color: var(--green); display: block; }
.fig .l { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

/* Callouts */
.note { border: 1px solid var(--line); border-left: 4px solid var(--blue); background: var(--panel); border-radius: 0 var(--r-md) var(--r-md) 0; padding: var(--s2) var(--s3); max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }
.note-warn { border-left-color: var(--alert); }

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); margin-bottom: var(--s1); max-width: 48rem; }
.faq summary { cursor: pointer; font-weight: 800; padding: .95rem 1.15rem; list-style-position: inside; }
.faq summary:hover { color: var(--green); }
.faq details > div { padding: 0 1.15rem 1rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Forms (dark) ---------- */
.form-shell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2.5rem); max-width: 50rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s3); }
.form-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: var(--s2); }
.form-field.full { grid-column: 1 / -1; }
label { font-weight: 700; font-size: .97rem; }
.hint { font-size: .87rem; color: var(--ink-soft); margin: 0; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: #0A0E16;
  border: 1.5px solid #3A4560; border-radius: var(--r-sm);
  padding: .68rem .8rem; min-height: 44px; width: 100%;
}
select option { background: #0A0E16; color: var(--ink); }
textarea { min-height: 7rem; resize: vertical; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: #FF8A5C; border-width: 2px; }
.error-text { color: #FF9E76; font-weight: 700; font-size: .9rem; }
.required-mark { color: #FF9E76; }
.consent-box { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); margin-bottom: var(--s2); background: #0A0E16; }
.consent-box.optional-consent { border-style: dashed; }
.consent-check { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.consent-check input[type="checkbox"] { width: 24px; height: 24px; margin-top: .15rem; accent-color: var(--green); }
.consent-check label { font-weight: 500; font-size: .93rem; color: var(--ink-soft); }
.consent-note { font-size: .85rem; color: var(--ink-soft); margin: .6rem 0 0; }
.error-summary { border: 2px solid #FF8A5C; border-radius: var(--r-md); background: #1C1210; padding: var(--s2) var(--s3); margin-bottom: var(--s3); }
.error-summary h2 { font-family: var(--font-body); font-weight: 800; font-size: 1.05rem; margin-bottom: .4em; color: var(--ink); }
.error-summary ul { margin-bottom: 0; }
.error-summary a { color: #FF9E76; font-weight: 700; }
[hidden] { display: none !important; }
.tel-wrap { display: flex; align-items: center; gap: .5rem; }
.tel-wrap .tel-prefix { font-weight: 700; color: var(--ink-soft); }
.tel-wrap input { flex: 1; }

/* ---------- Footer ---------- */
.site-footer { background: #050608; border-top: 1px solid var(--line); margin-top: var(--s6); color: var(--ink-soft); }
.site-footer a { color: var(--blue); }
.footer-grid { display: grid; grid-template-columns: 2.1fr 1fr; gap: var(--s4); padding-block: var(--s5) var(--s3); }
.footer-grid h2 { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: var(--s3); font-size: .88rem; }
.footer-bottom p { max-width: none; }

/* ---------- Legal pages (readable on dark) ---------- */
.legal-page h1, .legal-page h2 { color: #fff; }
.legal-page h2 { margin-top: var(--s4); }
.legal-meta { font-family: var(--font-mono); font-size: .84rem; color: var(--ink-soft); }
mark { background: #4A3A00; color: var(--ink); padding: .05em .2em; }

/* ---------- Motion & prefs ---------- */
@media (prefers-reduced-motion: no-preference) {
  a, .cta, .site-nav a, input, select, textarea { transition: color 130ms ease, background-color 130ms ease, border-color 130ms ease; }
  html:focus-within { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .cta, .board-row .v { forced-color-adjust: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s3); }
  .form-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; gap: 0; padding-block: var(--s1); }
  .site-nav a { display: block; padding: .7rem .25rem; min-height: 44px; }
  .no-js .nav-toggle { display: none; }
  .no-js .site-nav { display: block; }
}
@media (max-width: 480px) {
  .hero-ctas .cta { width: 100%; text-align: center; }
}
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .hero-ctas, .nav-toggle { display: none; }
}

/* ---------- Endorsement video ---------- */
.video-wrap { max-width: 60rem; }
.endorse-video { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: var(--r-lg); display: block; }
.video-disclosure { font-size: .82rem; color: var(--ink-soft); margin-top: var(--s2); max-width: none; }

/* ---------- Multi-step form ---------- */
.steps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0 0 var(--s4); padding: 0; counter-reset: none; }
.steps li { display: flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; }
.steps li[aria-current="step"] { color: var(--green); border-color: var(--green); }
.steps li.done { color: var(--ink); border-color: var(--ink-soft); }
.steps-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); border: 1px solid currentColor; font-size: .78rem; }
.step legend { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: #fff; padding: 0; margin-bottom: var(--s3); }
.step { border: 0; padding: 0; margin: 0; }
.step-nav { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); }
.hint-inline { font-weight: 500; color: var(--ink-soft); font-size: .85rem; }

.secure-note { border: 1px solid var(--green); background: rgba(59,224,107,.08); border-radius: var(--r-md); padding: var(--s2) var(--s3); margin-bottom: var(--s3); font-size: .93rem; }
.secure-note strong { color: var(--green); }

.more-fields { border: 1px dashed var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); margin-top: var(--s2); }
.more-fields summary { cursor: pointer; font-weight: 700; }

.authorization { max-height: 15rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: #0A0E16; padding: var(--s3); margin-bottom: var(--s3); font-size: .88rem; color: var(--ink-soft); }
.authorization p { max-width: none; }
.authorization strong { color: var(--ink); }

.sign-area { margin-top: var(--s3); }
#sig-pad { width: 100%; max-width: 600px; height: 180px; background: #fff; border: 2px solid #3A4560; border-radius: var(--r-sm); touch-action: none; cursor: crosshair; display: block; }
.sign-row { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); max-width: 600px; }

/* PDF-ready fallback msg */
.gen-status { margin-top: var(--s2); font-size: .9rem; color: var(--green); }
.gen-status.err { color: #FF9E76; }

@media (max-width: 560px) {
  .sign-row { flex-direction: column; align-items: stretch; }
}

/* ---------- Endorsement reveal card ---------- */
.endorse { max-width: 60rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--panel), #0A0E16); overflow: hidden; }
.endorse-card { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); cursor: pointer; list-style: none; }
.endorse-card::-webkit-details-marker { display: none; }
.endorse-thumb { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--green); flex-shrink: 0; object-fit: cover; }
.endorse-copy { display: flex; flex-direction: column; gap: .2rem; margin-right: auto; }
.endorse-kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--green); }
.endorse-line { font-size: 1.12rem; color: var(--ink); line-height: 1.3; }
.endorse-line strong { color: #fff; }
.endorse-play { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: var(--green-ink); flex-shrink: 0; transition: transform 140ms ease; }
.endorse-card:hover .endorse-play { transform: scale(1.06); }
.endorse-card:hover .endorse-line strong { color: var(--green); }
.endorse[open] .endorse-play svg { opacity: .6; }
.endorse-reveal { padding: 0 var(--s3) var(--s3); }
.endorse-video { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-md); display: block; }
.video-disclosure { font-size: .8rem; color: var(--ink-soft); margin: var(--s2) 0 0; max-width: none; }
@media (max-width: 560px) {
  .endorse-card { flex-wrap: wrap; }
  .endorse-copy { margin-right: 0; }
}

/* ---------- Document dropzone ---------- */
.doc-block { border: 1px solid var(--line); border-radius: var(--r-md); background: #0A0E16; padding: var(--s3); margin-bottom: var(--s3); }
.doc-title { margin: 0 0 .3rem; color: #fff; }
.dropzone { border: 2px dashed #3A4560; border-radius: var(--r-md); background: var(--panel); padding: var(--s4) var(--s3); text-align: center; cursor: pointer; color: var(--ink-soft); transition: border-color 130ms ease, background 130ms ease; margin-top: var(--s2); }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--green); color: var(--ink); }
.dropzone.dragover { border-color: var(--green); background: rgba(59,224,107,.08); color: var(--ink); }
.dz-icon { color: var(--green); margin-bottom: .4rem; }
.dz-text { margin: 0; max-width: none; }
.dz-browse { color: var(--green); text-decoration: underline; }
.doc-list { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: .6rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .8rem; margin-bottom: .5rem; font-size: .92rem; }
.doc-list .doc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list .doc-size { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft); }
.doc-list .doc-remove { background: none; border: 1px solid var(--line); color: var(--ink-soft); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 1rem; line-height: 1; }
.doc-list .doc-remove:hover { border-color: #FF8A5C; color: #FF9E76; }
.doc-list li.uploading { border-color: var(--blue); }
.doc-list li.done { border-color: var(--green); }
.doc-list li.failed { border-color: #FF8A5C; }
.doc-list .doc-state { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.doc-list li.done .doc-state { color: var(--green); }
.doc-list li.failed .doc-state { color: #FF9E76; }
.doc-secure { margin: var(--s2) 0 0; }
.doc-error { color: #FF9E76; font-weight: 700; font-size: .9rem; margin: .5rem 0 0; }
