/* ==========================================================================
   LEXcelerate Mortgage Offer Report demo
   Brand: ink #10071F, accent #3D2A9E, Fraunces headings, Hanken Grotesk body.
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces_600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/HankenGrotesk_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/HankenGrotesk_500Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/HankenGrotesk_600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/HankenGrotesk_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
    --ink: #10071F;
    --accent: #3D2A9E;
    --muted: #4A4458;
    --muted-2: #5A5568;
    --rule: #D6D1E4;
    --tint: #F4F2FA;
    --canvas: #EEECF3;
    --warn-ink: #6B3A00;
    --warn-bg: #FFF9F0;
    --warn-rule: #EBCB97;
    --attn-ink: #3D2A9E;
    --serif: "Fraunces", Georgia, serif;
    --sans: "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--canvas); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */

.topbar { background: var(--ink); color: #fff; }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-partner { height: 40px; width: auto; display: block; margin-left: 4px; }
.brand-tag { font-size: 13px; color: #C9C2E8; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: #E4E0F2; text-decoration: none; padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.nav a:hover { background: #241A3A; color: #fff; }
.nav a.active { background: #fff; color: var(--ink); }

.page { max-width: 1240px; margin: 0 auto; padding: 40px 24px 80px; }
.page-narrow { max-width: 820px; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.page-title { font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.1; margin: 8px 0 12px; }
.lede { font-size: 17px; color: var(--muted); max-width: 640px; margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; font: 600 14px var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #241A3A; color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--rule); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-link { background: none; border: none; padding: 10px 4px; color: var(--accent); }
.btn svg { width: 18px; height: 18px; }

.banner { padding: 14px 18px; border-radius: 10px; margin: 24px 0 0; font-size: 14px; }
.banner-info { background: #fff; border: 1px solid var(--rule); }
.banner-error { background: #FDECEC; border: 1px solid #E8B4B4; color: #7A1414; }

/* ---------- Home ---------- */

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.choice { display: block; padding: 28px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; color: var(--ink); text-decoration: none; }
.choice:hover { border-color: var(--ink); color: var(--ink); }
.choice h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 6px 0 8px; }
.choice p { margin: 0 0 14px; color: var(--muted); }
.choice ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.choice .go { display: inline-block; margin-top: 18px; font-weight: 600; color: var(--accent); }

/* ---------- Upload ---------- */

.drop-zone { margin-top: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 280px; padding: 40px; text-align: center; background: #fff; border: 2px dashed #B9B2CF; border-radius: 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.is-over { border-color: var(--accent); background: #FAF9FD; }
.drop-zone.is-disabled { cursor: not-allowed; opacity: .55; }
.drop-zone svg { width: 44px; height: 44px; color: var(--accent); }
.drop-zone strong { font-size: 18px; }
.drop-zone span { color: var(--muted); font-size: 14px; }
.upload-alt { display: flex; align-items: center; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 14px; }

.working { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(16, 7, 31, .55); z-index: 10; }
.working.is-on { display: flex; }
.working-card { background: #fff; border-radius: 14px; padding: 32px 36px; max-width: 420px; text-align: center; }
.working-card h2 { font-family: var(--serif); font-weight: 600; margin: 16px 0 6px; font-size: 22px; }
.working-card p { margin: 0; color: var(--muted); font-size: 14px; }
.spinner { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--tint); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- Report page layout ---------- */

.report-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.report-paper { flex: 999 1 640px; min-width: 0; max-width: 794px; background: #fff; box-shadow: 0 1px 2px rgba(16,7,31,.06), 0 8px 28px rgba(16,7,31,.08); }
.report-side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }
.side-card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 18px; }
.side-card h2 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; color: var(--muted); }
.side-card .btn { width: 100%; justify-content: center; }
.side-card .btn + .btn { margin-top: 8px; }
.side-meta { font-size: 13px; color: var(--muted); margin: 0; }
.staff-note { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.staff-note:first-of-type { border-top: none; padding-top: 0; }
.staff-note strong { display: block; font-size: 14px; }
.staff-note.tone-Warning strong { color: #8A1C1C; }
.staff-note.tone-Attention strong { color: var(--accent); }
.variant-switch { display: flex; background: var(--tint); border-radius: 10px; padding: 4px; }
.variant-switch a { flex: 1; text-align: center; padding: 8px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.variant-switch a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,7,31,.12); }

/* ---------- The report (mirrors the PDF) ---------- */

.report { padding: 56px 72px 72px; font-size: 15px; line-height: 1.55; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.report-head img.rws { width: 230px; height: auto; }
.report-head img.lex { width: 180px; height: auto; }
.report-title { padding: 36px 0 8px; }
.report-title h1 { margin: 10px 0 0; font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.1; letter-spacing: -0.01em; }
.report-title p { margin: 14px 0 0; font-size: 16px; color: var(--muted); }
.meta-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 13px; line-height: 1.45; }
.meta-strip dt { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.meta-strip dd { margin: 2px 0 0; font-weight: 600; }

.in-short { margin-top: 24px; padding: 24px 26px; background: var(--tint); border-radius: 10px; }
.in-short h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 600; font-size: 20px; }
.in-short p { margin: 0; }
.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }
.flag { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--rule); font-size: 13px; font-weight: 500; }
.flag.tone-Attention { border-color: #B9AEE8; color: var(--accent); font-weight: 600; }
.flag.tone-Warning { background: #FDF0DD; border-color: var(--warn-rule); color: var(--warn-ink); font-weight: 600; }

.section { margin-top: 44px; }
.section-number { font-size: 12px; font-weight: 700; color: var(--accent); }
.section h2 { margin: 2px 0 16px; font-family: var(--serif); font-weight: 600; font-size: 26px; }
.section h2.tight { margin-bottom: 8px; }
.section > p { margin: 0 0 14px; }
.small-muted { font-size: 14px; color: var(--muted); }

.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.figure { padding: 14px 14px 16px; border: 1px solid var(--rule); border-radius: 8px; }
.figure dt { font-size: 12px; color: var(--muted); }
.figure dd { margin: 4px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.2; }

.details { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.details th, .details td { padding: 9px 0; border-top: 1px solid var(--rule); text-align: left; vertical-align: top; }
.details tr:last-child th, .details tr:last-child td { border-bottom: 1px solid var(--rule); }
.details th { font-weight: 400; color: var(--muted); width: 42%; padding-right: 16px; }
.details td { font-weight: 500; }

.payments { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.payment { padding: 16px; border-radius: 8px; background: var(--tint); }
.payment-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.payment-amount { font-family: var(--serif); font-size: 24px; font-weight: 600; margin-top: 6px; }
.payment-amount span { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); }
.payment-note { font-size: 13px; color: var(--muted); margin-top: 4px; }

.erc { width: 100%; border-collapse: collapse; font-size: 14px; }
.erc th { text-align: left; padding: 8px 0; font-weight: 600; border-bottom: 2px solid var(--ink); }
.erc td { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.erc .num { text-align: right; }
.erc td.num:last-child { font-weight: 600; }

.points { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.point { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 8px; }
.point.tone-Warning { border-color: var(--warn-rule); background: var(--warn-bg); }
.point-glyph { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.point.tone-Warning .point-glyph { background: var(--warn-ink); }
.point.tone-Attention .point-glyph { background: var(--accent); }
.point h3 { margin: 0; font-size: 16px; font-weight: 700; }
.point p { margin: 4px 0 0; }
.point-ref { font-size: 12px; color: var(--muted-2); margin-top: 6px; }

.actions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.actions li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.action-number { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--accent); line-height: 1.2; }

.obligations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; font-size: 14px; }
.obligation { padding: 12px 0; border-top: 1px solid var(--rule); }
.obligation strong { display: block; font-size: 15px; }

.next-steps { margin-top: 44px; padding: 26px; background: var(--ink); color: #fff; border-radius: 10px; }
.next-steps h2 { margin: 0 0 12px; font-family: var(--serif); font-weight: 600; font-size: 22px; }
.next-steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; font-size: 14px; line-height: 1.5; }
.next-steps-who { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #C9C2E8; }
.next-steps-contact { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid #3A3150; font-size: 14px; }
.disclaimer { margin: 28px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted-2); }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
    .choice-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 32px; }
    .report { padding: 28px 20px 40px; }
    .report-head { flex-direction: column; align-items: flex-start; }
    .report-title h1 { font-size: 30px; }
    .meta-strip, .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .obligations, .next-steps-grid { grid-template-columns: 1fr; }
    .topbar-inner { gap: 12px; }
    .brand-tag { display: none; }
}

/* ---------- Print: the report alone ---------- */

@media print {
    body { background: #fff; }
    .topbar, .report-side, .no-print { display: none !important; }
    .page { padding: 0; max-width: none; }
    .report-paper { box-shadow: none; max-width: none; }
}
