
/* Variables de couleurs */
:root {
    --primary-orange: #FF6B35;
    --secondary-orange: #FF8C42;
    --primary-blue: #004E89;
    --secondary-blue: #1A759F;
    --light-blue: #E8F4F8;
    --dark-text: #2C3E50;
    --light-text: #7F8C8D;
}

/* Conteneur principal du calculateur */
.calculator-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 78, 137, 0.3);
    overflow: hidden;
}

/* En-tête du calculateur */
.calculator-header {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.calculator-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.calculator-header h1 {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    position: relative;
    z-index: 1;
}

.calculator-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Sélecteur de produits */
.product-selector {
    background: white;
    padding: 30px 20px;
}

.product-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.product-btn {
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.product-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-orange);
    transition: all 0.5s ease;
    transform: translate(-50%, -50%);
}

.product-btn:hover::before {
    width: 300px;
    height: 300px;
}

.product-btn:hover {
    color: white;
    border-color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.product-btn span {
    position: relative;
    z-index: 1;
}

.product-btn.active {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    color: white;
    border-color: var(--primary-orange);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    transform: scale(1.05);
}

/* Contenu du calculateur */
.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
    background: white;
}

/* Section des entrées */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Conteneurs de sliders */
.slider-container {
    background: var(--light-blue);
    padding: 25px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.slider-container:hover {
    box-shadow: 0 8px 25px rgba(26, 117, 159, 0.15);
    transform: translateY(-2px);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.slider-header h3 {
    color: var(--primary-blue);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.slider-value {
    color: var(--primary-orange);
    font-size: 24px;
    font-weight: 700;
}

/* Sliders stylisés */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(to right, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    outline: none;
    -webkit-appearance: none;
    margin: 15px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    border: 3px solid var(--primary-orange);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    border: 3px solid var(--primary-orange);
    transition: all 0.3s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    color: var(--light-text);
    font-size: 12px;
    margin-top: 8px;
}

/* Container de taux fixe */
.fixed-rate-container {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0, 78, 137, 0.3);
    position: relative;
    overflow: hidden;
}

.fixed-rate-container::after {
    content: '★';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 40px;
    color: rgba(255, 255, 255, 0.1);
}

.fixed-rate-container h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.fixed-rate-value {
    font-size: 56px;
    font-weight: 800;
    color: var(--primary-orange);
    margin: 15px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.fixed-rate-badge {
    background: var(--primary-orange);
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* Info produit */
.product-info {
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-orange);
}

.product-info p {
    margin: 0;
    color: var(--dark-text);
    font-size: 14px;
    line-height: 1.6;
}

.product-info i {
    color: var(--primary-orange);
    margin-right: 10px;
    font-size: 18px;
}

/* Section des résultats */
.result-section {
    background: linear-gradient(135deg, var(--light-blue) 0%, white 100%);
    padding: 40px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    box-shadow: 0 10px 30px rgba(0, 78, 137, 0.1);
}

.emi-result {
    text-align: center;
    background: white;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 78, 137, 0.15);
    border: 3px solid var(--primary-orange);
}

.emi-result h3 {
    color: var(--primary-blue);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 15px 0;
}

.emi-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary-orange);
    margin: 10px 0;
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.2);
}

.detail-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 78, 137, 0.15);
}

.detail-item h3 {
    color: var(--light-text);
    font-size: 13px;
    margin: 0 0 10px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Bouton d'application */
.apply-btn {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    color: white;
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.apply-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.5);
}

.apply-btn:active {
    transform: translateY(-1px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 78, 137, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: var(--light-text);
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--primary-orange);
    transform: rotate(90deg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.modal-header p {
    margin: 0;
    opacity: 0.9;
}

/* Formulaire */
#form-container {
    padding: 40px 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--primary-blue);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--light-blue);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Récapitulatif de prêt */
.loan-summary {
    background: var(--light-blue);
    padding: 25px;
    border-radius: 16px;
    margin: 30px 0;
}

.loan-summary h3 {
    color: var(--primary-blue);
    margin: 0 0 20px 0;
    font-size: 18px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 78, 137, 0.1);
}

.summary-item:last-child {
    border-bottom: none;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid var(--primary-orange);
}

.summary-item span:first-child {
    color: var(--light-text);
    font-size: 14px;
}

.summary-item span:last-child {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 16px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

/* États du formulaire */
.loading,
.error-message,
.confirmation {
    display: none;
    text-align: center;
    padding: 60px 30px;
}

.loading i {
    font-size: 60px;
    color: var(--primary-blue);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message i {
    font-size: 60px;
    color: #e74c3c;
}

.confirmation i {
    font-size: 80px;
    color: #27ae60;
}

.confirmation h2 {
    color: var(--primary-blue);
    margin: 20px 0;
}

.confirmation p {
    color: var(--dark-text);
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 968px) {
    .calculator-content {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    
    .product-buttons {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .detail-results {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .calculator-header h1 {
        font-size: 24px;
    }
    
    .product-buttons {
        grid-template-columns: 1fr;
    }
    
    .slider-value {
        font-size: 20px;
    }
    
    .emi-value {
        font-size: 36px;
    }
    
    .fixed-rate-value {
        font-size: 42px;
    }
}
