:root {
    --navy: #0f2747;
    --navy-light: #17385f;
    --green: #0f8b5f;
    --green-light: #e8f7f1;
    --blue-light: #eef5fb;
    --text: #1f2937;
    --muted: #667085;
    --border: #e4e7ec;
    --background: #f5f7fa;
    --white: #ffffff;
    --shadow: 0 8px 25px rgba(15, 39, 71, 0.08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   HEADER
========================= */

.site-header {
    background: var(--navy);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.95rem;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #ffffff;
}

/* =========================
   GENERAL
========================= */

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.section {
    padding: 70px 0;
}

.light-section {
    background: var(--white);
}

.section-heading {
    margin-bottom: 35px;
    text-align: center;
}

.section-heading h2 {
    color: var(--navy);
    font-size: 2rem;
    margin-bottom: 8px;
}

.section-heading p {
    color: var(--muted);
    max-width: 650px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-block;
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* =========================
   HERO
========================= */

.hero {
    background:
        linear-gradient(
            135deg,
            var(--navy) 0%,
            var(--navy-light) 65%,
            #20547c 100%
        );
    color: var(--white);
    padding: 85px 0;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero-inner {
    max-width: 850px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero h1 span {
    color: #6ee7b7;
}

.hero p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* =========================
   BUTTONS
========================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 20px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(15, 139, 95, 0.25);
}

.button.primary:hover {
    background: #0b7952;
}

.button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.35);
}

.button.secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* =========================
   CALCULATOR CARDS
========================= */

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.calculator-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.calculator-card:not(.disabled):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.calculator-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.calculator-card h3 {
    color: var(--navy);
    font-size: 1.15rem;
    margin-bottom: 7px;
}

.calculator-card p {
    color: var(--muted);
    font-size: 0.92rem;
}

.calculator-card .card-link {
    margin-top: auto;
    padding-top: 18px;
    color: var(--green);
    font-weight: 700;
    font-size: 0.9rem;
}

.calculator-card.disabled {
    opacity: 0.58;
    cursor: default;
}

.calculator-card.disabled .calculator-icon {
    background: #eef0f3;
}

.coming-soon {
    display: inline-block;
    margin-top: 15px;
    color: #7a8492;
    font-size: 0.8rem;
    font-weight: 700;
}

/* =========================
   CALCULATOR LAYOUT (FORM + RESULT)
========================= */

.calculator-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
    gap: 24px;
}

.calculator-form-card,
.calculator-result-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
}

.calculator-result-card {
    position: sticky;
    top: 90px;
}

.calculator-form-card h2,
.calculator-result-card h2 {
    color: var(--navy);
    font-size: 1.25rem;
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(15, 139, 95, 0.12);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.8rem;
}

.input-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
    background: var(--white);
}

.input-wrapper span {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--background);
    border-right: 1px solid var(--border);
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    padding: 11px 14px;
}

.input-wrapper input:focus {
    box-shadow: none !important;
}

.input-wrapper .suffix {
    border-right: none;
    border-left: 1px solid var(--border);
}

.progress-block {
    margin-top: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
}

.progress-track {
    background: var(--border);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.progress-fill {
    background: var(--green);
    height: 100%;
    transition: width 0.4s ease;
}

.segment-bar {
    display: flex;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--border);
}

.segment-bar > div {
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

.segment-needs {
    background: var(--navy);
}

.segment-wants {
    background: #e0a83e;
}

.segment-savings {
    background: var(--green);
}

.segment-surplus {
    background: #cbd5e1;
}

.segment-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--muted);
}

.segment-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.segment-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500 !important;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.form-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.form-section-title {
    color: var(--navy);
    font-size: 1rem;
    margin-bottom: 18px;
}

.calculate-button {
    width: 100%;
    margin-top: 8px;
}

/* RESULT: headline figure */

.take-home {
    text-align: center;
    background: var(--green-light);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
}

.take-home span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.take-home strong {
    display: block;
    font-size: 2rem;
    color: var(--green);
}

/* RESULT: line-item breakdown */

.result-list {
    display: flex;
    flex-direction: column;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.result-row span {
    color: var(--muted);
}

.result-row strong {
    color: var(--text);
    white-space: nowrap;
}

.result-row.total-row {
    border-bottom: none;
    border-top: 2px solid var(--navy);
    margin-top: 6px;
    padding-top: 14px;
    font-size: 1rem;
}

.result-row.total-row strong {
    color: var(--navy);
}

.pcb-notice {
    margin-top: 20px;
    background: var(--blue-light);
    border-radius: 10px;
    padding: 16px;
}

.pcb-notice strong {
    display: block;
    color: var(--navy);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.pcb-notice p {
    color: var(--muted);
    font-size: 0.85rem;
}

/* =========================
   DSR BADGE + GAUGE
========================= */

.dsr-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.dsr-badge.good {
    background: #e8f7f1;
    color: var(--green);
}

.dsr-badge.moderate {
    background: #fef6e7;
    color: #b7791f;
}

.dsr-badge.high {
    background: #fdeee9;
    color: #c2410c;
}

.dsr-badge.veryhigh {
    background: #fde8e8;
    color: #c0392b;
}

.dsr-gauge {
    position: relative;
    height: 10px;
    border-radius: 999px;
    margin: 18px 0 6px;
    background: linear-gradient(
        to right,
        #0f8b5f 0%,
        #0f8b5f 30%,
        #e0a83e 30%,
        #e0a83e 60%,
        #e2793a 60%,
        #e2793a 70%,
        #d1453d 70%,
        #d1453d 100%
    );
}

.dsr-gauge-marker {
    position: absolute;
    top: -4px;
    width: 3px;
    height: 18px;
    background: var(--navy);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.2s ease;
}

.dsr-gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 0.7rem;
}

/* =========================
   TOPICS
========================= */

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

.topic {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.topic:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.topic-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.topic h3 {
    color: var(--navy);
    margin-bottom: 5px;
}

.topic p {
    color: var(--muted);
    font-size: 0.9rem;
}

/* =========================
   PRINCIPLE
========================= */

.principle {
    padding: 75px 0;
    background: var(--navy);
    color: var(--white);
}

.principle-box {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.principle-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.principle h2 {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    margin-bottom: 15px;
}

.principle p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    background: #0a1b31;
    color: rgba(255, 255, 255, 0.7);
    padding: 35px 0;
}

.footer-inner {
    max-width: 1120px;
    width: min(100% - 40px, 1120px);
    margin: 0 auto;
    text-align: center;
}

.footer-inner p {
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.footer-brand {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 10px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 850px) {

    .calculator-grid,
    .topic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        padding: 65px 0;
    }

    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .calculator-result-card {
        position: static;
    }
}

@media (max-width: 600px) {

    .container {
        width: min(100% - 28px, 1120px);
    }

    .header-inner {
        padding: 13px 14px;
        flex-direction: column;
        gap: 10px;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        gap: 15px;
        font-size: 0.85rem;
    }

    .hero {
        padding: 55px 0;
    }

    .hero h1 {
        font-size: 2.35rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .section {
        padding: 55px 0;
    }

    .section-heading h2 {
        font-size: 1.65rem;
    }

    .calculator-grid,
    .topic-grid {
        grid-template-columns: 1fr;
    }

    .calculator-card {
        min-height: auto;
    }

    .principle {
        padding: 55px 0;
    }
}


/* =========================
   CALCULATOR PRIVACY + SHARING
========================= */

.calculator-data-tools {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--blue-light);
}

.calculator-data-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.calculator-data-actions button {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.share-primary {
    border: 1px solid var(--navy);
    background: var(--navy);
    color: var(--white);
}

.share-secondary {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
}

.share-status {
    color: var(--muted);
    font-size: 0.82rem;
}

.calculator-data-note {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.calculator-data-note a {
    color: var(--green);
    font-weight: 700;
    text-decoration: underline;
}

.footer-policies {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-policies a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =========================
   LEGAL / POLICY PAGES
========================= */

.legal-page {
    max-width: 860px;
}

.legal-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 18px;
}

.legal-card h2 {
    color: var(--navy);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.legal-card p + p {
    margin-top: 12px;
}

.legal-card code {
    background: var(--background);
    border-radius: 4px;
    padding: 1px 5px;
}

.legal-sources {
    margin: 18px 0 24px;
    padding: 18px;
    border-radius: 12px;
    background: var(--blue-light);
}

.legal-sources h2 {
    margin-bottom: 10px;
    color: var(--navy);
}

.legal-sources a {
    display: block;
    color: var(--green);
    font-weight: 700;
    text-decoration: underline;
    margin-top: 7px;
}

@media (max-width: 600px) {
    .calculator-data-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .calculator-data-actions button {
        width: 100%;
    }

    .share-status {
        display: block;
    }
}
