/**
 * SFAR - Checkout Multi-Step Styles
 * Design basé sur la maquette SFAR
 */

#pmpro_form .pmpro_form_submit{
    flex-direction: row-reverse !important;
}

#pmpro_submit_span{
    max-width: 500px;
}

/* Style pour pmpro_pricing_fields présent sur tous les onglets */
#pmpro_pricing_fields.pmpro_card, #pmpro_form{
    background-color: #e7ecff !important;
    margin-top: 0;
}

/* Masquer le deuxième bloc #pmpro_user_fields (Your Name) pour les utilisateurs connectés */
#pmpro_user_fields ~ #pmpro_user_fields {
    display: none !important;
}

/* Navigation par onglets - Style SFAR */
.sfar-tabs-navigation {
    display: flex;
    justify-content: space-between;
    /* align-items: flex-start; */
    gap: 20px;
    /* margin-bottom: 40px; */
    /* padding: 30px 20px 0px; */
    padding: 0;
    background-color: #fff;
    position: relative;
    width: 100%;
}

/* Ligne de progression entre les onglets */
/* .sfar-tabs-navigation::before {
    content: '';
    position: absolute;
    top: 60px;
    left: 80px;
    right: 80px;
    height: 2px;
    background: #E2E8F0;
    z-index: 0;
} */

.sfar-tab {
    font-family: Roboto;
    color: #273466;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* padding: 10px; */
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    max-width: 280px;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
}

.sfar-tab:hover .sfar-tab-icon {
    transform: scale(1.05);
}

/* Onglet actif */
.sfar-tab.active .sfar-tab-icon i {
    color: #4A5568;
}

.sfar-tab.active .sfar-tab-title {
    color: #4A5568;
    font-weight: 600;
}

.sfar-tab.active {
    background-color: #e7ecff;
}

/* Onglet complété */
.sfar-tab.completed .sfar-tab-icon i {
    color: #09cec3;
}

.sfar-tab.completed .sfar-tab-title {
    color: #09cec3;
    font-weight: bold;
}

/* Icône de l'onglet */
.sfar-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding-left: 15px;
    background: transparent;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.sfar-tab-icon i {
    font-size: 14px;
    color: #A0AEC0;
    transition: all 0.3s ease;
}

/* Titre de l'onglet */
.sfar-tab-title {
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    color: #A0AEC0;
    transition: all 0.3s ease;
    white-space: nowrap;
    padding: 20px 20px 20px 0px;
}

/* Boutons de navigation - Style SFAR */
.sfar-step-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 30px;
    padding: 20px 20px 20px 20px;
    border-top: none;
    flex: 0 1 auto;
}

/* Conteneur des boutons PMPro pour mieux contrôler l'affichage */
.pmpro_submit {
    margin-top: 0 !important;
    border-top: none !important;
}

.pmpro_submit span,
#pmpro_submit_span {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
}

.sfar-btn {
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    text-transform: none;
}

.sfar-btn-prev {
    background: #E2E8F0;
    color: #4A5568;
}

.sfar-btn-prev:hover {
    background: #CBD5E0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sfar-btn-next {
    background: #09cec3;
    color: #ffffff;
    margin-left: auto;
}

.sfar-btn-next:hover {
    background: #00B8BA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 206, 209, 0.3);
}

/* .sfar-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
} */

/* Styler le bouton de soumission PMPro pour qu'il soit cohérent */
#pmpro_btn-submit {
    padding: 14px 40px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border: none !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 200px !important;
    background: #09cec3 !important;
    color: #ffffff !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    margin-right: 15px !important;
}

#pmpro_btn-submit:hover {
    background: #00B8BA !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 206, 209, 0.3);
}

/* Messages d'erreur améliorés */
.pmpro_error_msg {
    display: block;
    color: #d32f2f;
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

input.pmpro_error,
select.pmpro_error,
textarea.pmpro_error {
    border-color: #d32f2f !important;
    background-color: #fff3f3 !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* 2 colonnes sur tablette */
    .pmpro_card_content,
    .pmpro_form_fields,
    fieldset.pmpro_form_fieldset .pmpro_card_content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

@media (max-width: 768px) {
    /* 1 colonne sur mobile */
    .pmpro_card_content,
    .pmpro_form_fields,
    fieldset.pmpro_form_fieldset .pmpro_card_content {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .sfar-tabs-navigation {
        flex-wrap: wrap;
        gap: 15px;
        padding: 0px 10px;
    }

    .sfar-tabs-navigation::before {
        display: none;
    }

    .sfar-tab {
        /* min-width: calc(50% - 10px); */
        max-width: calc(50% - 10px);
        flex: 0 0 calc(50% - 10px);
        flex-direction: column;
        gap: 8px;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
    }

    .sfar-tab-icon {
        padding: 15px;
    }

    .sfar-tab-icon i {
        font-size: 16px;
    }

    .sfar-tab-title {
        /* On masque sur mobile */
        display: none;
        /* font-size: 11px;
        text-align: center;
        white-space: normal; */
    }

    .sfar-step-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .sfar-btn {
        width: 100%;
        margin-left: 0 !important;
    }

    .sfar-btn-next {
        order: 1;
    }

    .sfar-btn-prev {
        order: 2;
    }

    #pmpro_form fieldset.pmpro_form_fieldset {
        padding: 20px 15px;
        border-radius: 8px;
    }

    #pmpro_form fieldset.pmpro_form_fieldset legend h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .sfar-tab {
        /* min-width: 100%; */
        /* max-width: 100%; */
        flex: auto;
    }

}

/* Style des fieldsets - Fond bleu pâle comme dans le design SFAR */
/* On cible aussi particulièrement paiement par chèque qui n'était pas en bleu (plugin séparé) */
#pmpro_form fieldset.pmpro_form_fieldset, #pmpro_form .pmpro_card.pmpro_check_instructions {
    background: #e7ecff;
    border: none;
    border-radius: 12px;
    /* padding: 30px; */
    /* margin-bottom: 20px; */
    box-shadow: none;
}


#pmpro_form fieldset.pmpro_form_fieldset .pmpro_card {
    background: transparent;
    box-shadow: none;
}

#pmpro_form fieldset.pmpro_form_fieldset legend h2, #pmpro_check_instructions h2 {
    Font-family: Roboto;
    color: #273466;
    font-size: 22pt;
    font-weight: 600;
}

#pmpro_form fieldset.pmpro_form_fieldset .pmpro_form_field .pmpro_form_label {
    Font-family: Roboto;
    color: #273466;
    font-size: 14pt;
    font-weight: 600;
}

/* ============================================
   SYSTÈME FLEXBOX - Largeur personnalisable par champ
   ============================================ */

/* Container principal : Flexbox avec wrap - OVERRIDE PMPro column */
.pmpro_form_fields,
.pmpro_card_content,
fieldset.pmpro_form_fieldset .pmpro_card_content {
    display: flex !important;
    flex-direction: row !important;  /* IMPORTANT : Override le column de PMPro */
    flex-wrap: wrap !important;
    gap: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* S'assurer que PMPro ne force pas column */
.pmpro .pmpro_form_fields {
    flex-direction: row !important;
}

/* S'assurer que le fieldset lui-même ne déborde pas */
fieldset.pmpro_form_fieldset,
.pmpro_card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* IMPORTANT: Neutraliser les wrappers pmpro_cols-2 qui interfèrent avec Flexbox
   Le wrapper pmpro_cols-2 est utilisé par PMPro pour grouper Password/Confirm Password
   et Email/Confirm Email. Avec display: contents, le wrapper devient "transparent"
   et nos classes pmpro-w-* fonctionnent correctement sur les champs enfants. */
#pmpro_user_fields .pmpro_cols-2.pmpro-wrapper-override,
.pmpro_form_fields .pmpro_cols-2.pmpro-wrapper-override {
    display: contents !important;
    /* display: contents fait que le wrapper n'existe pas pour le layout,
       ses enfants se comportent comme s'ils étaient directement dans le parent flexbox */
}

/* Alternative si display: contents pose problème (certains navigateurs anciens) :
   Transformer le wrapper en conteneur flex lui-même */
/* #pmpro_user_fields .pmpro_cols-2.pmpro-wrapper-override,
.pmpro_form_fields .pmpro_cols-2.pmpro-wrapper-override {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    width: 100% !important;
    flex: 0 0 100% !important;
} */

/* Comportement par défaut : chaque champ = 25% (4 par ligne) */
.pmpro .pmpro_form_field {
    /* display: flex !important; */
    flex-direction: column !important;
    flex: 0 0 calc((100% - 60px) / 4) !important;  /* 4 champs avec 3 gaps de 20px */
    min-width: 0;  /* Évite overflow */
    box-sizing: border-box !important;
}

/* On force les champs caché par PMPRO à rester caché malgré le !important du flex ci-dessus : */
/* Plusieurs variations pour couvrir différents formats */
/* div.pmpro .pmpro_form_field[style*="display: none"]{
    border: 1px solid blue;
} */

/* Boutons radio pour paiement par chèque ou virement */
/* .pmpro_form_field.pmpro_form_field-radio{ */
/* #pmpro_payment_method .pmpro_form_field.pmpro_form_field-radio-item.gateway_stripe */
#pmpro_payment_method .pmpro_form_field.pmpro_form_field-radio {
    flex: 100% !important;
}
#pmpro_payment_method .pmpro_form_field-radio-items.pmpro_cols-2{
    display: block;
}

#radio_param_membre_fnir_div .pmpro_form_field.pmpro_form_field-radio-item{
    flex-direction: row !important;
}


.pmpro_form_field.pmpro_form_field-radio-item.gateway_stripe, .pmpro_form_field.pmpro_form_field-radio-item.gateway_check{
    flex-direction: row !important;
    /* flex: auto !important;
    display: block !important; */
}

/* ============================================
   CLASSES DE LARGEUR PERSONNALISÉES
   ============================================ */

/* 1/4 de ligne (25%) - 4 champs par ligne */
.pmpro .pmpro_form_field.pmpro-w-25 {
    flex: 0 0 calc((100% - 60px) / 4) !important;  /* 4 champs avec 3 gaps de 20px */
}

/* 1/3 de ligne (33.33%) - 3 champs par ligne */
.pmpro .pmpro_form_field.pmpro-w-33 {
    flex: 0 0 calc((100% - 40px) / 3) !important;  /* 3 champs avec 2 gaps de 20px */
}

/* 1/2 de ligne (50%) - 2 champs par ligne */
.pmpro .pmpro_form_field.pmpro-w-50 {
    flex: 0 0 calc((100% - 20px) / 2) !important;  /* 2 champs avec 1 gap de 20px */
}

/* 2/3 de ligne (75%) - 1 champ par ligne */
.pmpro .pmpro_form_field.pmpro-w-75 {
    flex: 0 0 calc((100% - 25px)) !important;  /* 1 champ avec 1 gap de 25px */
}

/* Pleine largeur (100%) - 1 champ par ligne */
.pmpro .pmpro_form_field.pmpro-w-100,
.pmpro .pmpro_form_field.pmpro_full-width {
    flex: 0 0 100% !important;
}

/* On force à 100% la largeur pour les cols-2 sur la création de compte */
.width-100{
    width: 100% !important;
}

/* ============================================
   RETOUR À LA LIGNE FORCÉ
   ============================================ */

.pmpro-spacer {
    height: 0px; /* Ajustez la hauteur selon vos besoins */
    width: 100%;
    clear: both;
}

/* Force le champ suivant à passer à la ligne suivante */
/* .pmpro .pmpro_form_field.pmpro-break-after { */
    /* margin-right: auto !important; */
    /* flex-basis: 100% !important; */
/* } */

/* Alternative plus robuste avec pseudo-élément invisible */
/* .pmpro .pmpro_form_field.pmpro-break-after::after {
    content: '';
    flex-basis: 100% !important;
    width: 0;
    height: 0;
    overflow: hidden;
} */

/* ============================================
   ÉLÉMENTS TOUJOURS EN PLEINE LARGEUR
   ============================================ */

/* Les champs HTML prennent toute la largeur */
.pmpro_form_fields .pmpro_form_field.pmpro_form_field-html,
.pmpro_card_content .pmpro_form_field.pmpro_form_field-html,
fieldset.pmpro_form_fieldset .pmpro_card_content .pmpro_form_field.pmpro_form_field-html,
.pmpro .pmpro_form_field[class*="html"],
.pmpro .pmpro_form_field[id*="intro"],
.pmpro .pmpro_form_field[id*="rgpd"],
.pmpro .pmpro_form_field[id*="explication"] {
    flex: 1 1 100% !important;  /* flex-grow: 1 pour occuper tout l'espace */
    width: 100% !important;
    max-width: 100% !important;
}

/* Pseudo-élément invisible qui force le retour à la ligne */
.pmpro_form_field.pmpro_form_field-html::after,
.pmpro_form_field[id*="intro"]::after,
.pmpro_form_field[id*="rgpd"]::after,
.pmpro_form_field[id*="explication"]::after {
    content: '';
    flex-basis: 100%;
    width: 0;
    height: 0;
    order: 1;
}

/* Cibler spécifiquement les divs avec id */
div[id*="intro_"],
div[id*="rgpd_"],
div[id*="explication_"] {
    flex: 1 1 100% !important;
    width: 100% !important;
}

/* Legend */
.pmpro_form_fields legend,
.pmpro_card_content .pmpro_form_legend {
    flex: 1 1 100% !important;
    width: 100% !important;
}

/* Assurer que les containers parents respectent la largeur */
.pmpro_card_content,
.pmpro_card,
.pmpro_checkout_form,
#pmpro_form_1 {
    width: 100% !important;
}

/* ============================================
   RESPONSIVE : TABLETTE (2 champs par ligne)
   ============================================ */
@media (max-width: 1024px) {
    .pmpro_form_fields,
    .pmpro_card_content,
    fieldset.pmpro_form_fieldset .pmpro_card_content {
        gap: 15px !important;
    }

    /* Par défaut : 2 champs par ligne sur tablette */
    .pmpro .pmpro_form_field {
        flex: 0 0 calc((100% - 15px) / 2) !important;  /* 2 champs avec 1 gap de 15px */
    }

    .pmpro .pmpro_form_field.pmpro-w-25,
    .pmpro .pmpro_form_field.pmpro-w-33,
    .pmpro .pmpro_form_field.pmpro-w-50 {
        flex: 0 0 calc((100% - 15px) / 2) !important;  /* 2 champs avec 1 gap de 15px */
    }

    .pmpro .pmpro_form_field.pmpro-w-100,
    .pmpro .pmpro_form_field.pmpro_full-width {
        flex: 0 0 100% !important;
    }
}

/* ============================================
   RESPONSIVE : MOBILE (1 champ par ligne)
   ============================================ */
@media (max-width: 768px) {
    
    .pmpro_form_fields,
    .pmpro_card_content,
    fieldset.pmpro_form_fieldset .pmpro_card_content {
        gap: 12px !important;
    }

    /* Tous les champs en pleine largeur sur mobile */
    .pmpro .pmpro_form_field,
    .pmpro .pmpro_form_field.pmpro-w-25,
    .pmpro .pmpro_form_field.pmpro-w-33,
    .pmpro .pmpro_form_field.pmpro-w-50,
    .pmpro .pmpro_form_field.pmpro-w-100,
    .pmpro .pmpro_form_field.pmpro_full-width {
        flex: 0 0 100% !important;
    }

    .pmpro_cols-2{
        display: block !important;
        width: 100%;
    }


}
    
/* Animation de transition entre steps */
#pmpro_form fieldset {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#pmpro_pricing_fields{
    display: none !important;
}
.pmpro .pmpro_card{
    border: none !important;
}
.orange {
    color : #fc5c3d;
}
/* , #montant_inscription */
#montant_inscription_div{
    display: inline !important;
    font-family: Roboto;
    color: #273466;
    font-size: 14pt;
    font-weight: 600;
    border-radius: 10px;
    background-color: white;
    padding: 15px;
    border: 1px solid #273466;
    flex: none !important;
    width: auto !important;
}

#pmpro_user_fields .pmpro_card_actions{
    color : #fc5c3d;
}
#pmpro_user_fields .pmpro_card_actions a{
    color : #fc5c3d;
    border-radius :25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

label[for="checkbox_param_pack_educationnel"] {
    color: #10c2b8 !important;
    font-size: 14pt !important;
}
