:root {
    --bg: #f3f8f6;
    --surface: #ffffff;
    --soft: #e7f3ef;
    --soft-2: #eef7f4;
    --ink: #091624;
    --muted: #52657a;
    --line: #d8e7e2;
    --primary: #0f8a7c;
    --primary-dark: #0a6b60;
    --primary-soft: #dff3ef;
    --blue: #1d77f2;
    --orange: #f28b21;
    --shadow: 0 18px 45px rgba(18, 45, 52, 0.08);
    --radius: 8px;
    --shell: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

#calculator,
#schedule {
    scroll-margin-top: 108px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(243,248,246,.94)), var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.site-shell { width: min(calc(100% - 32px), var(--shell)); margin-inline: auto; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px 0;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(216,231,226,.75);
}
.nav-shell { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 22px; }
.brand, .main-nav, .nav-actions { display: flex; align-items: center; }
.brand { gap: 10px; font-weight: 900; letter-spacing: 0; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius); background: var(--primary); color: #fff; font-size: 12px; font-weight: 900; }
.main-nav { gap: 6px; color: #31465c; font-size: 14px; }
.main-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--radius); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border: 0; border-radius: var(--radius); font-weight: 900; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 14px 24px rgba(15,138,124,.22); }
.button-secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }

.hero { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 470px; align-items: center; gap: 64px; padding: 78px 22px 54px; }
.eyebrow { display: inline-flex; align-items: center; min-height: 28px; padding: 0 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.hero h1 { max-width: 680px; margin: 24px 0 18px; font-size: clamp(42px,5vw,74px); line-height: 1.02; letter-spacing: 0; }
.hero h1 span { display: block; color: var(--primary); }
.hero p { max-width: 620px; margin: 0; color: var(--muted); font-size: 18px; }
.hero-points { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 24px; max-width: 560px; margin: 28px 0 0; padding: 0; list-style: none; color: #23394f; font-size: 14px; }
.hero-points li::before { content: ""; width: 14px; height: 14px; display: inline-block; margin-right: 8px; border-radius: 50%; border: 4px solid var(--primary-soft); background: var(--primary); vertical-align: -2px; }
.hero-visual { position: relative; min-height: 350px; display: grid; place-items: center; border-radius: 28px; background: linear-gradient(135deg, #dcefe9 0 45%, #f6f2df 45% 55%, #dcefe9 55%); box-shadow: var(--shadow); overflow: hidden; }
.estimate-card { width: min(360px, 88%); padding: 28px; border: 10px solid rgba(255,255,255,.55); border-radius: 18px; background: #fff; box-shadow: 0 26px 50px rgba(10,48,68,.2); }
.estimate-card small { display: block; margin-top: 20px; color: var(--muted); font-weight: 900; }
.estimate-card > strong { display: block; font-size: 56px; line-height: 1; }
.estimate-card div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.estimate-card div span { padding: 14px; border-radius: var(--radius); background: var(--soft-2); color: var(--muted); font-weight: 800; }
.estimate-card b { display: block; color: var(--primary); }

.ad-section { padding: 18px 22px; }
.ad-slot { min-height: 92px; display: grid; place-items: center; border: 1px dashed #b8d0c9; border-radius: var(--radius); background: rgba(255,255,255,.72); color: #698079; font-size: 13px; }
.ad-slot span { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--soft-2); }

.loan-types {
    padding: 32px 22px 24px;
}

.loan-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.loan-type-grid article {
    position: relative;
    min-height: 210px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.loan-type-grid article::after {
    content: "";
    position: absolute;
    right: -38px;
    bottom: -38px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-soft);
    z-index: 0;
}

.loan-icon {
    position: relative;
    z-index: 1;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 24px rgba(15, 138, 124, .22);
}

.loan-type-grid h3 {
    position: relative;
    z-index: 1;
    margin: 22px 0 10px;
    font-size: 24px;
    line-height: 1.15;
}

.loan-type-grid p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--muted);
}

.calculator-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(420px,1.1fr); gap: 24px; padding: 34px 22px 22px; }
.calculator-card, .results-stack > article, .chart-card, .schedule-card, .info-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}
.calculator-card { padding: 24px; }
.section-heading { text-align: center; margin-bottom: 28px; }
.section-heading.left { text-align: left; margin-bottom: 20px; }
.section-heading h2, .content-copy h2 { margin: 10px 0; font-size: clamp(30px,4vw,42px); line-height: 1.12; }
.section-heading p, .content-copy p, .info-grid p { margin: 0; color: var(--muted); }
.mode-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin-bottom: 22px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft-2); }
.mode-tab { min-height: 42px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 900; }
.mode-tab.is-active { background: #fff; color: var(--primary); box-shadow: 0 8px 18px rgba(18,45,52,.08); }
.loan-form { display: grid; gap: 18px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-shell { display: block; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfefd; }
.input-shell span, .label-row { color: var(--muted); font-size: 13px; font-weight: 900; }
.input-shell input { width: 100%; min-height: 34px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; font-weight: 900; }
.wide { grid-column: 1 / -1; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.advanced-panel { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.advanced-panel summary { font-weight: 900; cursor: pointer; }
.advanced-panel .field-grid { margin-top: 14px; }

.results-stack { display: grid; gap: 16px; align-content: start; }
.results-stack > article.payment-hero { padding: 28px; background: linear-gradient(135deg, var(--blue), var(--primary)); color: #fff; }
.payment-hero span, .payment-hero small { display: block; font-weight: 800; opacity: .9; }
.payment-hero strong { display: block; margin-top: 8px; font-size: 58px; line-height: 1; }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.metric-grid article { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.metric-grid span, .summary-card span { display: block; color: var(--muted); font-weight: 800; }
.metric-grid strong, .summary-card strong { display: block; margin-top: 8px; font-size: 24px; }
#total-interest { color: var(--orange); }
#interest-saved { color: var(--primary); }
.summary-card { display: flex; justify-content: space-between; gap: 16px; padding: 18px; }

.process-section {
    display: grid;
    grid-template-columns: .82fr 1.18fr;
    gap: 28px;
    align-items: center;
    padding: 36px 22px 24px;
}

.process-copy {
    padding: 34px;
    border-radius: var(--radius);
    background: #0b1820;
    color: #fff;
    box-shadow: var(--shadow);
}

.process-copy h2 {
    margin: 16px 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
}

.process-copy p {
    margin: 0;
    color: #c6d5dd;
}

.process-steps {
    display: grid;
    gap: 14px;
}

.process-steps article {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.process-steps span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
}

.process-steps article > div {
    min-width: 0;
}

.process-steps h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.process-steps p {
    margin: 0;
    color: var(--muted);
    max-width: 460px;
}

.schedule-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; padding: 22px 22px 42px; }
.chart-card, .schedule-card { padding: 24px; }
.chart-card canvas { width: 100%; min-height: 280px; }
.schedule-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.schedule-head h2 { margin: 0; font-size: 24px; }
.schedule-head p { margin: 4px 0 0; color: var(--muted); }
.schedule-head > div:last-child { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); }

.trust-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 48px;
    border-radius: var(--radius);
    background: var(--line);
    box-shadow: var(--shadow);
}

.trust-band article {
    min-height: 150px;
    padding: 24px;
    background: #fff;
}

.trust-band strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 24px;
    line-height: 1.1;
}

.trust-band span {
    color: var(--muted);
}

.content-section { padding: 54px 22px; }
.content-copy { max-width: 900px; margin-bottom: 24px; }
.info-grid { display: grid; gap: 16px; }
.info-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.info-grid article { padding: 24px; box-shadow: none; }
.info-grid h3 { margin: 0 0 12px; font-size: 22px; }
.legal-page { min-height: 56vh; padding: 58px 22px; }
.legal-page h1 { margin-bottom: 22px; font-size: clamp(34px,5vw,54px); line-height: 1.05; }
.legal-page h2 { margin: 30px 0 8px; font-size: 24px; }
.legal-page p { color: var(--muted); }
.article-page { max-width: 920px; }
.article-page .eyebrow { margin-bottom: 14px; }
.article-page p { font-size: 17px; }
.faq-list { margin-top: 34px; }
.faq-list h2 { margin: 0 0 16px; font-size: 30px; }
.faq-list details {
    margin-bottom: 12px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.faq-list summary { font-weight: 900; cursor: pointer; }
.faq-list p { margin: 12px 0 0; }

.site-footer { background: #0b1820; color: #dce8ef; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3,1fr); gap: 36px; padding: 44px 22px 32px; }
.footer-brand { color: #fff; }
.site-footer p, .site-footer a { color: #b9c8d0; }
.site-footer p { margin: 16px 0 0; }
.site-footer h2 { margin: 0 0 12px; color: #fff; font-size: 16px; }
.site-footer a { display: block; margin-bottom: 8px; font-size: 14px; }
.footer-bottom { padding: 20px 22px; border-top: 1px solid rgba(255,255,255,.08); text-align: center; color: #b9c8d0; }

@media (max-width: 980px) {
    .hero, .calculator-layout, .schedule-layout, .process-section { grid-template-columns: 1fr; }
    .metric-grid, .footer-grid, .info-grid.two, .trust-band { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .loan-type-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
}
@media (max-width: 640px) {
    .site-shell { width: 100%; }
    .nav-shell { padding: 0 14px; min-height: 62px; }
    .nav-actions .button { display: none; }
    .hero, .loan-types, .calculator-layout, .process-section, .schedule-layout, .content-section, .legal-page, .footer-grid { padding-left: 14px; padding-right: 14px; }
    .hero { padding-top: 42px; gap: 32px; }
    .hero h1 { max-width: 340px; font-size: clamp(36px,10vw,44px); }
    .hero p { max-width: 340px; font-size: 16px; }
    .hero-points, .field-grid, .metric-grid, .footer-grid, .info-grid.two, .trust-band { grid-template-columns: 1fr; }
    .hero-visual { min-height: 280px; border-radius: 18px; }
    .payment-hero strong, .estimate-card > strong { font-size: 46px; }
    .summary-card, .schedule-head { flex-direction: column; }
    .process-copy { padding: 24px; }
    .process-steps article { grid-template-columns: 1fr; }
}
