* {
    box-sizing: border-box;
}

:root {
    --bg: #f7f1eb;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-soft: #fff7f5;
    --text: #211d1a;
    --muted: #6a625d;
    --line: rgba(76, 53, 43, 0.12);
    --accent: #e31837;
    --accent-dark: #b91129;
    --accent-soft: rgba(227, 24, 55, 0.1);
    --shadow: 0 24px 60px rgba(80, 44, 31, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(227, 24, 55, 0.14), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(228, 173, 87, 0.18), transparent 22%),
        linear-gradient(180deg, #fbf7f2 0%, #f4eee6 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(6px);
}

body::before {
    top: 120px;
    right: -120px;
    width: 300px;
    height: 300px;
    background: rgba(227, 24, 55, 0.08);
}

body::after {
    bottom: 80px;
    left: -100px;
    width: 260px;
    height: 260px;
    background: rgba(199, 150, 61, 0.1);
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 48px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 28px;
}

.hero-copy,
.hero-panel,
.calculator-card,
.page-note {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-copy {
    padding: 34px 36px;
    border-radius: 32px;
}

.eyebrow,
.card-tag,
.hero-panel-label,
.result-label {
    margin: 0 0 12px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow,
.hero-panel-label {
    color: var(--accent);
}

.hero h1,
.card-header h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.02;
}

.hero h1 {
    max-width: 12ch;
    font-size: clamp(2.6rem, 5vw, 4.9rem);
}

.hero-text,
.card-description,
.page-note p,
.hero-panel-stat span,
.result-stat span {
    color: var(--muted);
    line-height: 1.6;
}

.hero-text {
    max-width: 62ch;
    margin: 18px 0 0;
    font-size: 1.02rem;
}

.hero-panel {
    border-radius: 28px;
    padding: 28px;
    align-self: end;
    background: linear-gradient(180deg, rgba(255, 249, 247, 0.95) 0%, rgba(255, 255, 255, 0.82) 100%);
}

.hero-panel-stat + .hero-panel-stat {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.hero-panel-stat strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.container {
    width: auto;
}

.calculator-card {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border-radius: var(--radius-xl);
}

.calculator-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent) 0%, #ff8d67 100%);
}

.mortgage-card::before {
    background: linear-gradient(90deg, #991b1b 0%, #eab308 100%);
}

.card-header {
    margin-bottom: 24px;
}

.card-tag {
    color: var(--accent);
}

.card-header h2 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.card-description {
    margin: 14px 0 0;
    font-size: 0.98rem;
}

.calculator-form {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    margin: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.94rem;
    font-weight: 700;
    color: #312925;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.input-prefix,
.input-suffix {
    color: #8f837b;
    font-weight: 700;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    color: var(--text);
    padding: 0 16px;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.input-shell input {
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

input::placeholder {
    color: #ae9f95;
}

input:focus,
select:focus,
.input-shell:focus-within {
    outline: none;
    border-color: rgba(227, 24, 55, 0.45);
    box-shadow: 0 0 0 4px rgba(227, 24, 55, 0.12);
    transform: translateY(-1px);
}

button {
    min-height: 60px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff7043 100%);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 18px 24px rgba(227, 24, 55, 0.2);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 30px rgba(227, 24, 55, 0.24);
    filter: saturate(1.05);
}

button:active {
    transform: translateY(0);
}

.result {
    margin-top: 24px;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--surface-soft) 0%, #fff 100%);
    border: 1px solid rgba(227, 24, 55, 0.12);
}

.result.hidden {
    display: none;
}

.result-label {
    color: var(--accent);
}

.result h3 {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.1;
}

.result h3 span:last-child {
    font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--muted);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.result-stat {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(76, 53, 43, 0.08);
}

.result-stat span {
    display: block;
    font-size: 0.86rem;
}

.result-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1.05rem;
}

.page-note {
    margin-top: 24px;
    padding: 18px 22px;
    border-radius: 20px;
}

.page-note p {
    margin: 0;
    font-size: 0.92rem;
}

@media (max-width: 980px) {
    .hero,
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding: 18px 0 28px;
    }

    .hero-copy,
    .hero-panel,
    .calculator-card {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .form-row,
    .result-stats {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
    }

    .card-header h2 {
        font-size: 2rem;
    }

    button,
    input,
    select,
    .input-shell {
        min-height: 54px;
    }
}
