/* ==========================================================================
   DIVERSIFICATION 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;
}

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: 900px;
}

.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 14px;
    max-width: 850px;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.06rem;
}

.hero-summary {
    margin: 0 0 24px;
    max-width: 820px;
    color: rgba(255, 255, 255, 0.9);
}

.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,
.add-row-btn {
    color: var(--text-main);
    background: var(--white);
    border-color: var(--border-color);
}

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

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

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

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

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

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

.section-card p:last-child,
.calculator-card p:last-child,
.snapshot-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 LAYOUT
   ========================================================================== */

.calculator-layout {
    display: grid;
    grid-template-columns: 1.03fr 0.97fr;
    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 small {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.form-group input,
.form-group select,
.entry-table input {
    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,
.entry-table input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

.holdings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-top: 28px;
    margin-bottom: 16px;
}

.holdings-header h3 {
    margin-bottom: 8px;
}

.holdings-header p {
    margin: 0;
    color: var(--text-muted);
}

.holdings-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.entry-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: var(--white);
}

.entry-table th,
.entry-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    text-align: left;
}

.entry-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-main);
}

.entry-table tr:last-child td {
    border-bottom: none;
}

.entry-table td:last-child,
.entry-table th:last-child {
    text-align: center;
    width: 88px;
}

.remove-row-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.remove-row-btn:hover {
    background: #fff5f5;
    color: var(--danger-text);
    border-color: rgba(185, 28, 28, 0.18);
}

.toggle-box {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
}

.check-row input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
}

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

.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-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(1.85rem, 4vw, 2.55rem);
    line-height: 1.1;
    color: var(--primary-blue);
}

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

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

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

.score-badge strong {
    display: block;
    margin-top: 8px;
    font-size: 1.4rem;
    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);
}

.highlight-tile {
    background: #f8fbff;
    border-color: rgba(0, 82, 204, 0.18);
}

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

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

.result-tile small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.results-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 18px;
    padding: 16px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid rgba(194, 65, 12, 0.14);
    color: var(--warning-text);
}

.results-note p {
    margin: 0;
}

.results-action {
    margin-top: 18px;
}

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

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

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

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

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

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

.mini-card,
.comparison-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);
}

.mini-card h3,
.comparison-card h3,
.warning-item h3,
.related-card h3 {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

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

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

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

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrap {
    overflow-x: auto;
    margin: 20px 0 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;
}

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

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

/* ==========================================================================
   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);
}

.faq-answer a {
    color: var(--primary-blue);
}

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

.related-card {
    display: block;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

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

.related-card span {
    font-weight: 700;
    color: var(--primary-blue);
}

.final-cta-card {
    padding: 34px;
    border-radius: 16px;
    background: var(--hero-gradient);
    box-shadow: var(--shadow-md);
    text-align: center;
    color: var(--white);
}

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

.final-cta-card p {
    max-width: 760px;
    margin: 0 auto 22px;
    color: rgba(255, 255, 255, 0.92);
}

.final-cta-card .hero-actions {
    justify-content: center;
}

/* ==========================================================================
   NAV SHADOW
   ========================================================================== */

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

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

@media (max-width: 1100px) {
    .calculator-layout,
    .snapshot-grid,
    .mini-cards.four,
    .related-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding-left: 16px;
        padding-right: 16px;
    }

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

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

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

    .hero-lead,
    .hero-summary {
        font-size: 0.98rem;
    }

    .section-card,
    .calculator-card,
    .snapshot-card,
    .final-cta-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 22px;
    }

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

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

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

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

    .btn {
        width: 100%;
    }

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

    .results-note {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .breadcrumb {
        font-size: 0.85rem;
    }

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

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