/* Simulateurs Les Échos - Styles */

.simulateur-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.simulateur-container h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.simulateur-exemple {
    background: #f8f9fa;
    padding: 20px;
    border-left: 4px solid #3498db;
    margin-bottom: 30px;
    border-radius: 4px;
}

.simulateur-exemple h4 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
}

.simulateur-exemple p {
    color: #555;
    font-style: italic;
    margin: 0;
}

.simulateur-form {
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.btn-submit {
    background: #3498db;
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
}

.btn-submit:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.simulateur-loading {
    text-align: center;
    padding: 20px;
    color: #3498db;
    font-style: italic;
}

.simulateur-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.simulateur-resultat {
    background: #e8f5e9;
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid #4caf50;
    margin-top: 30px;
}

.simulateur-resultat h4 {
    color: #2e7d32;
    font-size: 20px;
    margin-bottom: 15px;
}

.resultat-content {
    color: #1b5e20;
    font-size: 16px;
    line-height: 1.6;
}

.resultat-content strong {
    color: #1b5e20;
    font-size: 22px;
}

.resultat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.resultat-table th,
.resultat-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.resultat-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #2c3e50;
}

.resultat-table tr:hover {
    background: #f9f9f9;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    border-left: 5px solid #c62828;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .simulateur-container {
        padding: 20px;
        margin: 15px;
    }
    
    .simulateur-container h3 {
        font-size: 20px;
    }
    
    .btn-submit {
        width: 100%;
        max-width: none;
    }
}

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.simulateur-resultat {
    animation: fadeIn 0.5s ease;
}

/* État de chargement du bouton */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Styles pour les champs invalides */
.form-group input:invalid:not(:placeholder-shown),
.form-group select:invalid {
    border-color: #e74c3c;
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 5px;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Tableaux d'amortissement du webservice */
.exempleResultat {
    margin-bottom: 2rem;
}

.exempleResultat h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.exempleResultat .res {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Tableau d'amortissement */
.table1, .table, .table-bordered, .table-hover {
    width: 100%;
    margin-top: 2rem;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.table1 caption, caption {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 1rem;
    text-align: left;
    caption-side: top;
}

.table1 thead th {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
}

.table1 tbody td {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    text-align: right;
}

.table1 tbody td:first-child {
    text-align: center;
    font-weight: 600;
}

.table1 tbody tr:hover {
    background: #f8f9fa;
}

.table1 tbody tr:last-child {
    background: #e9ecef;
    font-weight: 600;
}

.table1 tbody tr:last-child td {
    border-top: 2px solid var(--primary-color);
}
