/* ==========================================================================
   CASH FLOW CALCULATOR PAGE
   ========================================================================== */

   :root {
    --primary-blue: #0052cc;
    --hero-gradient: linear-gradient(135deg, #0061ff 0%, #0033aa 100%);
    --bg-light: #f8fafc;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --warning-bg: #fff7ed;
    --warning-text: #c2410c;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --info-bg: #eff6ff;
    --info-text: #1d4ed8;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--white);
    line-height: 1.7;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
canvas {
    display: block;
    max-width: 100%;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 16px;
    margin: 0 auto;
}

.section-padding {
    padding: 64px 0;
}

.section-spacing {
    margin-top: 32px;
}

.bg-light {
    background: var(--bg-light);
}

.hidden {
    display: none !important;
}

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

.hero {
    background: var(--hero-gradient);
    color: var(--white);
    padding: 30px 0 72px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    margin-bottom: 26px;
    opacity: 0.95;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.94);
}

.breadcrumb .current {
    color: rgba(255, 255, 255, 0.86);
}

.hero-content {
    max-width: 860px;
}

.hero h1 {
    margin: 0 0 16px;
    color: var(--white);
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.12;
}

.hero-lead {
    margin: 0;
    max-width: 860px;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.05rem;
}

/* ==========================================================================
   INTRO
   ========================================================================== */

.intro-strip {
    padding-top: 28px;
    padding-bottom: 0;
}

.intro-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px 28px;
}

.intro-card p {
    margin: 0;
    color: var(--text-main);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: #0046b3;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.final-cta .btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.36);
}

.final-cta .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
}

.button-row,
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   CARDS / GENERIC
   ========================================================================== */

.section-card,
.calculator-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px;
}

.section-card h2,
.calculator-card h2 {
    margin: 0 0 14px;
    font-size: 1.72rem;
    line-height: 1.28;
    color: var(--text-main);
}

.section-card h3,
.calculator-card h3,
.section-card h4,
.calculator-card h4 {
    margin-top: 0;
    color: var(--text-main);
}

.section-card p:last-child,
.calculator-card p:last-child {
    margin-bottom: 0;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.card-heading p {
    margin: 0;
    color: var(--text-muted);
}

.card-heading h2 {
    margin-bottom: 8px;
}

.card-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 14px;
    background: rgba(0, 82, 204, 0.08);
    color: var(--primary-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mini-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dark-label {
    color: var(--primary-blue);
}

.formula-card {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid rgba(0, 82, 204, 0.14);
    border-radius: 12px;
    background: #f8fbff;
}

.formula-card p {
    margin: 0;
    font-size: 1.03rem;
}

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

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    gap: 24px;
    align-items: start;
}

.calculator-card {
    min-width: 0;
}

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

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-main);
    font: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.mini-note {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fbfdff;
}

.mini-note h3 {
    margin: 0 0 6px;
    font-size: 0.98rem;
}

.mini-note p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.info-callout {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.info-callout p {
    margin: 0;
}

.info-callout.neutral {
    background: #f8fbff;
}

.info-callout.subtle {
    background: #fcfdff;
}

.form-message {
    display: none;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    font-weight: 600;
}

.form-message.error {
    display: block;
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(185, 28, 28, 0.14);
}

.form-message.success {
    display: block;
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(4, 120, 87, 0.14);
}

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

.results-placeholder {
    text-align: center;
    padding: 42px 18px;
}

.placeholder-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(0, 82, 204, 0.08);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
}

.results-content {
    min-width: 0;
}

.results-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.result-primary {
    min-width: 0;
}

.result-primary h3 {
    margin: 8px 0 10px;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.1;
    color: var(--primary-blue);
    word-break: break-word;
}

.result-primary p {
    margin: 0;
    color: var(--text-muted);
}

.status-badge {
    min-width: 160px;
    padding: 16px;
    text-align: right;
    border-radius: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.status-badge .badge-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.status-badge strong {
    display: block;
    margin-top: 8px;
    font-size: 1.52rem;
    color: var(--text-main);
}

.status-badge.positive {
    background: var(--success-bg);
    border-color: rgba(4, 120, 87, 0.14);
}

.status-badge.positive strong {
    color: var(--success-text);
}

.status-badge.tight {
    background: var(--warning-bg);
    border-color: rgba(194, 65, 12, 0.14);
}

.status-badge.tight strong {
    color: var(--warning-text);
}

.status-badge.negative {
    background: var(--danger-bg);
    border-color: rgba(185, 28, 28, 0.14);
}

.status-badge.negative strong {
    color: var(--danger-text);
}

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

.result-tile {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    min-width: 0;
}

.result-tile span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.93rem;
}

.result-tile strong {
    font-size: 1.15rem;
    color: var(--text-main);
    word-break: break-word;
}

.result-tile.income {
    background: #f8fbff;
}

.result-tile.expense {
    background: #fffaf7;
}

.result-tile.annual {
    background: #fbfdff;
}

.summary-table-wrap,
.table-wrap {
    overflow-x: auto;
    margin: 20px 0;
    -webkit-overflow-scrolling: touch;
}

.summary-table,
.info-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.summary-table th,
.summary-table td,
.info-table th,
.info-table td {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.summary-table th,
.info-table th {
    background: #f1f5f9;
    font-weight: 700;
}

.summary-table tbody tr.total-row td {
    font-weight: 700;
    background: #fbfdff;
}

.summary-table tbody tr.income-row td:first-child {
    color: #0369a1;
}

.summary-table tbody tr.expense-row td:first-child {
    color: #b45309;
}

.summary-table tbody tr.net-row td:first-child {
    color: var(--primary-blue);
}

.insight-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.insight-card {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fbfdff;
}

.insight-card h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.insight-card p {
    margin: 0;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
}

/* ==========================================================================
   CONTENT LAYOUTS
   ========================================================================== */

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

.summary-feature-grid,
.comparison-grid,
.warning-list,
.related-grid,
.mini-cards {
    display: grid;
    gap: 16px;
}

.summary-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.summary-feature,
.comparison-card,
.warning-item,
.mini-card {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
}

.comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.warning-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.mini-cards.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.mini-card {
    background: var(--bg-light);
}

.warning-item {
    background: #fffdfa;
}

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

.faq-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.faq-item {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
}

.faq-question {
    width: 100%;
    border: none;
    background: var(--white);
    color: var(--text-main);
    padding: 18px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    background: #f8fbff;
}

.faq-question i {
    color: var(--text-muted);
    transition: transform 0.25s ease;
    flex: 0 0 auto;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    background: #fcfdff;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    margin: 0;
    padding: 0 20px 20px;
    color: var(--text-muted);
}

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

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

.related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.related-card h3 {
    margin: 0;
    font-size: 1.04rem;
}

.related-card p {
    margin: 0;
    color: var(--text-muted);
    flex: 1;
}

.related-card span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-blue);
}

.final-cta {
    padding: 40px 32px;
    border-radius: 16px;
    background: var(--hero-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.final-cta h2 {
    margin: 0 0 12px;
    color: var(--white);
}

.final-cta p {
    margin: 0 0 20px;
    max-width: 820px;
    color: rgba(255, 255, 255, 0.92);
}

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

@media (max-width: 1100px) {
    .calculator-layout,
    .section-grid,
    .summary-feature-grid,
    .note-grid,
    .related-grid,
    .mini-cards.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .section-padding {
        padding: 52px 0;
    }

    .calculator-layout,
    .section-grid,
    .summary-feature-grid,
    .comparison-grid,
    .warning-list,
    .related-grid,
    .note-grid,
    .results-grid,
    .mini-cards.four,
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .results-top {
        flex-direction: column;
        align-items: stretch;
    }

    .status-badge {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .section-card,
    .calculator-card,
    .intro-card,
    .final-cta {
        padding: 22px;
    }

    .hero {
        padding: 24px 0 56px;
    }

    .hero h1 {
        font-size: clamp(1.9rem, 7vw, 2.7rem);
    }

    .button-row,
    .cta-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .container {
        padding: 0 14px;
    }

    .breadcrumb {
        font-size: 0.86rem;
    }

    .result-primary h3 {
        font-size: 2rem;
    }

    .summary-table,
    .info-table {
        min-width: 560px;
    }
}