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

:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --principal: #3b82f6;
    --interest: #f59e0b;
}

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

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

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

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

.calculator-card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

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

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

.input-field {
    position: relative;
}

.input-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.input-with-unit .unit {
    padding: 0.75rem;
    background: var(--border);
    color: var(--text-muted);
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.input-with-unit input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    min-width: 0;
}

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

.input-hint {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-input);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

select:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.payment-result {
    text-align: center;
    margin-bottom: 2rem;
}

.monthly-payment {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-label {
    color: var(--text-muted);
    font-size: 1rem;
}

.payment-amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
}

.loan-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

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

.summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.payment-breakdown {
    margin-bottom: 2rem;
}

.payment-breakdown h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.breakdown-bar {
    display: flex;
    height: 30px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.bar-principal {
    background: var(--principal);
    transition: width 0.3s;
}

.bar-interest {
    background: var(--interest);
    transition: width 0.3s;
}

.breakdown-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.principal { background: var(--principal); }
.dot.interest { background: var(--interest); }

.amortization-section h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.amortization-table {
    background: var(--bg-input);
    border-radius: 0.5rem;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.amort-header, .amort-row {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 2fr;
    padding: 0.75rem 1rem;
}

.amort-header {
    background: var(--border);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.amort-row {
    border-top: 1px solid var(--border);
}

.amort-row:nth-child(even) {
    background: rgba(0,0,0,0.1);
}

.features {
    margin-bottom: 2rem;
}

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

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

.feature {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.2s;
}

.feature:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.faq {
    margin-bottom: 2rem;
}

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

.faq-category {
    margin-bottom: 1.5rem;
}

.faq-category-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

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

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

footer p:first-child {
    color: var(--text);
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .calculator-card { padding: 1.5rem; }
    .input-grid { grid-template-columns: 1fr; }
    .payment-amount { font-size: 2.5rem; }
    .loan-summary { grid-template-columns: 1fr; }
    .amort-header, .amort-row { font-size: 0.85rem; padding: 0.5rem; }
}
