/* W4 Withholding Calculator Specific Styles */
:root {
    --primary-color: #204080;
    --secondary-color: #5AC8FA;
    --dark-color: #0056CC;
    --light-color: #E3F2FD;
    --success-color: #48bb78;
    --withholding-color: #7C3AED;
    --planning-color: #059669;
    --warning-color: #F59E0B;
    --error-color: #e53e3e;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-heavy: 0 10px 25px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #204080 0%, #5AC8FA 100%);
    --gradient-withholding: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
    --gradient-planning: linear-gradient(135deg, #059669 0%, #10B981 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

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

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

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

/* Hero Section */
.hero-section {
    background: var(--gradient-withholding);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Section */
.calculator-section {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.calculator-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-heavy);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.calculator-card h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--withholding-color);
    text-align: center;
}

/* Form Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

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

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

.input-field, .select-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: white;
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: var(--withholding-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-field.error, .select-field.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Additional Income Section */
.additional-income-section, .multiple-jobs-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
}

.additional-income-section h4, .multiple-jobs-section h4 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--withholding-color);
    text-align: center;
}

/* Checkbox Styling */
.checkbox-group {
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--withholding-color);
    border-color: var(--withholding-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* W4 Preview */
.w4-preview {
    background: var(--gradient-planning);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    color: white;
}

.w4-preview h4 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    text-align: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.preview-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.preview-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: var(--gradient-withholding);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

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

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

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    display: none;
}

.results-section.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.results-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--withholding-color);
    text-align: center;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--withholding-color);
}

.result-value.planning {
    color: var(--planning-color);
}

.result-value.warning {
    color: var(--warning-color);
}

.result-value.success {
    color: var(--success-color);
}

.result-item.highlight {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    padding: 1.25rem;
    border-radius: 8px;
    border: none;
    margin: 1rem 0;
}

/* Info Section */
.info-section {
    padding: 4rem 0;
    background: white;
}

.info-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--withholding-color);
    text-align: center;
}

.info-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--withholding-color);
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.info-section ul, .info-section ol {
    margin: 1rem 0 2rem 1.5rem;
    color: var(--text-secondary);
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Withholding Box */
.withholding-box {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border-left: 4px solid var(--withholding-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.withholding-box h4 {
    color: var(--withholding-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.step-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.step-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--withholding-color);
}

.step-card p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Changes Grid */
.changes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.change-item {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--planning-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.change-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.change-item h4 {
    color: var(--planning-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.strategy-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.strategy-card h4 {
    color: var(--withholding-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.strategy-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.strategy-card li {
    margin-bottom: 0.5rem;
}

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

.mistake-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid var(--error-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

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

.mistake-card h4 {
    color: var(--error-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Comparison Table */
.comparison-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.comparison-table th {
    background: var(--withholding-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.comparison-table tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Safe Harbor Rules */
.safe-harbor-rules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.rule-card {
    background: var(--gradient-warning);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.rule-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.rule-card p {
    opacity: 0.9;
    font-size: 0.95rem;
    margin: 0;
}

/* Special Situations */
.special-situations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.situation-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.situation-card h4 {
    color: var(--withholding-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
    border-left: 4px solid var(--secondary-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.highlight-box h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Related Calculators */
.related-calculators {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.related-calculators h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--withholding-color);
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.related-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
}

.related-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--withholding-color);
}

.related-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: white;
}

.faq-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--withholding-color);
    text-align: center;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--withholding-color);
    transition: all 0.3s ease;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: none;
}

.faq-answer.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--withholding-color);
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.modal-button {
    background: var(--gradient-withholding);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .calculator-card {
        padding: 2rem 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 15px;
    }
    
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .calculator-section,
    .info-section,
    .related-calculators,
    .faq-section {
        padding: 3rem 0;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
    
    .safe-harbor-rules {
        grid-template-columns: 1fr;
    }
    
    .steps-grid,
    .strategy-grid,
    .mistake-grid,
    .special-situations {
        grid-template-columns: 1fr;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem;
    }
} 