:root {
    --primary: #5954d9;
    --primary-dark: #4742b8;
    --primary-light: #f3f2ff;

    --text: #1f2937;
    --heading: #111827;
    --ink: #191919;
    --muted: #64748b;

    --border: #e5e7eb;
    --border-dark: #d1d5db;

    --background: #f8fafc;
    --surface: #ffffff;
    --soft: #f8f7ff;

    --success-bg: #f0fdf4;
    --warning-bg: #fffbeb;

    --max-width: 900px;
    --radius: 14px;
}

/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    color: var(--text);
    background: var(--background);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.7;
}

a {
    color: var(--primary);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.container {
    width: min(100% - 32px, var(--max-width));
    margin-inline: auto;
}

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

.site-header {
    position: relative;
    z-index: 1000;

    width: 100%;

    background: var(--surface);

    border-bottom: 1px solid var(--border);
}

.header-inner {
    position: relative;

    min-height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}

/* =========================================================
   LOGO
========================================================= */

.logo {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    color: var(--ink);

    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;

    text-decoration: none;
    white-space: nowrap;
}

.logo:hover {
    color: var(--primary);
}

/* =========================================================
   DESKTOP NAVIGATION
========================================================= */

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 5px;

    width: auto;

    overflow: visible;
}

.main-nav > a,
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 7px 10px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: var(--ink);

    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;

    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.main-nav > a:hover,
.nav-dropdown-toggle:hover {
    background: var(--soft);
    color: var(--primary);
}

/* =========================================================
   FINANCE DROPDOWN
========================================================= */

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    gap: 6px;
}

.dropdown-arrow {
    display: inline-block;

    font-size: 11px;
    line-height: 1;

    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;

    top: calc(100% + 6px);
    right: 0;

    z-index: 2000;

    width: 235px;

    padding: 7px;

    display: none;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: 0 10px 30px rgba(25, 25, 25, 0.08);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;

    padding: 10px 12px;

    border-radius: 7px;

    color: var(--ink);

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.nav-dropdown-menu a:hover {
    background: var(--soft);
    color: var(--primary);
}

/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.mobile-menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    padding: 8px;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);

    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;

    width: 20px;
    height: 2px;

    margin: 3px 0;

    background: var(--ink);

    border-radius: 2px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

/* =========================================================
   HAMBURGER → X
========================================================= */

.mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =========================================================
   ARTICLE
========================================================= */

.article {
    background: var(--surface);

    padding: 36px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    margin-bottom: 50px;
}

.article-header {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 6px;

    color: var(--primary);

    font-size: 0.78rem;
    font-weight: 800;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    color: var(--heading);
    line-height: 1.25;
}

h1 {
    margin: 0 0 16px;

    font-size: clamp(2rem, 5vw, 3.25rem);

    letter-spacing: -0.035em;
}

h2 {
    margin-top: 48px;

    font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
    margin-top: 30px;

    font-size: 1.2rem;
}

.lead {
    color: #475569;

    font-size: 1.12rem;
    line-height: 1.75;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-top: 20px;

    color: var(--muted);

    font-size: 0.82rem;
}

/* =========================================================
   QUICK ANSWER
========================================================= */

.quick-answer {
    margin-top: 32px;

    padding: 22px;

    background: var(--soft);

    border-left: 4px solid var(--primary);
    border-radius: 10px;
}

.quick-answer h2 {
    margin-top: 0;

    font-size: 1.2rem;
}

/* =========================================================
   CALCULATOR / TOOL CARD
========================================================= */

.tool-card {
    margin: 40px 0;

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.tool-heading h2 {
    margin-top: 0;
}

.tool-heading p {
    color: var(--muted);
}

/* =========================================================
   FORM
========================================================= */

.form-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 16px;
}

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

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;

    min-height: 46px;

    border: 1px solid var(--border-dark);
    border-radius: 9px;

    padding: 10px 12px;

    background: var(--surface);
    color: var(--text);

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    outline: 3px solid rgba(89, 84, 217, 0.15);
}

/* =========================================================
   MONEY INPUT
========================================================= */

.input-money {
    display: flex;
    align-items: center;

    min-height: 46px;

    border: 1px solid var(--border-dark);
    border-radius: 9px;

    overflow: hidden;

    background: var(--surface);
}

.input-money span {
    padding-left: 12px;

    color: var(--muted);

    font-weight: 600;
}

.input-money input {
    min-height: 44px;

    border: 0;
    outline: 0;

    box-shadow: none;
}

.input-money:focus-within {
    border-color: var(--primary);

    outline: 3px solid rgba(89, 84, 217, 0.15);
}

/* =========================================================
   BUTTON
========================================================= */

.primary-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 10px 18px;

    border: 0;
    border-radius: 9px;

    background: var(--primary);
    color: #fff;

    font-weight: 750;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        transform 0.1s ease;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.primary-button:active {
    transform: translateY(1px);
}

/* =========================================================
   CALCULATOR RESULTS
========================================================= */

.calculator-result {
    margin-top: 25px;

    padding: 22px;

    border-radius: 12px;

    background: var(--success-bg);

    border: 1px solid #bbf7d0;
}

.result-main {
    text-align: center;

    margin-bottom: 20px;
}

.result-main span,
.result-grid span {
    display: block;

    color: var(--muted);

    font-size: 0.85rem;
}

.result-main strong {
    display: block;

    margin-top: 5px;

    color: var(--text);

    font-size: 2rem;
}

.result-grid {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 12px;
}

.result-grid > div {
    padding: 14px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 9px;
}

.result-grid strong {
    display: block;

    margin-top: 4px;
}

.result-note {
    margin-bottom: 0;

    color: var(--muted);

    font-size: 0.82rem;
}

/* =========================================================
   ARTICLE CONTENT
========================================================= */

.article p,
.article li {
    color: #374151;
}

.article li {
    margin: 6px 0;
}

.formula {
    margin: 18px 0;

    padding: 18px;

    border-radius: 10px;

    background: #f1f5f9;

    font-weight: 750;

    text-align: center;
}

.example-box {
    margin: 18px 0;

    padding: 20px;

    background: #f8fafc;

    border: 1px solid var(--border);
    border-radius: 10px;
}

.example-box strong {
    font-size: 1.25rem;
}

/* =========================================================
   COMPARISON
========================================================= */

.comparison-card {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 15px;

    margin-top: 20px;
}

.comparison-card > div {
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
}

.comparison-card strong,
.comparison-card span {
    display: block;
}

.comparison-card span {
    margin-top: 7px;

    color: var(--muted);
}

/* =========================================================
   FLOW
========================================================= */

.flow {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;

    margin: 25px 0;
}

.flow div {
    width: min(100%, 420px);

    padding: 14px;

    text-align: center;

    border-radius: 9px;

    background: #f1f5f9;

    font-weight: 700;
}

.flow span {
    color: var(--primary);

    font-weight: 800;
}

/* =========================================================
   TAX FLOW
========================================================= */

.tax-flow {
    margin: 25px 0;
}

.tax-flow > div:not(.arrow) {
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
}

.tax-flow strong,
.tax-flow span {
    display: block;
}

.tax-flow span {
    margin-top: 5px;

    color: var(--muted);
}

.tax-flow .arrow {
    padding: 8px;

    text-align: center;

    color: var(--primary);

    font-weight: 800;
}

/* =========================================================
   INFO CARDS
========================================================= */

.info-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 15px;
}

.info-card {
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
}

.info-card h3 {
    margin-top: 0;
}

.info-card p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   TABLE
========================================================= */

.example-table {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 10px;

    overflow: hidden;

    background: var(--surface);
}

.example-table > div {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding: 14px 18px;

    border-bottom: 1px solid var(--border);
}

.example-table > div:last-child {
    border-bottom: 0;
}

.example-table .total {
    background: #f8fafc;

    font-weight: 800;
}

/* =========================================================
   CTA
========================================================= */

.cta-card {
    margin-top: 45px;

    padding: 28px;

    border-radius: var(--radius);

    background: var(--soft);

    border: 1px solid #ddd9ff;
}

.cta-card h2 {
    margin-top: 0;
}

.cta-card p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   FAQ
========================================================= */

.faq {
    margin-top: 10px;
}

.faq details {
    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}

.faq details:first-child {
    border-top: 1px solid var(--border);
}

.faq summary {
    cursor: pointer;

    color: var(--heading);

    font-weight: 700;

    list-style-position: outside;
}

.faq p {
    margin-top: 12px;
    margin-bottom: 0;
}

/* =========================================================
   RELATED CONTENT
========================================================= */

.related-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.related-grid a {
    display: block;

    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);

    text-decoration: none;

    color: var(--text);

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.related-grid a:hover {
    background: var(--primary-light);

    border-color: #d8d5ff;

    transform: translateY(-1px);
}

.related-grid strong,
.related-grid span {
    display: block;
}

.related-grid strong {
    color: var(--heading);
}

.related-grid span {
    margin-top: 4px;

    color: var(--muted);

    font-size: 0.9rem;
}

/* =========================================================
   SOURCES
========================================================= */

.sources {
    margin-top: 45px;

    padding-top: 25px;

    border-top: 1px solid var(--border);
}

.sources h2 {
    margin-top: 0;
}

.sources ul {
    padding-left: 20px;
}

.sources a {
    text-decoration: none;
}

.sources a:hover {
    text-decoration: underline;
}

/* =========================================================
   DISCLAIMER
========================================================= */

.disclaimer {
    margin-top: 30px;

    padding: 18px;

    background: var(--warning-bg);

    border: 1px solid #fde68a;
    border-radius: 10px;

    color: #713f12;

    font-size: 0.9rem;
}

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

.site-footer {
    margin-top: 0;

    padding: 38px 0 28px;

    background: var(--surface);

    border-top: 1px solid var(--border);
}

.footer-inner {
    display: grid;

    grid-template-columns: 1.4fr 1fr 1fr;

    gap: 40px;

    align-items: start;
}

.footer-brand {
    min-width: 0;
}

.footer-logo {
    display: inline-block;

    margin-bottom: 8px;

    color: var(--text);

    font-size: 1.15rem;
    font-weight: 800;

    text-decoration: none;
}

.footer-description {
    max-width: 300px;

    margin: 0;

    color: var(--muted);

    font-size: 0.85rem;

    line-height: 1.6;
}

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

.footer-column h3 {
    margin: 0 0 12px;

    color: var(--heading);

    font-size: 0.9rem;
    font-weight: 700;
}

.footer-column nav {
    display: flex;

    flex-direction: column;
    align-items: flex-start;

    gap: 7px;
}

.footer-column nav a {
    color: var(--muted);

    font-size: 0.84rem;

    text-decoration: none;

    transition: color 0.15s ease;
}

.footer-column nav a:hover {
    color: var(--primary);
}

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

.footer-bottom {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 30px;

    padding-top: 20px;

    border-top: 1px solid var(--border);
}

.footer-bottom p {
    margin: 0;

    color: var(--muted);

    font-size: 0.78rem;
}

.footer-bottom-links {
    display: flex;

    flex-wrap: wrap;

    gap: 14px;
}

.footer-bottom-links a {
    color: var(--muted);

    font-size: 0.78rem;

    text-decoration: none;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* =========================================================
   MOBILE NAVIGATION
========================================================= */

@media (max-width: 700px) {
    .container {
        width: min(100% - 22px, var(--max-width));
    }

    /* -------------------------------------------------------
     HEADER
  ------------------------------------------------------- */

    .site-header {
        position: relative;
    }

    .header-inner {
        position: relative;

        min-height: 58px;

        padding: 8px 0;

        flex-direction: row;
        align-items: center;
        justify-content: space-between;

        gap: 12px;
    }

    .logo {
        margin-right: auto;

        font-size: 1.15rem;
    }

    /* -------------------------------------------------------
     HAMBURGER
  ------------------------------------------------------- */

    .mobile-menu-toggle {
        display: flex;

        margin-left: auto;
    }

    /* -------------------------------------------------------
     MOBILE NAV PANEL
  ------------------------------------------------------- */

    .main-nav {
        display: none;

        position: absolute;

        top: 100%;
        left: 0;
        right: 0;

        z-index: 1500;

        width: 100%;

        flex-direction: column;
        align-items: stretch;

        gap: 3px;

        padding: 8px;

        background: var(--surface);

        border: 1px solid var(--border);
        border-top: 0;

        border-radius: 0 0 12px 12px;

        box-shadow: 0 10px 30px rgba(25, 25, 25, 0.08);

        overflow: visible;
    }

    .main-nav.mobile-open {
        display: flex;
    }

    /* -------------------------------------------------------
     MOBILE NAV LINKS
  ------------------------------------------------------- */

    .main-nav > a,
    .nav-dropdown-toggle {
        width: 100%;

        min-height: 44px;

        justify-content: flex-start;

        padding: 10px 12px;

        font-size: 14px;

        text-align: left;
    }

    /* -------------------------------------------------------
     MOBILE FINANCE
  ------------------------------------------------------- */

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-toggle {
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;

        width: 100%;

        margin: 2px 0 5px;

        padding: 4px;

        border: 0;

        border-radius: 8px;

        background: var(--soft);

        box-shadow: none;
    }

    .nav-dropdown-menu a {
        display: flex;
        align-items: center;

        min-height: 40px;

        padding: 8px 12px;

        font-size: 13px;
    }

    /* -------------------------------------------------------
     PAGE
  ------------------------------------------------------- */

    .breadcrumbs {
        margin: 20px 0;

        font-size: 0.8rem;
    }

    .article {
        padding: 22px 16px;

        border-radius: 10px;

        margin-bottom: 35px;
    }

    /* -------------------------------------------------------
     ARTICLE
  ------------------------------------------------------- */

    h1 {
        font-size: 2.05rem;
    }

    h2 {
        margin-top: 38px;
    }

    .lead {
        font-size: 1rem;
    }

    /* -------------------------------------------------------
     CALCULATOR
  ------------------------------------------------------- */

    .tool-card {
        padding: 20px 15px;

        margin: 32px 0;
    }

    .form-grid {
        grid-template-columns: 1fr;

        gap: 4px;
    }

    /* -------------------------------------------------------
     RESULTS
  ------------------------------------------------------- */

    .result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* -------------------------------------------------------
     CONTENT CARDS
  ------------------------------------------------------- */

    .comparison-card,
    .info-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    /* -------------------------------------------------------
     TABLE
  ------------------------------------------------------- */

    .example-table {
        overflow-x: auto;
    }

    .example-table > div {
        min-width: 420px;
    }

    /* -------------------------------------------------------
     CTA
  ------------------------------------------------------- */

    .cta-card {
        padding: 22px 18px;
    }

    /* -------------------------------------------------------
     FOOTER
  ------------------------------------------------------- */

    .site-footer {
        padding: 30px 0 22px;
    }

    .footer-inner {
        grid-template-columns: 1fr;

        gap: 25px;
    }

    .footer-description {
        max-width: 100%;
    }

    .footer-bottom {
        flex-direction: column;

        align-items: flex-start;

        gap: 12px;

        margin-top: 25px;

        padding-top: 18px;
    }
}

/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 430px) {
    .container {
        width: calc(100% - 20px);
    }

    .header-inner {
        padding: 8px 0;
    }

    .logo {
        font-size: 1.1rem;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }
}

@media (max-width: 400px) {
    .article {
        padding: 20px 14px;
    }

    h1 {
        font-size: 1.9rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .quick-answer {
        padding: 18px 16px;
    }

    .tool-card {
        padding: 17px 13px;
    }

    .result-grid {
        gap: 8px;
    }

    .result-grid > div {
        padding: 11px;
    }

    .result-main strong {
        font-size: 1.75rem;
    }

    .footer-bottom-links {
        gap: 10px;
    }
}
