/* --- STYLES COMMUNS ET SÉLECTEUR DE DESIGN --- */
.ktm-actions-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}
.ktm-container {
    font-family: 'Poppins', sans-serif;
    padding: 20px 0;
}

.ktm-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2.5em;
    font-weight: 600;
}

.ktm-design-switcher {
    text-align: center;
}

.ktm-design-switcher button {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.ktm-design-switcher button:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.ktm-design-switcher button.active {
    background-color: #7ED321;
    color: #fff;
    border-color: #579912;
}

/* --- DESIGN 1 : MODERNE (Styles existants) --- */

/* Grille pour les cartes */
.ktm-cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Design de la carte de tontine */
.ktm-subscription-card {
    background: #ebffd6;
    border-radius: 15px;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 5px solid #000000;
    border-top: 1px solid #000000;
    border-right: 1px solid #000000;
    border-left: 5px solid #000000; /* Bordure de couleur pour le design */
}

.ktm-subscription-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* Entête de la carte */
.ktm-card-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(52, 152, 219, 0.05); /* Arrière-plan léger */
}

.ktm-card-title {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;
}

.ktm-card-periodicity {
    background: #7ED321;
    color: #000;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Corps de la carte */
.ktm-card-body {
    padding: 30px 25px;
    text-align: center;
    flex-grow: 1;
}

.ktm-card-amount {
    font-size: 4em;
    font-weight: 900;
    color: #27ae60; /* Couleur verte pour le montant */
    margin: 0;
}

.ktm-card-label {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: -20px;
}

/* Section de la barre de progression */
.ktm-card-progress-section {
    padding: 0 25px 20px 25px;
}

.ktm-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #34495e;
}

.ktm-progress-bar-container {
    width: 100%;
    background-color: #000000;
    border-radius: 10px;
    height: 10px;
}

.ktm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

/* Pied de la carte et bouton */
.ktm-card-footer {
    padding: 15px;
    background: #f9f9f9;
}

.ktm-pay-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, #7ED321, #92ff20);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.3s ease, transform 0.2s ease;
}

.ktm-pay-button:hover {
    background: linear-gradient(90deg, #579912, #6ec018);
    transform: scale(1.02);
}

.ktm-pay-button:disabled {
    background: #30500f;
    cursor: not-allowed;
}

.ktm-payment-complete {
    display: block;
    text-align: center;
    color: #23b91c;
    font-weight: 600;
}

/* Responsive pour les mobiles */
@media (max-width: 900px) {
    .ktm-cards-container {
        grid-template-columns: 1fr;
    }
    
    .ktm-container h2 {
        font-size: 2em;
    }
}

/* Messages pour l'utilisateur */
.ktm-login-prompt, .ktm-no-tontine-message {
    text-align: center;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 10px;
    color: #555;
}

/* --- DESIGN 2 : TRADITION (Nouveaux styles) --- */
.ktm-cards-container-tradition {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.ktm-subscription-card-tradition {
    background: #fff;
    border: 1px solid #86ff03;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ktm-subscription-card-tradition:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.ktm-card-header-tradition {
    padding: 20px;
    background-color: #e9ffd1;
    border-bottom: 1px solid #e9ecef;
}

.ktm-card-title-tradition {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    color: #343a40;
}

.ktm-card-amount-tradition {
    font-size: 1em;
    color: #6c757d;
    margin-top: 5px;
}

.ktm-card-body-tradition {
    padding: 25px 20px;
    flex-grow: 1;
}

.ktm-progress-circles {
    display: flex;
    flex-wrap: wrap; /* Permet aux cercles de passer à la ligne */
    gap: 10px; /* Espace entre les cercles */
    margin-bottom: 15px;
}

.ktm-circle {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    transition: background-color 0.4s ease;
}

.ktm-circle-empty {
    background-color: #fff;
    border: 2px solid #000;
}

.ktm-circle-filled {
    background-color: #7ED321;
    border: 2px solid #579912;
}

.ktm-progress-text-tradition {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
}

.ktm-card-footer-tradition {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Le bouton de paiement est partagé, on s'assure qu'il est stylé correctement */
.ktm-pay-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, #7ED321, #92ff20);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.3s ease, transform 0.2s ease;
}

.ktm-pay-button:hover {
    background: linear-gradient(90deg, #579912, #6ec018);
    transform: scale(1.02);
}

.ktm-pay-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.ktm-payment-complete {
    display: block;
    text-align: center;
    color: #27ae60;
    font-weight: 600;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 900px) {
    .ktm-cards-container,
    .ktm-cards-container-tradition {
        grid-template-columns: 1fr; /* 1 carte par ligne sur mobile */
    }
    
    .ktm-container h2 {
        font-size: 2em;
    }
}

#ktm-pdf-download-btn {
    background-color: #c0392b;
    color: #fff;
    border-color: #a93226;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s;
}

#ktm-pdf-download-btn:hover {
    background-color: #a93226;
    color: #fff;
}