/* ==========================================================================
   VARIABLES ET CONFIGURATION GÉNÉRALE
   ========================================================================== */
:root { 
    --primary-color: #a80000; 
    --secondary-color: #2c3e50; 
    --accent-color: #008c8c; 
    --success-green: #28a745; 
}

body { 
    font-family: 'Open Sans', sans-serif; 
    background-color: #f4f7f6; 
    color: #333; 
    margin: 0; 
    padding: 20px; 
    line-height: 1.4; 
}

a { 
    text-decoration: none; 
}

/* Conteneurs principaux */
#wrapper { 
    width: 1000px; 
    margin: 0 auto; 
    background: #FFF; 
    box-shadow: 0 0 15px rgba(0,0,0,0.1); 
}

.container { 
    max-width: 900px; 
    margin: 0 auto; 
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}

/* Espacements généraux */
.content-padding { 
    padding: 25px 40px; 
    text-align: center; 
}

.footer-spacer { 
    margin-top: 20px; 
    border-top: 1px solid #eee; 
    padding-top: 20px; 
}

.footer-wrap { 
    text-align: center; 
    padding-bottom: 20px; 
}

/* ==========================================================================
   HEADER, INFOS ET STATISTIQUES
   ========================================================================== */
header { 
    border-bottom: 3px solid #008c8c; 
    padding: 15px 0; 
    text-align: center; 
    margin-bottom: 20px;
}

header img { 
    max-width: 50%; 
    height: auto; 
    margin-bottom: 10px; 
}

header h1 { 
    font-size: 28px; 
    color: #008c8c; 
    margin: 5px 0 0 0; 
    font-weight: 700; 
}

.header-title h4 { 
    margin: 5px 0; 
    font-size: 24px; 
    color: var(--primary-color); 
    text-transform: uppercase; 
}

.header-title h3 { 
    margin: 0; 
    font-size: 20px; 
    color: #444; 
}

.barre-stats { 
    font-size: 14px; 
    color: #666; 
    margin-top: 10px; 
    font-weight: 600; 
    text-align: center; 
}

.barre-stats strong { 
    color: var(--primary-color); 
}

.info-age-bandeau { 
    background-color: #f1f4f8; 
    border: 1px solid #d1d9e6; 
    border-radius: 5px; 
    padding: 10px 15px; 
    margin: 10px auto 25px auto; 
    display: block; 
    font-size: 14px; 
    color: #444; 
    text-align: center; 
    max-width: 80%; 
}

.bandeau-orga { 
    background: var(--secondary-color); 
    color: #fff; 
    padding: 10px; 
    border-radius: 5px; 
    margin-top: 10px; 
}

/* Encadré d'information dossier/panier */
.info-box { 
    background-color: #fdfdfd; 
    border-radius: 10px; 
    padding: 30px; 
    margin-bottom: 25px; 
    border: 1px solid #eee; 
    /* Note : La bordure haute dynamique (status_color) doit être gérée en inline HTML */
}

.info-box h3, .info-box h4 { 
    margin-top: 0; 
}

/* ==========================================================================
   FORMULAIRE ET CHAMPS
   ========================================================================== */
fieldset { 
    border: none; 
    border-top: 2px solid #eee; 
    padding-top: 15px; 
    margin-top: 15px; 
}

legend { 
    font-weight: 700; 
    color: var(--accent-color); 
    padding: 0 10px; 
    font-size: 18px; 
    text-transform: uppercase; 
}

.form-group { 
    margin-bottom: 15px; 
    display: flex; 
    align-items: center; 
    flex-wrap: wrap; 
}

label { 
    min-width: 200px; 
    font-weight: 700; 
    font-size: 14px; 
}

input[type="text"], input[type="date"], input[type="email"], 
input[type="tel"], input[type="number"] { 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    width: 100%; 
    max-width: 350px; 
    box-sizing: border-box; 
}

.champs-obligatoires { 
    margin: 20px 0 5px 0; 
    font-size: 13px; 
    font-weight: bold; 
    color: #666; 
}

/* Cible le bloc solo ET tous les blocs duo (info-pps-mineur_1, info-pps-mineur_2, etc.) */
#info-pps-mineur, 
div[id^="info-pps-mineur_"] {
    background-color: #e3f2fd;
    border-left: 5px solid #2196f3;
    color: #0d47a1;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* --- LOGIQUE DES BOUTONS RADIO --- */
.radio-group-horizontal {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-grow: 1;
}

.radio-group-horizontal label {
    min-width: auto !important;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.radio-group-horizontal input[type="radio"] {
    margin-right: 8px;
    width: auto;
}

.radio-group { 
    display: flex !important; 
    gap: 12px; 
    align-items: center; 
    flex-wrap: wrap; 
}

.radio-group label {
    min-width: auto !important;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
    width: auto !important;
}

/* --- Rappel Catégorie Équipe (Duo/Quattro) --- */
.rappel-categorie-container {
    display: none; /* Géré par le JS */
    margin: 20px 0;
    background: #fdfdfd;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.rappel-categorie-wrapper {
    display: flex;
    align-items: center;
    max-width: 1000px;
}

.rappel-categorie-label {
    width: 200px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rappel-categorie-badge-box {
    flex: 1;
}

.rappel-categorie-badge {
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 15px;
    display: inline-block;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Version Mobile responsive */
@media (max-width: 768px) {
    .rappel-categorie-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .rappel-categorie-label {
        width: 100%;
    }
    .rappel-categorie-badge-box,
    .rappel-categorie-badge {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   BOUTONS ET ACTIONS GÉNÉRALES
   ========================================================================== */
.file-input { display: none !important; }

/* Boutons Standards (Hérités de ton ancien style de récapitulatif) */
.btn { 
    display: inline-block; 
    width: 400px; 
    padding: 16px 0; 
    font-size: 15px; 
    color: #ffffff; 
    background-color: #424242; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 700; 
    text-transform: uppercase; 
    transition: all 0.3s; 
    margin-bottom: 15px; 
    text-align: center; 
}
.btn:hover { 
    background-color: #008c8c; 
    transform: translateY(-2px); 
}
.btn-secondary { 
    background-color: #666; 
}

/* Bouton Noir Parcourir / Retourner */
.btn-browse { 
    background: #424242; 
    color: #fff; 
    padding: 8px 18px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 13px; 
    display: inline-block; 
    transition: all 0.15s ease-in-out; 
    font-weight: 700; 
    border: 2px solid #424242; 
    text-transform: uppercase;
}

.btn-browse:hover { 
    background: #000; 
    border-color: var(--accent-color); 
    transform: translateY(-2px); 
}

/* Boutons de téléchargements et d'activation JS */
.btn-success-active { 
    background-color: #28a745 !important; 
    border-color: #1e7e34 !important; 
    box-shadow: 0 4px 0 #19692c; 
}

.btn-danger-active {
    background-color: #dc3545 !important; 
    color: white !important;
    border-color: #bd2130 !important;
    animation: shake 0.5s; 
}

/* Gros bouton de validation classique du bas */
.btn-submit { 
    background: var(--accent-color); 
    color: white; 
    border: 4px solid transparent; 
    padding: 18px 40px; 
    font-size: 22px; 
    font-weight: 800; 
    border-radius: 50px; 
    cursor: pointer; 
    width: 100%; 
    margin-top: 20px; 
    transition: all 0.1s;
}

.btn-submit:hover { 
    background: var(--primary-color); 
    border-color: #ffffff; 
    box-shadow: 0 0 0 3px var(--accent-color); 
}

/* ==========================================================================
   ALIGNEMENT ET PLACEMENT DES ELEMENTS DE FORMULAIRE
   ========================================================================== */
.btn-browse + span, 
.btn-browse + font,
.btn-browse + i {
    margin-left: 20px !important;
    vertical-align: middle;
    color: #666;
}

.form-group a {
    display: inline-block;
    margin-left: 205px; 
    margin-top: 10px; 
    font-size: 0.85em;
    text-decoration: none;
    color: var(--accent-color);
    width: 100%; 
}

.form-group .help-icon, 
.form-group i {
    margin-left: 10px;
    vertical-align: middle;
}

/* ==========================================================================
   HARMONISATION DES BLOCS JUSTIFICATIFS (PPS, AUTORISATION, LICENCE)
   ========================================================================== */

/* Ajustement du label pour lui permettre de passer sur 2 lignes */
.justificatif-container .form-group label:first-child {
    min-width: 200px !important;     /* Largeur de base pour l'alignement */
    max-width: 200px !important;     /* Limite la largeur pour forcer le texte à aller à la ligne */
    display: inline-block !important;
    vertical-align: middle !important;
    white-space: normal !important;   /* 👈 FORCE le retour à la ligne automatique */
    word-wrap: break-word !important; /* Découpe les mots longs si nécessaire */
    line-height: 1.3 !important;      /* Resserre un peu les deux lignes pour le design */
    margin-bottom: 0 !important;   
}

/* 1. Réduction de l'espace sous le groupe pour rapprocher le lien bleu du texte gris */
.justificatif-container .form-group {
    margin-bottom: 2px !important; 
}

/* 2. Style et taille du texte de format (Ligne grise du haut) */
.justificatif-container .format-info {
    display: block !important;
    font-size: 11px !important;    /* Taille réduite */
    font-style: italic !important;
    color: #999999 !important;
    margin-top: 8px !important;      
    margin-bottom: 0px !important;   
    padding-left: 200px !important;  /* Aligné avec tes inputs */
}

/* 3. Style et positionnement du conteneur du lien d'aide (Ligne du bas) */
.justificatif-container .lien-aide {
    display: block !important;
    margin-top: 0px !important;    
    padding-top: 0px !important;
    padding-left: 200px !important;  /* Aligné avec le texte du haut */
}

/* 4. Style du lien PPS / FFA (Bleu) */
.justificatif-container .pps-link, 
.help-text a {
    font-size: 11px !important;    /* Taille réduite pour matcher avec le format info */
    font-weight: bold !important;
    color: #007399 !important;
    text-decoration: none !important;
}

.justificatif-container .pps-link:hover, 
.help-text a:hover {
    text-decoration: underline !important;
}

/* 5. Statut des fichiers (Texte Rouge / Vert "Aucun fichier choisi") */
.justificatif-container .file-name {
    color: #a80000;
    font-size: 13px !important;
    font-weight: bold !important;
}

.justificatif-container .file-name[style*="color: rgb(40, 167, 69)"],
.justificatif-container .file-name[style*="color:#28a745"],
.justificatif-container .file-name[style*="color:green"] {
    color: #28a745 !important; 
}

/* 6. Zone Option Licence pour les Mineurs */
.option-licence-mineur {
    margin-top: 35px !important;     
    margin-bottom: 15px !important;
}

.option-licence-mineur .checkbox-container label {
    min-width: auto !important;
    font-weight: 700 !important;
}

/* --- ESPACEMENT ENTRE LA CHECKBOX ET LE BOUTON "CHARGER LA LICENCE" --- */

/* Option 1 : On pousse directement le bloc de la licence vers le bas */
#LicenceFFA_mineur {
    margin-top: 15px !important; /* 👈 Augmente cette valeur (ex: 40px) pour créer l'espace voulu */
}

/* ==========================================================================
   MODULE DE GESTION DU PANIER & RENSEIGNEMENTS MULTIPLES
   ========================================================================== */
.bandeau-panier {
    background-color: #e2f0fe;
    border-left: 5px solid #0056b3;
    color: #003875;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-vide-panier {
    background: #d9534f;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-vide-panier:hover {
    background-color: #f7eeed;
    color: #c9302c !important;
    border: 1px solid #c9302c;
    border-left: 5px solid #c9302c;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(241, 211, 211, 0.2);
}

.zone-boutons-action {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.btn-action-multiple {
    flex: 1;
    gap: 10px; 
    padding: 15px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.2s, transform 0.1s;
}
.btn-action-multiple:active {
    transform: scale(0.98);
}

/* Bouton Finaliser et payer */
.btn-payer-groupe {
    background-color: #1b8133;
    color: white;
}
.btn-payer-groupe:hover { 
    background-color: #e8f7eb;
    color: #1b8133 !important;
    border: 1px solid #1b8133;
    border-left: 7px solid #1b8133;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(199, 235, 235, 0.2); 
}

/* Bouton Accéder au panier */
.btn-acces-panier {
    background-color: #c3c6ca;
    color: #2c3e50;
    border: 1px solid #2c3e50;
    border-left: 6px solid #2c3e50;
}
.btn-acces-panier:hover { 
    background-color: #2c3e50;
    color: white !important;
    border: 1px solid #2c3e50;
    border-left: 6px solid #c3c6ca;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(204, 206, 206, 0.2); 
}

/* Bouton Ajouter un participant (Anthracite uniforme) */
.btn-ajouter-autre {
    background-color: #dcdfe2;
    color: #2c3e50;
    border: 1px solid #2c3e50;
    border-left: 5px solid #2c3e50;
}
.btn-ajouter-autre:hover { 
    background-color: #2c3e50;
    color: white !important;
    border: 1px solid #2c3e50;
    border-left: 5px solid #dcdfe2;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(204, 206, 206, 0.2); 
}

/* Bouton Ajouter une distance (Turquoise) */
.btn-dropdown-distances {
    background-color: #cfeef3;
    color: #2c3e50;
    border: 1px solid #2c3e50;
    border-left: 5px solid #2c3e50;
}
.btn-dropdown-distances:hover { 
    background-color: #2c3e50;
    color: white !important;
    border: 1px solid #2c3e50;
    border-left: 5px solid #cfeef3;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(204, 206, 206, 0.2); 
}

.dropdown-menu-distances {
    background-color: white; 
    border: 1px solid #ced4da; 
    border-radius: 6px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
    z-index: 9999; 
    
    /* Largeur forcée */
    width: 200px !important;    
    min-width: 200px !important;
    max-width: 200px;
    box-sizing: border-box;       
    overflow: hidden;             

    /* --- NOUVEAU CENTRAGE CORRECT (BASÉ SUR LA DROITE) --- */
    position: absolute;
    right: 32px;                 /* Décale le menu depuis la droite (ajuste cette valeur si besoin) */
    margin-top: 5px;              /* Espace propre sous le bouton */
}

/* Style du lien conteneur */
.lien-distance-equipe {
    display: block;
    padding: 12px 15px;
    color: #333333;
    text-decoration: none;
    border-bottom: 1px solid #f1f3f5;
    font-size: 14px;
    font-weight: 600;
    text-align: center;           /* Aligne aussi le texte au centre à l'intérieur */
    transition: background-color 0.1s ease;
}

/* Effet au survol du lien */
.lien-distance-equipe:hover {
    background-color: #f8f9fa; /* Teinte légère pour l'effet de transition */
}

/* Style de l'émoji */
.emoji-distance {
    font-size: 15px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Bouton inscription validée (Turquoise) */
.btn-valider {
    background-color: #008C8C;
    color: white;
}
.btn-valider:hover { 
    background-color: #f4f4f5;
    color: #008C8C !important;
    border: 1px solid #008C8C;
    border-left: 6px solid #008C8C;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(204, 206, 206, 0.2); 
}

/* ==========================================================================
   TABLEAUX ET AFFICHAGE RECAPITULATIF PANIER
   ========================================================================== */
.table-recap { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 20px 0; 
}

.table-recap th, .table-recap td { 
    padding: 12px 10px; 
    text-align: left; 
    border-bottom: 1px solid #eee; 
}

.table-recap th { 
    background-color: #3fa5a5; 
    font-weight: 700; 
    color: #ffffff; 
    font-size: 13px; 
    text-transform: uppercase; 
}

.table-recap td { 
    font-size: 14px; 
}

.don-highlight { 
    color: #bc8f8f; 
    font-weight: 600; 
}

.total-unitaire { 
    font-weight: 700; 
}

.row-total-global { 
    background: #fdfefe; 
    font-size: 15px; 
}

.option-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 5px; 
    border-left: 4px solid var(--accent-color); 
    margin-bottom: 10px; 
}

.summary-box { 
    background: var(--secondary-color); 
    color: #fff; 
    padding: 20px; 
    border-radius: 5px; 
    margin-top: 30px; 
}

.summary-row { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
    font-size: 14px; 
}

.summary-total { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: 15px; 
    padding-top: 15px; 
    border-top: 1px solid rgba(255,255,255,0.2); 
}

.recap-ligne {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1); 
}

.recap-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #fff; 
}

.recap-montant {
    text-align: right;
    min-width: 80px; 
}

footer { 
    margin-top: 40px; 
    padding: 20px 0; 
    border-top: 1px solid #eee; 
    text-align: center; 
    color: #888; 
    font-size: 12px; 
}

/* ==========================================================================
   AJUSTEMENTS DES MARGES INTER-SECTIONS
   ========================================================================== */
#section_justificatifs, 
#autorisationParentale, 
#ppsLicence {
    margin-bottom: 5px !important; 
    padding-bottom: 0px !important;
}

#autorisationParentale .form-group:last-child,
#autorisationParentale .justificatif-container:last-of-type,
#LicenceFFA_mineur .form-group {
    margin-bottom: 0px !important; 
}

#section_justificatifs + fieldset,
#section_justificatifs + div,
fieldset:has(#autorisationParentale) + fieldset {
    margin-top: 0px !important;
    padding-top: 0px !important;
}

#section_justificatifs + fieldset legend,
fieldset:has(#autorisationParentale) + fieldset legend {
    margin-top: 0px !important;
    margin-bottom: 5px !important;
}

/* ==========================================================================
   RESPONSIVE & ADAPTATIONS MOBILES
   ========================================================================== */
@media (max-width: 992px) {
    body { padding: 5px !important; margin: 0 !important; }
    
    #wrapper { width: 100% !important; }
    header img { width: 80% !important; height: auto; }
    .btn { width: 100% !important; }

    .container { 
        width: 100% !important; 
        max-width: 100% !important; 
        padding: 10px !important; 
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .form-group { display: block !important; margin-bottom: 20px !important; }

    label { 
        display: block !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        font-size: 16px !important; 
    }

    input[type="text"], input[type="date"], input[type="email"], 
    input[type="tel"], input[type="number"] { 
        width: 100% !important;
        max-width: 100% !important; 
        height: 45px !important;
        font-size: 16px !important;
    }

    .btn-browse { width: 100% !important; text-align: center; padding: 15px 0 !important; }
    
    #inputEquipe {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Annulation des retraits PC pour le mobile */
    .form-group a,
    .help-text,
    #info-pps-mineur {
        margin-left: 0 !important;
        width: 100% !important;
        display: block !important;
        padding: 5px 0;
    }

    .btn-browse + span, 
    .btn-browse + font {
        margin-left: 10px !important; 
        display: inline-block;
        font-size: 12px;
        word-break: break-all; 
    }

    #info-pps-mineur {
        display: none; 
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Grille des radios sur mobile */
    .radio-group { 
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr; 
        gap: 10px;
        width: 100% !important;
        margin-top: 10px; 
    }

    .radio-group label {
        justify-content: flex-start; 
        padding: 5px;
    }

    /* Adaptation mobile des options repas */
    .option-repas-flex {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .option-repas-flex > div:first-child {
        flex: 1 !important;
        padding-right: 20px !important; 
        box-sizing: border-box;
    }
    
    .option-repas-flex span {
        font-size: 13px !important;
    }
    
    .option-repas-flex span:first-child {
        font-size: 15px !important;
    }

    .radio-group-options {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        flex: 0 0 auto !important; 
        align-items: flex-end !important; 
        text-align: right !important;
    }
    
    .radio-group-options label {
        font-size: 14px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        display: flex !important;
        flex-direction: row-reverse !important; 
        align-items: center !important;
    }

    .radio-group-options input[type="radio"] {
        margin-left: 6px !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 650px) {
    .justificatif-container .format-info,
    .justificatif-container .lien-aide {
        text-align: left !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
        display: block !important;
        width: 100% !important;
    }

    .justificatif-container .lien-aide {
        padding-left: 5px !important;
    }
    
    .justificatif-container .file-name {
        display: block !important;
        margin-top: 5px !important;
        margin-left: 0 !important;
        text-align: left !important;
    }
}

@media (max-width: 600px) {
    .zone-boutons-action {
        flex-direction: column;
        gap: 10px;
    }
}