:root {
    --primary-color: #204080;
    --secondary-color: #5AC8FA;
    --dark-color: #0056CC;
    --light-color: #E3F2FD;
    --error-color: #e53e3e;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --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%);
}

* {
    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-primary);
    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: 600px;
    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(--primary-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(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 64, 128, 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;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: var(--gradient-primary);
    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(--primary-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-item.highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e3f2fd 100%);
    padding: 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 2px solid var(--secondary-color);
}

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

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

/* Deduction breakdown */
.deduction-breakdown {
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.deduction-breakdown h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Payment schedule table */
.payment-schedule {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.payment-schedule th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.payment-schedule td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.payment-schedule td:first-child {
    text-align: left;
}

.payment-schedule tr:last-child td {
    border-bottom: none;
}

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

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

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

.info-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--primary-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;
}

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

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

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

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

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

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

.related-calculators h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--primary-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(--primary-color);
}

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

/* Warning/Alert Boxes */
.warning-box {
    background: #fef2f2;
    border-left: 4px solid var(--error-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.warning-box h4 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.info-box {
    background: #f0f9ff;
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.info-box h4 {
    color: var(--primary-color);
    margin-bottom: 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;
}

/* Amortization chart styles */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.chart-container h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Savings visualization */
.savings-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f0fff4 0%, #dcfce7 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border: 2px solid var(--success-color);
}

.savings-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success-color);
}

.savings-description {
    font-size: 1rem;
    color: var(--text-secondary);
}

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

/* 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;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .payment-schedule {
        font-size: 0.9rem;
    }
    
    .payment-schedule th,
    .payment-schedule td {
        padding: 0.75rem 0.5rem;
    }
    
    .savings-visual {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .calculator-section,
    .info-section,
    .related-calculators {
        padding: 3rem 0;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .payment-schedule {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
} 