/* Tax Credit Stacking Calculator CSS - 2025 Professional Design */
:root {
    /* Primary Color Palette - Tax Credit Theme */
    --primary-color: #204080;
    --secondary-color: #5AC8FA;
    --dark-color: #0056CC;
    --light-color: #E3F2FD;
    
    /* Credit-Specific Colors */
    --credit-blue: #1565c0;
    --credit-green: #2e7d32;
    --credit-orange: #ef6c00;
    --credit-purple: #6a1b9a;
    --credit-pink: #c2185b;
    --credit-teal: #00695c;
    
    /* Status Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* Border and Shadow */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-credits: linear-gradient(135deg, var(--credit-blue) 0%, var(--credit-green) 100%);
    --gradient-stacking: linear-gradient(135deg, var(--credit-orange) 0%, var(--credit-purple) 100%);
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.logo:hover {
    color: var(--dark-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Calculator Header */
.calculator-header {
    text-align: center;
    padding: 3rem 0;
    background: var(--gradient-credits);
    color: white;
    margin-bottom: 3rem;
}

.calculator-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Calculator Navigation Steps */
.calculator-nav {
    margin-top: 2rem;
}

.calculator-steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.calculator-steps li {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.calculator-steps li:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.calculator-steps a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 12px;
}

.step-number {
    background: rgba(255, 255, 255, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.step-title {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Calculator Container */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Input Section */
.input-section {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.input-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--credit-blue);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-section h2::before {
    content: '🧮';
    font-size: 1.5rem;
}

/* Form Sections */
.family-credits,
.education-credits,
.energy-credits,
.other-credits {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    position: relative;
}

.family-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-credits);
    border-radius: 2px 0 0 2px;
}

.education-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--credit-orange) 0%, var(--credit-pink) 100%);
    border-radius: 2px 0 0 2px;
}

.energy-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--credit-green) 0%, var(--credit-teal) 100%);
    border-radius: 2px 0 0 2px;
}

.other-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--credit-purple) 0%, var(--credit-pink) 100%);
    border-radius: 2px 0 0 2px;
}

.family-credits h3,
.education-credits h3,
.energy-credits h3,
.other-credits h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--credit-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.family-credits h3::before { content: '👨‍👩‍👧‍👦'; }
.education-credits h3::before { content: '🎓'; }
.energy-credits h3::before { content: '🔋'; }
.other-credits h3::before { content: '💰'; }

/* Form and Fieldset Styles */
fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

legend {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--credit-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-group label.required::after {
    content: ' *';
    color: var(--error-color);
    font-weight: 700;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--credit-blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.input-group input:hover,
.input-group select:hover {
    border-color: var(--credit-green);
}

.input-group input.error,
.input-group select.error {
    border-color: var(--error-color);
    background-color: rgba(239, 68, 68, 0.05);
}

.input-group small {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
    font-style: italic;
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
    font-weight: 500;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Calculate Button */
.calculate-btn {
    background: var(--gradient-stacking);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    justify-content: center;
    margin-top: 2rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.results-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--credit-blue);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-section h2::before {
    content: '📊';
    font-size: 1.5rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.result-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.result-item.highlight {
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.1) 0%, rgba(46, 125, 50, 0.1) 100%);
    border-color: var(--credit-blue);
    font-weight: 600;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--credit-blue);
    font-family: var(--font-mono);
}

/* Credit Breakdown */
.credit-breakdown {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.credit-breakdown h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--credit-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credit-breakdown h3::before {
    content: '💳';
    font-size: 1.25rem;
}

.breakdown-grid {
    display: grid;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.breakdown-item span:first-child {
    color: var(--text-secondary);
}

.breakdown-item span:last-child {
    font-weight: 600;
    color: var(--credit-blue);
    font-family: var(--font-mono);
}

/* Optimization Section */
.optimization-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(239, 108, 0, 0.1) 0%, rgba(106, 27, 154, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid var(--credit-orange);
}

.optimization-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--credit-orange);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.optimization-section h3::before {
    content: '🎯';
    font-size: 1.25rem;
}

.recommendations-list {
    /* Content will be populated by JavaScript */
}

/* Info Section and Disclaimer */
.info-section {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--credit-blue);
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-card li:last-child {
    border-bottom: none;
}

/* Disclaimer Styles */
.disclaimer {
    margin-top: 3rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid var(--warning-color);
    border-radius: 16px;
    position: relative;
}

.disclaimer::before {
    content: '⚠️';
    position: absolute;
    top: -15px;
    left: 2rem;
    background: var(--bg-primary);
    padding: 0 1rem;
    font-size: 1.5rem;
}

.disclaimer h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning-color);
    margin-bottom: 1.5rem;
}

.disclaimer h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
}

.disclaimer p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.disclaimer ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.disclaimer li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .calculator-header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .input-section,
    .results-section {
        padding: 1.5rem;
    }

    .nav-menu {
        display: none;
    }

    .calculator-steps {
        flex-direction: column;
        align-items: center;
    }

    .info-section {
        grid-template-columns: 1fr;
    }

    .disclaimer {
        padding: 1.5rem;
    }
}

/* Core Web Vitals Optimization */
.calculator-container {
    contain: layout style paint;
}

.input-section,
.results-section {
    will-change: transform;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
input:focus,
select:focus,
button:focus {
    outline: 2px solid var(--credit-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}
