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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 30px;
}

section {
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

.results-section {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e0e0e0;
}

.result-card.highlight {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.result-card.total {
    background: #e3f2fd;
    border-left-color: #2196f3;
    font-weight: 600;
}

.result-card.success {
    background: #e8f5e9;
    border-left-color: #4caf50;
    font-weight: 600;
    font-size: 1.1rem;
}

.result-label {
    color: #555;
    font-weight: 500;
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.info-box {
    margin-top: 24px;
    padding: 20px;
    background: #e8eaf6;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-box h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 6px 0;
    color: #555;
}

.info-box li:before {
    content: "• ";
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

footer {
    background: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #e0e0e0;
}

/* Bouton info */
.btn-info {
    background-color: #e7f3ff;
    color: #0066cc;
    border: 1px solid #0066cc;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-info:hover {
    background-color: #0066cc;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #000;
}

/* Tranches */
.tranches-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tranche-card {
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid;
    transition: all 0.3s ease;
}

.tranche-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tranche-0 {
    background-color: #d4edda;
    border-color: #28a745;
}

.tranche-11 {
    background-color: #d1ecf1;
    border-color: #17a2b8;
}

.tranche-30 {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.tranche-41 {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.tranche-45 {
    background-color: #e2d5f0;
    border-color: #6f42c1;
}

.tranche-range {
    font-size: 14px;
    color: #666;
}

.tranche-taux {
    font-size: 24px;
    font-weight: bold;
}

.tranche-label {
    font-size: 12px;
    color: #666;
    text-align: right;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 20px;
    }

    .result-value {
        font-size: 1.1rem;
    }
    
    .modal-content {
        margin: 10% 20px;
        padding: 20px;
    }
    
    .tranche-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    header > div {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .btn-info {
        width: 100%;
    }
}
