/**
 * CDC FRONTEND CSS - Version simplifiée
 * Sans animations, sans doublons, compatible Android
 */

/* ===== VARIABLES GLOBALES ===== */
:root {
    /* Couleurs principales */
    --cdc-primary: #002CB2;
    --cdc-secondary: #85929e;
    --cdc-success: #10b981;
    --cdc-warning: #f59e0b;
    --cdc-danger: #ef4444;
    --cdc-info: #3b82f6;
    
    /* États */
    --cdc-bg-normal: #ffffff;
    --cdc-border-normal: #e7e7e7;
    --cdc-text-normal: #000000;
    
    --cdc-bg-hover: #e7e7e7;
    --cdc-border-hover: #cacaca;
    --cdc-text-hover: #002CB2;
    
    --cdc-bg-active: #002CB2;
    --cdc-border-active: #002CB2;
    --cdc-text-active: #ffffff;
    
    /* Espacements */
    --cdc-spacing-xs: 4px;
    --cdc-spacing-sm: 8px;
    --cdc-spacing-md: 16px;
    --cdc-spacing-lg: 24px;
    --cdc-spacing-xl: 32px;
    
    /* Bordures */
    --cdc-radius-sm: 4px;
    --cdc-radius-md: 8px;
    --cdc-radius-lg: 12px;
    --cdc-radius-full: 50px;
}

/* ===== RESET DE BASE ===== */
.cdc-form-container *,
.cdc-form-container *::before,
.cdc-form-container *::after {
    box-sizing: border-box;
}

/* ===== CONTENEUR PRINCIPAL ===== */
.cdc-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.cdc-form {
    font-family: inherit;
}

/* ===== SECTIONS ===== */
.cdc-section {
    background: var(--cdc-bg-normal);
    border-radius: var(--cdc-radius-md);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cdc-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    color: var(--cdc-text-normal);
}

/* ===== CHAMPS DE FORMULAIRE ===== */
.cdc-field {
    margin-bottom: 16px;
}

.cdc-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--cdc-text-normal);
}

.cdc-field input[type="text"],
.cdc-field input[type="email"],
.cdc-field input[type="tel"],
.cdc-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cdc-border-normal);
    border-radius: var(--cdc-radius-sm);
    background: var(--cdc-bg-normal);
    color: var(--cdc-text-normal);
    font-size: inherit;
}

.cdc-field input:focus,
.cdc-field select:focus {
    outline: none;
    border-color: var(--cdc-primary);
    box-shadow: 0 0 0 3px rgba(0, 44, 178, 0.1);
}

/* ===== GRILLE 2 COLONNES ===== */
.cdc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ===== STYLE UNIFIÉ POUR TOUS LES BOUTONS ===== */
.cdc-btn-unified,
.cdc-partenaire-btn label,
.cdc-payment-btn label,
.cdc-btn-semestre label,
.cdc-role-emoji-btn label,
.cdc-type-btn label {
    display: inline-block;
    padding: 12px 32px;
    background: var(--cdc-border-normal);
    border: 2px solid var(--cdc-border-normal);
    border-radius: var(--cdc-radius-full);
    color: var(--cdc-text-normal);
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

/* État hover (desktop only) */
@media (hover: hover) {
    .cdc-btn-unified:hover,
    .cdc-role-emoji-btn label:hover,
    .cdc-partenaire-btn label:hover,
    .cdc-payment-btn label:hover,
    .cdc-btn-semestre label:hover,
    .cdc-type-btn label:hover {
        background: var(--cdc-bg-hover);
        border-color: var(--cdc-border-active);
        color: var(--cdc-text-hover);
    }
}

/* État actif/sélectionné */
input:checked + label,
.cdc-btn-unified.selected {
    background: var(--cdc-bg-active);
    border-color: var(--cdc-border-active);
    color: var(--cdc-text-active);
}

/* Cas spécial: Follower */
.cdc-role-emoji-btn input[value="follower"]:checked + label {
    background: #ff207a;
    border-color: #ff207a;
    color: #ffffff;
}

/* État désactivé */
.cdc-btn-unified:disabled,
.cdc-btn-unified.disabled,
label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== CONTENEURS DE BOUTONS ===== */
.cdc-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.cdc-btn-container {
    position: relative;
}

.cdc-btn-container input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ===== SECTIONS SPÉCIFIQUES ===== */

/* Conteneur principal pour l'alignement horizontal */
.cdc-roles-partner-line {
    align-items: center;
    gap: 40px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* Groupe des boutons Follower/Leader */
.cdc-roles-emoji {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;  /* margin auto pour centrer */
    min-widthe: 180px;
    max-width: 600px;  /* Limite la largeur si souhaité */
}

/* Style individuel des boutons rôles */
.cdc-role-emoji-btn {
    position: relative;
    display: inline-block;
}

.cdc-role-emoji-btn input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    pointer-events: all;
}

.cdc-role-emoji-btn label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    white-space: nowrap;
}

/* Bouton partenaire */
.cdc-partenaire-btn {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;  /* margin auto pour centrer */
    max-width: 600px;  /* Limite la largeur si souhaité */
}

.cdc-partenaire-btn input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    pointer-events: all;
}

.cdc-partenaire-btn label {
    white-space: nowrap;
    min-width: 380px;
}

.cdc-partenaire-section {
margin-top: 20px;
}

/* Responsive - passage en colonne sur mobile */
@media (max-width: 768px) {
    .cdc-roles-partner-line {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .cdc-roles-emoji {
       /* width: 100%;*/
        justify-content: center;
    }
    
    .cdc-partenaire-btn label {
        width: 100%;
        text-align: center;
    }
}

/* ===== STYLES SPÉCIFIQUES ===== */
/* Emojis dans les boutons */
.emoji {
    font-size: 1.1em;
    margin-right: 5px;
    vertical-align: middle;
}



/* Modes de paiement */
.cdc-payment-methods {
   /* display: grid;*/
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.cdc-payment-btn {
    position: relative;
}

/* ===== COURS ET CRÉNEAUX ===== */
.cdc-style-block {
    margin-bottom: 20px;
    border-radius: var(--cdc-radius-md);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--cdc-bg-normal);
}

.cdc-style-header {
    padding: 16px 24px;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

.cdc-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 16px 24px;
}

.cdc-accordion-icon {
    font-size: 24px;
    font-weight: bold;
}

.cdc-creneaux-container {
    display: none;
}

.cdc-creneaux-container.active {
    display: block;
}

.cdc-creneau {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.cdc-creneau:last-child {
    border-bottom: none;
}

.cdc-ligne-cours {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.cdc-plus {
    color: #666;
    font-weight: bold;
    font-size: 14px;
}
.cdc-reduction {
    color: #10b981;
    font-weight: 600;
    font-size: 13px;
    display: none;
    white-space: nowrap;
}

.cdc-boutons-semestre {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cdc-btn-semestre {
    position: relative;
}

.cdc-btn-semestre input {
    position: absolute;
    opacity: 0;
}

.cdc-btn-semestre label {
    font-size: 0.875rem;
    padding: 6px 18px;
}

/* ===== RÉCAPITULATIF PRIX ===== */
.cdc-price-summary {
    background: var(--cdc-bg-normal);
    border-radius: var(--cdc-radius-md);
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cdc-price-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.cdc-price-total {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 2px solid var(--cdc-text-normal);
    font-size: 1.125rem;
    font-weight: 700;
}

/* ===== MESSAGES ===== */
.cdc-success,
.cdc-error,
.cdc-warning {
    padding: 16px;
    border-radius: var(--cdc-radius-sm);
    margin-bottom: 20px;
}

.cdc-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.cdc-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ===== VALIDATION ===== */
.error-field {
    border-color: var(--cdc-danger) !important;
}

/* ===== UTILITAIRES ===== */
.cdc-text-center { text-align: center; }
.cdc-text-left { text-align: left; }
.cdc-text-right { text-align: right; }
.cdc-font-bold { font-weight: 700; }
.cdc-hidden { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cdc-form-container {
        padding: 0 15px;
    }
    
    .cdc-section {
        padding: 20px;
    }
    
    .cdc-row {
        grid-template-columns: 1fr;
    }
    
   
    
    .cdc-payment-methods {
        grid-template-columns: 1fr;
    }
    
    .cdc-ligne-cours {
     flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .cdc-button-group {
        flex-direction: column;
    }
    
    .cdc-btn-unified,
    .cdc-btn-container label {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cdc-form-container {
        padding: 0 10px;
    }
    
    .cdc-section {
        padding: 15px;
    }
    
    .cdc-btn-unified,
    .cdc-btn-container label {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* ===== FIX SPÉCIFIQUE ANDROID ===== */
@supports (-webkit-appearance: none) {
    input[type="radio"],
    input[type="checkbox"] {
        -webkit-appearance: none;
        appearance: none;
    }
    
    .cdc-btn-unified,
    .cdc-btn-container label {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }
}

/* ===== IMPRESSION ===== */
@media print {
    .cdc-btn-unified,
    .cdc-button-group,
    .cdc-submit-button {
        display: none !important;
    }
    
    .cdc-section {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ===== INPUTS RADIO/CHECKBOX CACHÉS ===== */
.cdc-btn-container input[type="radio"],
.cdc-btn-container input[type="checkbox"],
.cdc-role-emoji-btn input[type="radio"],
.cdc-partenaire-btn input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ===== CHECKBOXES VISIBLES (RGPD, etc.) ===== */
.cdc-checkbox-label input[type="checkbox"] {
    /* Ces checkbox doivent rester visibles */
    position: static;
    opacity: 1;
    pointer-events: auto;
    appearance: auto;
    -webkit-appearance: checkbox;
    margin-right: 8px;
}

/* Info box adhésion */
.cdc-info-box {
    background: #e8f4ff;
    border: 1px solid #90caf9;
    padding: 12px 16px;
    border-radius: var(--cdc-radius-sm);
    margin: 16px 0;
    font-size: 0.95rem;
}

/* Texte d'aide */
.cdc-help-text {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Section cours */
#section-cours {
    margin: 20px 0;
}

/* Ajustement responsive pour les rôles */
@media (max-width: 768px) {
    .cdc-roles-partner-line {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .cdc-roles-emoji {
       /* width: 100%;*/
        flex-direction: row;
        justify-content: center;
    }
    
    .cdc-partenaire-btn {
        width: 100%;
    }
    
    .cdc-partenaire-btn label {
        width: 100%;
        justify-content: center;
    }
}

/* ===== CHECKBOX RGPD ET AUTRES ===== */
.cdc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    cursor: pointer;
}

.cdc-checkbox-label input[type="checkbox"] {
    position: static;
    opacity: 1;
    margin-top: 3px;
    flex-shrink: 0;
}

.cdc-checkbox-label span {
    flex: 1;
}

/* Checkbox partenaire membre */
.cdc-checkbox-partenaire-membre {
    margin: 15px 0;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--cdc-radius-sm);
}