* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8fafc;
}

/* Header */
header {
    background: #1e3a5f;
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
}
header .logo {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}
header nav {
    margin-top: 0;
}
header nav a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 16px;
    font-size: 15px;
}
header nav a:hover { color: #fff; }

/* Container */
.container {
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Typography */
h1 { font-size: 28px; color: #1e3a5f; margin-bottom: 8px; }
h2 { font-size: 20px; color: #1e3a5f; margin-bottom: 12px; }
h3 { font-size: 16px; color: #1e3a5f; margin-bottom: 4px; }
.subtitle { color: #64748b; margin-bottom: 24px; font-size: 15px; }

/* Forms */
label {
    display: block;
    font-weight: 600;
    margin: 16px 0 6px;
    font-size: 14px;
    color: #334155;
}
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { resize: vertical; min-height: 120px; }

/* Buttons */
button {
    margin-top: 20px;
    padding: 12px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}
button:hover { background: #1d4ed8; }
button:active { transform: scale(0.99); }

/* Result box */
.result-box {
    margin-top: 24px;
    padding: 20px;
    background: #eff6ff;
    border-radius: 6px;
    font-size: 18px;
    min-height: 40px;
}
.result-box strong { color: #1e3a5f; font-size: 24px; }

/* Content sections */
.content-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}
.content-section p, .content-section li {
    color: #475569;
    font-size: 15px;
    margin-bottom: 10px;
}
.content-section ul { padding-left: 20px; }
.content-section a { color: #2563eb; }

/* FAQ */
.faq-item { margin-bottom: 16px; }
.faq-item p { color: #475569; font-size: 15px; }

/* Calculator grid (homepage) */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.calc-card {
    display: block;
    padding: 18px;
    background: #f1f5f9;
    border-radius: 8px;
    text-decoration: none;
    color: #1e3a5f;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    transition: background 0.15s, border-color 0.15s;
}
.calc-card:hover {
    background: #e0e7ff;
    border-color: #2563eb;
}

/* Tables (amortization) */
.table-wrap {
    margin-top: 24px;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}
th {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}
th:first-child, td:first-child { text-align: left; }

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: #64748b;
    font-size: 14px;
}
footer a { color: #2563eb; text-decoration: none; margin: 0 8px; }
footer a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav { margin-top: 8px; }
    header nav a { margin-left: 0; margin-right: 14px; }
    .container { padding: 20px; margin: 16px; border-radius: 0; }
    h1 { font-size: 22px; }
    h2 { font-size: 18px; }
    .result-box { font-size: 16px; }
    .result-box strong { font-size: 20px; }
    th, td { padding: 8px 4px; font-size: 13px; }
    .calc-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .calc-card { padding: 14px; font-size: 14px; }
}