/* 401k Calculator Styles */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #10b981;
    --accent: #f59e0b;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --success: #10b981;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.updated {
    font-size: 0.875rem;
    color: var(--accent);
    margin-top: 0.5rem;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 1.25rem;
}

/* Input Rows */
.input-row {
    margin-bottom: 1rem;
}

.input-row label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    color: var(--text);
    width: 100%;
}

.input-wrapper input:focus {
    outline: none;
}

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

.input-suffix {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.2);
}

.currency-input {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.currency-symbol {
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.currency-input input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem 0.75rem 0;
    font-size: 1.1rem;
    color: var(--text);
}

.currency-input input:focus {
    outline: none;
}

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

/* Contribution/Match Display */
.contribution-amount,
.match-explanation {
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.contribution-amount strong,
.match-explanation strong {
    color: var(--primary-light);
}

.limit-note,
.match-note {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.5rem;
}

/* Error message */
.error-message {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.5rem;
}

/* Match helper text */
.match-helper {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.match-helper p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
}

.result-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-hero .result-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.result-hero .result-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
}

.result-hero .result-age {
    display: block;
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.result-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
}

.result-card.match {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
}

.result-card.growth {
    border-color: var(--primary);
    background: rgba(5, 150, 105, 0.1);
}

.result-card-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-card-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.result-card.match .result-card-value {
    color: var(--accent);
}

.result-card.growth .result-card-value {
    color: var(--primary-light);
}

.result-card-note {
    display: block;
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.25rem;
}

/* Chart */
.chart-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, #1e3a5f, #0d2137);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.cta-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.cta-box p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.cta-button {
    display: inline-block;
    background: var(--accent);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Limits Box */
.limits-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.limits-box h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 700px) {
    .limits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.limit-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: 8px;
}

.limit-item.highlight {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--accent);
}

.limit-item .limit-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.limit-item .limit-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
}

.limit-item.highlight .limit-value {
    color: var(--accent);
}

.limit-item .limit-note {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.limits-source {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.limits-source a {
    color: var(--primary-light);
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.faq-item {
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background: rgba(255,255,255,0.03);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.2s;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

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

.faq-answer.open {
    max-height: 500px;
}

.faq-answer p,
.faq-answer ul {
    padding: 0 1.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.faq-answer ul {
    padding-left: 2.5rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

.faq-answer strong {
    color: var(--text);
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--primary-light);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    font-size: 0.75rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .result-hero .result-value {
        font-size: 2.25rem;
    }

    .container {
        padding: 1rem;
    }
}
