/* ==========================================================================
   DIVIDEND INCOME 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.10);
    --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;
}

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;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

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

.container,
.section-card,
.calculator-card,
.intro-card,
.cta-card,
.results-shell,
.results-content,
.results-grid,
.result-tile,
.result-primary,
.results-badge,
.interpretation-card,
.info-callout,
.formula-card {
    min-width: 0;
}

/* Make long result values wrap properly instead of pushing layout wider */
.result-primary h3,
.result-tile strong,
.results-badge strong,
.info-table td,
.info-table th,
#resultNarrative,
#interpretationResult,
#resultsInsight,
#warningResult,
#projectedAnnualIncomeResult,
#annualIncomeResult,
#annualTileResult,
#monthlyTileResult,
#quarterlyTileResult,
#investmentTileResult {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Prevent grid children from overflowing */
.calculator-layout,
.results-grid,
.form-grid,
.formula-strip,
.section-grid,
.comparison-grid,
.example-grid,
.warning-list,
.related-grid,
.mini-cards {
    min-width: 0;
}

.result-tile,
.result-primary,
.results-badge {
    min-width: 0;
}

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.1rem);
    line-height: 1.12;
}

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

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* ==========================================================================
   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(--white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: #f8fbff;
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

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

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

.intro-strip {
    padding: 32px 0 0;
}

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

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

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

.section-card,
.calculator-card,
.cta-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,
.cta-card h2 {
    margin: 0 0 14px;
    font-size: 1.72rem;
    line-height: 1.28;
    color: var(--text-main);
}

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

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

.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);
}

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

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

.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;
}

.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 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);
}

.formula-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

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

.formula-card strong {
    display: block;
    margin-top: 8px;
    line-height: 1.5;
}

.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.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: rgba(4, 120, 87, 0.14);
}

.info-callout.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: rgba(194, 65, 12, 0.14);
}

.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);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

/* ==========================================================================
   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-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.result-primary h3 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.08;
    color: var(--primary-blue);
}

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

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

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

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

.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);
}

.result-tile.emphasis {
    background: #f8fbff;
    border-color: rgba(0, 82, 204, 0.12);
}

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

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

.interpretation-card {
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fcfdff;
    margin-bottom: 18px;
}

.interpretation-card h3 {
    margin-bottom: 8px;
    font-size: 1.08rem;
}

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

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

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

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

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

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

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

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

.mini-cards {
    margin-top: 18px;
}

.mini-cards.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

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

.emphasis-card {
    background: #f8fbff;
    border-color: rgba(0, 82, 204, 0.15);
}

.feature-list {
    margin: 18px 0;
    padding-left: 18px;
}

.feature-list li {
    margin-bottom: 10px;
}

.feature-list.compact {
    margin-top: 12px;
    margin-bottom: 0;
}

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

.info-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

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

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

.assumptions-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.assumptions-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
}

.assumptions-table th,
.assumptions-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.assumptions-table th {
    width: 48%;
}

.assumptions-table td {
    width: 52%;
}

/* ==========================================================================
   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-card {
    display: block;
    color: inherit;
    transition: var(--transition);
}

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

.related-card h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
    color: var(--text-main);
}

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

.cta-card {
    background: var(--hero-gradient);
    color: var(--white);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.cta-card h2,
.cta-card p {
    color: var(--white);
}

.cta-card .hero-actions {
    justify-content: center;
    margin-top: 20px;
}

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

@media (max-width: 1100px) {
    .calculator-layout,
    .section-grid,
    .comparison-grid,
    .example-grid,
    .warning-list,
    .related-grid,
    .mini-cards.four,
    .mini-cards.three,
    .formula-strip {
        grid-template-columns: 1fr;
    }
}

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

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

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

    .form-grid.two-col,
    .results-grid {
        grid-template-columns: 1fr;
    }

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

    .results-badge {
        text-align: left;
        min-width: 0;
    }

    .info-table {
        min-width: 640px;
    }

    .hero-actions,
    .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .calculator-layout,
    .results-grid,
    .form-grid.two-col,
    .formula-strip,
    .section-grid,
    .comparison-grid,
    .example-grid,
    .warning-list,
    .related-grid,
    .mini-cards.three,
    .mini-cards.four {
        grid-template-columns: 1fr;
    }

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

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

    .result-primary h3 {
        font-size: 1.8rem;
        line-height: 1.15;
    }

    .result-tile strong,
    .results-badge strong {
        font-size: 1rem;
        line-height: 1.4;
    }

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

    .assumptions-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .assumptions-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        border-collapse: collapse;
    }
    
    .assumptions-table th,
    .assumptions-table td {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        vertical-align: top;
    }
    
    .assumptions-table th {
        width: 48%;
    }
    
    .assumptions-table td {
        width: 52%;
    }
}

@media (max-width: 520px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-card h2,
    .calculator-card h2,
    .cta-card h2 {
        font-size: 1.45rem;
    }

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

@media (max-width: 480px) {
    .result-primary h3 {
        font-size: 1.6rem;
    }

    .result-tile strong,
    .results-badge strong {
        font-size: 0.96rem;
    }

    .assumptions-table th,
    .assumptions-table td {
        font-size: 0.9rem;
        padding: 10px 8px;
    }
}