/* Wealth Formula Calculator Styles - High Contrast Redesign */
.section-wealth-formula {
    background-color: #0a1128;
    /* Deep Midnight Blue */
    color: #ffffff;
    padding: 64px 0;
    text-align: center;
}

/* The base theme adds extra padding via .section--padding-top/bottom.
   Clamp spacing specifically for this section to avoid huge empty areas on desktop. */
.section-wealth-formula.section--padding-top {
    padding-top: 56px !important;
}

.section-wealth-formula.section--padding-bottom {
    padding-bottom: 56px !important;
}

/* Premium Card Styles */
.wealth-card {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    max-width: 1200px;
    padding: 44px;
    margin: 24px auto;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .section-wealth-formula.section--padding-top {
        padding-top: 44px !important;
    }

    .section-wealth-formula.section--padding-bottom {
        padding-bottom: 24px !important;
    }

    /* Desktop: use more horizontal space */
    .wealth-card {
        max-width: 1320px;
        width: min(92vw, 1320px);
        padding: 44px 56px;
        margin: 14px auto 10px;
    }
}

.wealth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.03), transparent 70%);
    pointer-events: none;
}

@media screen and (min-width: 1024px) {
    .wealth-card-content {
        max-width: 1100px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        gap: 36px;
        text-align: center;
    }

    .wealth-inputs-column,
    .wealth-result-column {
        width: 100%;
    }

    .wealth-card h2,
    .wealth-card p {
        text-align: center;
    }
}

/* Milestones */
.milestones-container {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    text-align: left;
}

.milestone-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.milestone-target {
    font-size: 1.2rem;
    font-weight: 800;
    color: #34d399;
    display: block;
}

.milestone-time {
    font-size: 0.9rem;
    opacity: 0.7;
}

.motivation-text {
    margin-top: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.target-highlight {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
}

.wealth-card h2 {
    color: #ffffff !important;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.wealth-card p {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 1.1rem;
    margin-bottom: 22px;
}

.wealth-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-item {
    margin-bottom: 24px;
    text-align: left;
}

.form-item label {
    display: block;
    color: #ffffff !important;
    font-weight: 500;
    margin-bottom: 10px;
}

.wealth-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    width: 100%;
    font-size: 1.15rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wealth-form input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #34d399;
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}

/* Currency selector */
.wealth-currency__options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wealth-currency__option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wealth-currency__option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #34d399;
}

.wealth-currency__option span {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.wealth-unit {
    opacity: 0.9;
}

/* Inline validation (no browser alert) */
.wealth-form input.wealth-field-error {
    border-color: rgba(248, 113, 113, 0.95) !important;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18) !important;
}

.wealth-inline-error {
    margin-top: 12px;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: left;
}

.wealth-rates-block {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 20px 18px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.wealth-rates-block:not([hidden]) {
    animation: wealth-rates-reveal 0.35s ease-out;
}

@keyframes wealth-rates-reveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wealth-form input.wealth-rate-input {
    font-size: 1.05rem;
    max-width: 280px;
}

.wealth-form input.wealth-rate-input::-webkit-outer-spin-button,
.wealth-form input.wealth-rate-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wealth-form input.wealth-rate-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.projection-container {
    height: 480px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Detailed Chart & Disclaimer Styles */
.risk-disclosure {
    margin-top: 40px;
    padding: 24px;
    background: rgba(245, 158, 11, 0.05);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    text-align: left;
}

.risk-disclosure h4 {
    color: #f59e0b;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.risk-disclosure p {
    font-size: 14px !important;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 0 !important;
}

.consultation-offer {
    margin-top: 30px;
    text-align: center;
}

.consultation-btn {
    display: inline-block;
    background: #34d399;
    color: #0a1128;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(52, 211, 153, 0.2);
}

.consultation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(52, 211, 153, 0.4);
    color: #000;
}

/* Blue variant for white sections (About block CTA) */
.consultation-btn.consultation-btn--blue {
    background: #0b2a4a !important;
    color: #fff !important;
    border-color: #0b2a4a !important;
    box-shadow: 0 10px 20px rgba(11, 42, 74, 0.18);
}

.consultation-btn.consultation-btn--blue:hover {
    background: #0a2440 !important;
    color: #fff !important;
    box-shadow: 0 15px 30px rgba(11, 42, 74, 0.26);
}

/* Ensure internal text stays white even if theme styles target spans */
.consultation-btn.consultation-btn--blue .button-text,
.consultation-btn.consultation-btn--blue .button-underline {
    color: #fff !important;
    border-color: #fff !important;
}

/* Debt/Savings Toggle */
.wealth-toggle-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.wealth-toggle-btn {
    padding: 10px 30px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wealth-toggle-btn.active {
    background: #ffffff;
    color: #0a1128;
    border-color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.wealth-result-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wealth-result {
    margin-top: 0;
    padding: 40px;
    border-radius: 24px;
    display: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.wealth-result.active {
    display: block;
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.category-wealth {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.category-poor {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.category-bankrupt {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.category-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.category-message {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.category-formula {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 24px;
    border-radius: 8px;
    margin: 20px 0;
    display: inline-block;
    color: #34d399;
    /* Emerald Green */
    font-weight: bold;
}

.category-recommendation {
    font-style: italic;
    opacity: 0.8;
}

/* Chart Styling */
.projection-container {
    margin-top: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

/* Primary calculator CTAs — larger tap targets */
.section-wealth-formula #wealth-calc-btn.button {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 18px 36px !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    border-radius: 999px;
}

/* Make the main calculate CTA match the hero pill styling */
.section-wealth-formula #wealth-calc-btn.hero-cta-button {
    max-width: 22rem;
    padding: 1.05rem 2.2rem !important;
    font-size: 1.05rem !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
    min-height: 0;
}

/* Grand motivation + confetti companion */
.motivation-wrap {
    position: relative;
}

.motivation-text--celebrate {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.5;
    color: #fefce8;
    text-shadow:
        0 0 20px rgba(251, 191, 36, 0.55),
        0 0 48px rgba(52, 211, 153, 0.35);
    animation: wealth-celebrate 2.8s ease-in-out infinite;
}

.motivation-text--celebrate .target-highlight {
    color: #fde047;
    font-weight: 900;
}

@keyframes wealth-celebrate {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.01);
        filter: brightness(1.08);
    }
}

#projectionChart {
    width: 100% !important;
    max-height: 400px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .wealth-card {
        padding: 30px 20px;
    }

    .wealth-card h2 {
        font-size: 1.75rem;
    }

    .wealth-toggle-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Gamification steps + calculating overlay */
.wealth-step[hidden] {
    display: none !important;
}

.wealth-lead {
    font-size: 1.15rem;
    line-height: 1.55;
}

#wealth-step-intro .wealth-intro-copy {
    max-width: 54rem;
    margin: 0 auto 8px;
    text-align: center;
}

#wealth-step-intro .wealth-intro-text {
    font-size: 1.125rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 1rem;
}

#wealth-step-intro .wealth-intro-text--secondary {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0;
}

.wealth-link-back {
    display: inline-block;
    margin-bottom: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.wealth-link-back:hover {
    color: #34d399;
}

.wealth-calculating {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 32px;
    background: rgba(10, 17, 40, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wealth-calculating[hidden] {
    display: none !important;
}

.wealth-calculating__inner {
    text-align: center;
    padding: 32px;
    max-width: 360px;
}

.wealth-calculating__spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #34d399;
    border-radius: 50%;
    animation: wealth-spin 0.85s linear infinite;
}

@keyframes wealth-spin {
    to {
        transform: rotate(360deg);
    }
}

.wealth-calculating__label {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0;
}

.wealth-narrative__p {
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1rem;
}

.wealth-result-actions {
    margin-top: 24px;
    text-align: center;
}

.wealth-invest-impact {
    margin-top: 18px;
}

.wealth-invest-impact__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
}

.wealth-invest-impact__heading {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 18px;
}

.wealth-invest-impact__panel {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px 18px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 180px;
    justify-content: center;
}

.wealth-invest-impact__title {
    font-weight: 700;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.92);
}

.wealth-invest-impact__label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 4px;
}

.wealth-invest-impact__value {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: rgba(148, 163, 184, 0.98);
    word-break: break-word;
    margin-top: 8px;
}

.wealth-invest-impact__value--invest {
    color: rgba(52, 211, 153, 0.98);
}

.wealth-invest-impact__summary {
    margin-top: 46px;
    text-align: center;
    padding: 0 10px;
    font-size: 1rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    word-break: break-word;
}

.wealth-invest-impact__pdf {
    margin-top: 14px;
    text-align: center;
}

.wealth-invest-impact__pdf .hero-cta-button {
    max-width: 26rem;
}

@media (min-width: 900px) {
    .wealth-invest-impact__grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
        align-items: stretch;
    }

    .wealth-invest-impact__value {
        font-size: 2.5rem;
    }
}

/* Intro CTA: uses the same hero pill button */
.wealth-intro-cta {
    margin-top: 20px;
    text-align: center;
}

button.wealth-intro-btn.hero-cta-button {
    width: 100%;
    max-width: 22rem;
    border: 0;
    cursor: pointer;
}