/* --- Styles pour le bouton "Créer ma Tontine" --- */
#ktm-open-popup-btn {
    background-color: #004d00 !important; /* Vert foncé */
    color: #ffffff !important;
    border-radius: 5px !important;
    transition: background-color 0.3s ease !important;
    width: 100%;
    margin-top: 10px;
}

#ktm-open-popup-btn:hover {
    background-color: #006400 !important; /* Vert un peu plus clair */
}

/* --- Styles pour le Popup --- */
#ktm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ktm-popup-content {
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    font-family: sans-serif;
}

#ktm-close-popup-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

.ktm-popup-header {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.ktm-popup-header h2 {
    color: #004d00;
    margin-top: 0;
}
.ktm-popup-header p {
    margin: 5px 0;
    color: #555;
}

/* --- Styles pour les formulaires --- */
.ktm-form-group {
    margin-bottom: 20px;
}
.ktm-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}
.ktm-form-group input,
.ktm-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}

/* --- Styles pour le résultat et le bouton d'action --- */
#ktm-simulation-result {
    background: #e8f5e9; /* Vert très clair */
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}
#ktm-simulation-result h3 { margin-top: 0; color: #004d00; }
.ktm-info { font-size: 0.9em; color: #555; }

#ktm-create-tontine-btn {
    width: 100%;
    padding: 15px;
    background: #006400;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
#ktm-create-tontine-btn:disabled {
    background: #999;
    cursor: not-allowed;
}
#ktm-create-tontine-btn:not(:disabled):hover {
    background: #007a00;
}

/* --- Styles pour les messages de feedback --- */
#ktm-popup-feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
#ktm-popup-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
#ktm-popup-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Style pour les messages de validation en temps réel */
.ktm-validation-feedback {
    font-size: 0.9em;
    color: #c0392b; /* Rouge pour les erreurs */
    margin-top: 5px;
    font-weight: 500;
    display: none; /* Caché par défaut */
}

/* Style pour le bouton de recharge */
.ktm-recharge-btn {
    margin-top: 15px;
    display: inline-block;
    background-color: #006400 !important;
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    border: none !important;
}

/* --- AMÉLIORATION MOBILE : POPUP SCROLLABLE --- */
@media (max-width: 768px) {
    #ktm-popup-content {
        max-height: 85vh; /* La hauteur max est 85% de la hauteur de l'écran */
        overflow-y: auto; /* Ajoute une barre de défilement si le contenu dépasse */
        padding-top: 40px; /* Un peu d'espace en haut pour ne pas coller le titre */
    }
}