:root {
    --primary-color: #3b5df6;
    --bg-color: #f4f7f6;
    --text-color: #1f2937;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto 2rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background-color: #2546d1;
}

.summary-box {
    padding: 20px;
    background: #e8f4fd;
    border-radius: 8px;
    text-align: center;
}

.results-table {
    max-width: 1000px;
    margin: 0 auto;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

th {
    background: #f8f9fa;
}

/* Aligner les montants à droite (Mensualité, Intérêts, Assurance, Capital, etc.) */
#amortizationTable th:nth-child(n+4),
#amortizationTable td:nth-child(n+4) {
    text-align: right;
}

/* Autoriser le retour à la ligne pour la colonne Date (pour le différé sur 2 lignes) */
#amortizationTable td:nth-child(2) {
    white-space: normal;
}

#amortizationTable th:nth-child(5),
#amortizationTable td:nth-child(5) {
    min-width: 110px;
}

.rate-tier {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.secondary-btn {
    background-color: #64748b;
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.secondary-btn:hover {
    background-color: #475569;
}

.radio-group input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.chart-container {
    max-width: 1000px;
    margin: 0 auto 2rem;
}

.prepayment-item input {
    border-color: #cbd5e1;
}