:root {
    --blue-950: #08245c;
    --blue-900: #0b3180;
    --blue-800: #1647a6;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --yellow: #facc15;
    --yellow-soft: #fef9c3;
    --orange: #f97316;
    --ink: #172033;
    --muted: #5f6b7a;
    --surface: #ffffff;
    --line: #dbe4f0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: #f8fafc;
    color: var(--ink);
    font-family: "Montserrat", system-ui, sans-serif;
    line-height: 1.55;
}

a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
    position: fixed;
    z-index: 100;
    left: 1rem;
    top: 0;
    padding: .75rem 1rem;
    border-radius: 0 0 .75rem .75rem;
    background: var(--yellow);
    color: var(--blue-950);
    font-weight: 900;
    transform: translateY(-120%);
}

.skip-link:focus { transform: translateY(0); }

.site-shell { width: min(1160px, calc(100% - 2rem)); margin-inline: auto; }

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    background: var(--blue-900);
    color: white;
    box-shadow: 0 7px 24px rgba(8, 36, 92, .18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    font-weight: 900;
    letter-spacing: .025em;
    white-space: nowrap;
}

.brand img { width: 44px; height: 44px; object-fit: contain; }

.main-nav { display: flex; align-items: center; gap: 1.15rem; font-size: .82rem; font-weight: 700; }
.main-nav a { padding: .65rem 0; color: #dbeafe; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--yellow); }
.main-nav a[aria-current="page"] { color: white; border-bottom-color: var(--yellow); }

.hero {
    position: relative;
    overflow: hidden;
    color: white;
    background: linear-gradient(135deg, var(--blue-950), var(--blue-800));
    padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.hero::before,
.hero::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    border: clamp(14px, 3vw, 30px) solid rgba(250, 204, 21, .2);
    pointer-events: none;
}

.hero::before { width: 270px; height: 270px; right: -90px; top: -115px; }
.hero::after { width: 150px; height: 150px; left: -65px; bottom: -80px; border-color: rgba(249, 115, 22, .22); }

.hero-content { position: relative; z-index: 1; max-width: 800px; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: .74rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); }
.eyebrow::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(249, 115, 22, .17); }
.hero h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); line-height: 1.06; letter-spacing: -.045em; font-weight: 900; text-wrap: balance; }
.hero p { max-width: 680px; margin: 1.25rem 0 0; color: #dbeafe; font-size: clamp(1rem, 2vw, 1.18rem); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.35rem; color: #bfdbfe; font-size: .8rem; }
.breadcrumb a { text-underline-offset: 3px; }
.breadcrumb span[aria-hidden] { opacity: .6; }

.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-heading { max-width: 700px; margin-bottom: 2rem; }
.section-heading h2 { margin: 0 0 .65rem; color: var(--blue-950); font-size: clamp(1.7rem, 4vw, 2.55rem); line-height: 1.15; letter-spacing: -.035em; font-weight: 900; }
.section-heading p { margin: 0; color: var(--muted); }

.utility-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 1.25rem; }
.utility-card {
    display: flex;
    min-height: 310px;
    flex-direction: column;
    padding: clamp(1.4rem, 4vw, 2rem);
    border: 1px solid var(--blue-100);
    border-radius: 1.75rem;
    background: var(--surface);
    box-shadow: 0 16px 40px rgba(8, 36, 92, .09);
}

.utility-icon {
    display: grid;
    width: 74px;
    height: 74px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--yellow), #fb923c);
    color: var(--blue-950);
    box-shadow: 0 0 0 9px var(--yellow-soft);
}

.utility-icon svg { width: 36px; height: 36px; }
.utility-card h2 { margin: 1.65rem 0 .65rem; color: var(--blue-950); font-size: 1.45rem; line-height: 1.2; font-weight: 900; }
.utility-card p { margin: 0 0 1.5rem; color: var(--muted); }
.utility-card .button { margin-top: auto; align-self: flex-start; }

.button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .8rem 1.2rem;
    border: 2px solid transparent;
    border-radius: .9rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 900;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover { transform: translateY(-2px); }
.button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.button-primary { background: var(--yellow); color: var(--blue-950); box-shadow: 0 10px 24px rgba(250, 204, 21, .24); }
.button-primary:hover { background: #fde047; }
.button-blue { background: var(--blue-900); color: white; box-shadow: 0 10px 24px rgba(11, 49, 128, .2); }
.button-blue:hover { background: var(--blue-800); }
.button-secondary { border-color: #bfd0e8; background: white; color: var(--blue-900); }
.button-secondary:hover { background: var(--blue-50); }
.button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.calculator-section { background: linear-gradient(#f8fafc, var(--blue-50)); }
.calculator-layout { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 1.5rem; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 1.65rem; background: white; box-shadow: 0 18px 45px rgba(8, 36, 92, .08); }
.input-panel { padding: clamp(1.25rem, 4vw, 2rem); }
.panel-title { margin: 0 0 .35rem; color: var(--blue-950); font-size: 1.35rem; font-weight: 900; }
.panel-intro { margin: 0 0 1.45rem; color: var(--muted); font-size: .9rem; }
.form-grid { display: grid; gap: 1rem; }
.field label { display: block; margin-bottom: .42rem; color: #25324a; font-size: .84rem; font-weight: 800; }
.input-wrap { position: relative; }
.input-prefix { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #52617a; font-size: .9rem; font-weight: 800; pointer-events: none; }
.field input {
    width: 100%;
    min-height: 52px;
    padding: .8rem 1rem;
    border: 2px solid #d8e1ee;
    border-radius: .85rem;
    background: #fff;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
}
.field input.has-prefix { padding-left: 3.15rem; }
.field input:hover { border-color: #aabbd3; }
.field-note { margin: .35rem 0 0; color: #718096; font-size: .72rem; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1.35rem; }
.form-status { min-height: 1.35rem; margin: .75rem 0 0; color: #31507c; font-size: .78rem; font-weight: 700; text-align: center; }

.results-panel { padding: clamp(1.25rem, 4vw, 2rem); background: var(--blue-950); color: white; border-color: var(--blue-900); }
.results-panel .panel-title { color: white; }
.results-panel .panel-intro { color: #bfdbfe; }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.result-card { min-height: 132px; padding: 1.1rem; border: 1px solid rgba(255,255,255,.14); border-radius: 1.15rem; background: rgba(255,255,255,.075); }
.result-card.featured { background: linear-gradient(145deg, var(--yellow), #fb923c); color: var(--blue-950); border-color: transparent; }
.result-label { display: block; min-height: 2.5em; color: #bfdbfe; font-size: .72rem; font-weight: 800; letter-spacing: .055em; line-height: 1.25; text-transform: uppercase; }
.featured .result-label { color: #5b3500; }
.result-value { display: block; margin-top: .55rem; font-size: clamp(1.15rem, 3vw, 1.55rem); line-height: 1.15; font-weight: 900; overflow-wrap: anywhere; }
.result-detail { display: block; margin-top: .35rem; color: #bfdbfe; font-size: .72rem; }
.featured .result-detail { color: #603b00; }

.warning {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: 2px solid #fdba74;
    border-radius: 1rem;
    background: #fff7ed;
    color: #9a3412;
    font-size: .88rem;
    font-weight: 800;
}
.warning[hidden] { display: none; }

.explanation-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1.5rem; align-items: stretch; }
.info-card { padding: clamp(1.35rem, 4vw, 2rem); border-radius: 1.5rem; }
.payback-card { background: var(--yellow-soft); border: 1px solid #fde68a; }
.payback-card h2, .example-card h2 { margin: 0 0 .8rem; color: var(--blue-950); font-size: 1.35rem; font-weight: 900; }
.payback-card p, .example-card p { margin: 0; color: #4b5563; }
.payback-card p + p { margin-top: .8rem; }
.example-card { background: white; border: 1px solid var(--blue-100); box-shadow: 0 14px 36px rgba(8, 36, 92, .07); }
.example-list { display: grid; gap: .65rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.example-list li { padding: .72rem .85rem; border-left: 4px solid var(--orange); border-radius: 0 .7rem .7rem 0; background: #fff7ed; color: #4b5563; font-size: .88rem; }
.example-list strong { color: var(--blue-950); }

.cta-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border-radius: 1.75rem;
    background: linear-gradient(135deg, var(--blue-950), var(--blue-800));
    color: white;
    box-shadow: 0 22px 55px rgba(8, 36, 92, .2);
}
.cta-card h2 { margin: 0 0 .55rem; font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.2; font-weight: 900; }
.cta-card p { max-width: 690px; margin: 0; color: #dbeafe; }
.favorite-note { margin: 1.25rem 0 0; text-align: center; color: var(--muted); font-size: .9rem; }

.site-footer { padding: 2.5rem 0; background: #030712; color: #94a3b8; font-size: .82rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.15rem; }
.footer-links a { color: #cbd5e1; text-decoration: none; }
.footer-links a:hover { color: white; }

@media (max-width: 900px) {
    .header-inner { align-items: stretch; flex-direction: column; gap: .45rem; padding: .65rem 0 .5rem; }
    .brand img { width: 36px; height: 36px; }
    .brand-name { font-size: .9rem; }
    .main-nav { width: 100%; overflow-x: auto; gap: 1rem; border-top: 1px solid rgba(255,255,255,.12); scrollbar-width: none; }
    .main-nav::-webkit-scrollbar { display: none; }
    .calculator-layout, .explanation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .site-shell { width: min(100% - 1.25rem, 1160px); }
    .hero { padding: 3rem 0 3.4rem; }
    .hero h1 { font-size: 2.2rem; }
    .section { padding: 3rem 0; }
    .calculator-section { padding-top: 1.5rem; }
    .panel { border-radius: 1.25rem; }
    .results-grid { grid-template-columns: 1fr; }
    .result-card { min-height: 112px; }
    .result-label { min-height: 0; }
    .form-actions { grid-template-columns: 1fr; }
    .button { width: 100%; min-height: 54px; }
    .cta-card { grid-template-columns: 1fr; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
