/*
* Nom du fichier : adhesion.css
* Version : v3 - 26/08/2026 17:40
*
* === CONTEXTE (pour l'IA) ===
* But du code : Reproduire visuellement le bulletin d'adhésion PDF de Radio G!.
* Logique implémentée : toutes les classes sont préfixées "adh-" pour ne jamais
*   entrer en conflit avec stylerepere.css (feuille globale du site).
*   Les couleurs et espacements sont regroupés en variables CSS (:root) en haut
*   du fichier : c'est la "section de configuration" côté style.
* Points d'attention : responsive géré par flex-wrap + une media query à 780px
*   qui fait passer chaque champ sur toute la largeur (mobile).
* Modifications (v2) :
*   - Zone "code adhérent" alignée à droite au-dessus de la section 1.
*   - Toggle majeur / mineur (interrupteur à 2 positions) + bloc parent.
*   - Bouton de test provisoire, lien charte, encart code final dans la popup.
* Modifications (v3) :
*   - Encart des consignes de paiement (chèque / IBAN) dans le message final.
*   - Trois boutons de sortie sous le message final.
*
* === DESCRIPTION UTILISATEUR ===
* Habillage graphique du formulaire d'adhésion : bandeau rouge, titres numérotés,
* champs à souligné simple comme sur le PDF, popup de règlement.
*/

/* ===================================================================
   === SECTION DE CONFIGURATION (couleurs / tailles modifiables) ===
   =================================================================== */
:root {
    --adh-rouge: #e2001a;
    /* rouge Radio G! : bandeau, barres de titre, boutons */
    --adh-rouge-fonce: #b30015;
    /* survol des boutons */
    --adh-gris-titre: #e6e6e6;
    /* fond gris des barres de titre de section */
    --adh-gris-ligne: #b9b9b9;
    /* trait sous les champs de saisie */
    --adh-texte: #1a1a1a;
    /* couleur du texte principal */
    --adh-gris-doux: #f5f5f5;
    /* fond des lignes alternées du tableau */
    --adh-largeur-page: 1000px;
    /* largeur maximale de la feuille */
    --adh-police: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

/* ===================================================================
   === BASE ===
   =================================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px 12px 40px;
    background: #ffffff;
    color: var(--adh-texte);
    font-family: var(--adh-police);
    font-size: 15px;
    line-height: 1.4;
}

.adh-page {
    max-width: var(--adh-largeur-page);
    margin: 0 auto;
}

/* Classe utilitaire : masque un élément (utilisée par le JS) */
.adh-cache {
    display: none !important;
}

/* ===================================================================
   === EN-TÊTE : logo à gauche + bandeau rouge à droite ===
   =================================================================== */
.adh-entete {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.adh-logo {
    flex: 0 0 190px;
}

.adh-logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

.adh-bandeau {
    flex: 1;
    background: var(--adh-rouge);
    color: #fff;
    padding: 18px 26px;
    /* Le PDF a un motif d'ondes : reproduit ici par un dégradé répété très discret */
    background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 16px);
}

.adh-bandeau h1 {
    margin: 0;
    font-size: 27px;
    letter-spacing: .5px;
}

.adh-bandeau-saison {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: bold;
}

.adh-bandeau-asso {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: .85;
}

/* ===================================================================
   === ZONE "CODE ADHÉRENT" (au-dessus de la section 1, à droite) ===
   =================================================================== */
.adh-zone-code {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* alignement à droite demandé */
    gap: 6px;
    margin-bottom: 10px;
}

.adh-zone-code label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .4px;
    color: #666;
}

.adh-code-groupe {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#adh-code-saisi {
    border: 1px solid var(--adh-gris-ligne);
    border-radius: 4px;
    padding: 9px 12px;
    font-family: monospace;
    font-size: 17px;
    letter-spacing: 3px;
    text-align: center;
    width: 150px;
    outline: none;
}

#adh-code-saisi:focus {
    border-color: var(--adh-rouge);
}

.adh-message-code {
    font-size: 13px;
    font-weight: bold;
    color: #1c6b2a;
}

.adh-message-code-erreur {
    color: var(--adh-rouge);
}

/* ===================================================================
   === TITRES DE SECTION (barre rouge + fond gris, comme le PDF) ===
   =================================================================== */
.adh-titre-section {
    background: var(--adh-gris-titre);
    border-left: 6px solid var(--adh-rouge);
    padding: 7px 12px;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: .4px;
    margin: 30px 0 16px;
}

.adh-titre-section .adh-num {
    color: var(--adh-rouge);
    margin-right: 6px;
}

/* ===================================================================
   === CHAMPS DE SAISIE : soulignés simples, sans encadré ===
   =================================================================== */
.adh-ligne {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    margin-bottom: 18px;
}

.adh-champ {
    flex: 1 1 100%;
    min-width: 150px;
}

/* Largeurs proportionnelles utilisées dans le HTML */
.adh-moitie {
    flex: 1 1 calc(50% - 13px);
}

.adh-tiers {
    flex: 1 1 calc(33.33% - 18px);
}

.adh-quart {
    flex: 1 1 calc(25% - 20px);
}

.adh-champ label {
    display: block;
    font-size: 11.5px;
    font-weight: bold;
    letter-spacing: .5px;
    color: #222;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.adh-champ label em {
    font-weight: normal;
    text-transform: none;
    color: #777;
}

.adh-champ input[type=text],
.adh-champ input[type=email],
.adh-champ select {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--adh-gris-ligne);
    background: transparent;
    padding: 7px 2px;
    font-family: var(--adh-police);
    font-size: 15px;
    color: var(--adh-texte);
    outline: none;
}

.adh-champ input:focus,
.adh-champ select:focus {
    border-bottom: 2px solid var(--adh-rouge);
    background: #fffafa;
}

/* Champs non modifiables (Fait à / Le) */
.adh-fige {
    color: #444;
    font-weight: bold;
    cursor: default;
}

/* Champ en erreur : bordure rouge (ajoutée par le JS) */
.adh-champ-erreur {
    border-bottom: 2px solid var(--adh-rouge) !important;
    background: #fff0f0 !important;
}

/* Petit champ texte "Autres :" collé à sa case à cocher */
.adh-mini-input {
    border: none;
    border-bottom: 1px solid var(--adh-gris-ligne);
    background: transparent;
    padding: 3px 2px;
    width: 160px;
    font-family: var(--adh-police);
    font-size: 14px;
    outline: none;
}

.adh-mini-input:disabled {
    /* Champ grisé tant que "Autres" n'est pas coché */
    border-bottom-style: dotted;
    background: transparent;
    color: #bbb;
    cursor: not-allowed;
}

/* ===================================================================
   === CASES À COCHER / BOUTONS RADIO ===
   =================================================================== */
.adh-cases {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 6px 0;
}

.adh-case {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    text-transform: none;
    font-weight: normal;
    cursor: pointer;
    /* Zone de clic confortable au doigt sur mobile */
    min-height: 34px;
}

.adh-case input {
    width: 18px;
    height: 18px;
    accent-color: var(--adh-rouge);
    cursor: pointer;
    flex: 0 0 auto;
}

.adh-case-grande {
    font-size: 15px;
    font-weight: bold;
    align-items: flex-start;
    text-transform: none;
}

.adh-lien-charte {
    color: var(--adh-rouge);
    font-weight: normal;
}

/* ===================================================================
   === TOGGLE MAJEUR / MINEUR (interrupteur à 2 positions) ===
   =================================================================== */
/* Technique : les 2 boutons radio sont masqués, seuls leurs <label>
   sont visibles. Le sélecteur ":checked + label" colore le label actif. */
.adh-toggle {
    display: inline-flex;
    border: 2px solid var(--adh-rouge);
    border-radius: 6px;
    overflow: hidden;
    max-width: 100%;
}

.adh-toggle input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.adh-toggle label {
    margin: 0;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: bold;
    text-transform: none;
    letter-spacing: 0;
    color: var(--adh-rouge);
    background: #fff;
    cursor: pointer;
    user-select: none;
    min-height: 46px;
    display: flex;
    align-items: center;
    transition: background .15s;
}

.adh-toggle label:hover {
    background: #ffecee;
}

/* Position active : fond rouge, texte blanc */
.adh-toggle input[type=radio]:checked+label {
    background: var(--adh-rouge);
    color: #fff;
}

/* Bloc parent / tuteur affiché seulement en position "mineur" */
.adh-bloc-parent {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--adh-gris-doux);
    border-left: 3px solid var(--adh-rouge);
    max-width: 480px;
}

.adh-bloc-parent input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--adh-gris-ligne);
    background: transparent;
    padding: 7px 2px;
    font-family: var(--adh-police);
    font-size: 15px;
    outline: none;
}

.adh-bloc-parent input:focus {
    border-bottom: 2px solid var(--adh-rouge);
}

.adh-bloc-parent label {
    display: block;
    font-size: 11.5px;
    font-weight: bold;
    letter-spacing: .5px;
    margin-bottom: 3px;
}

/* ===================================================================
   === BLOC CO-ANIMATEURS (lignes ajoutées dynamiquement) ===
   =================================================================== */
.adh-coanim-ligne {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--adh-gris-doux);
    border-left: 3px solid var(--adh-rouge);
}

.adh-coanim-ligne .adh-champ {
    flex: 1 1 200px;
}

.adh-coanim-supprimer {
    background: #777;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    min-height: 38px;
}

.adh-coanim-supprimer:hover {
    background: var(--adh-rouge);
}

/* ===================================================================
   === ENGAGEMENTS ===
   =================================================================== */
.adh-engagements {
    font-size: 14px;
}

.adh-engagements ul {
    margin: 8px 0;
    padding-left: 18px;
    list-style: none;
}

.adh-engagements li::before {
    content: "— ";
    color: var(--adh-texte);
}

.adh-gras {
    font-weight: bold;
    margin: 6px 0;
}

.adh-rouge {
    color: var(--adh-rouge);
}

.adh-oblig {
    color: var(--adh-rouge);
}

/* ===================================================================
   === BOUTONS ===
   =================================================================== */
.adh-zone-bouton {
    margin: 24px 0 10px;
    text-align: center;
}

.adh-bouton {
    background: var(--adh-rouge);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 14px 42px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--adh-police);
    min-height: 48px;
    /* confort tactile */
}

.adh-bouton:hover {
    background: var(--adh-rouge-fonce);
}

.adh-bouton:disabled {
    background: #999;
    cursor: wait;
}

.adh-bouton-secondaire {
    background: #fff;
    color: var(--adh-rouge);
    border: 2px solid var(--adh-rouge);
    border-radius: 5px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--adh-police);
    min-height: 42px;
}

.adh-bouton-secondaire:hover {
    background: var(--adh-rouge);
    color: #fff;
}

/* Bouton de test provisoire : volontairement discret */
.adh-zone-test {
    margin-top: 14px;
}

.adh-bouton-test {
    display: inline-block;
    background: #ececec;
    color: #555;
    border: 1px dashed #999;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    text-decoration: none;
}

.adh-bouton-test:hover {
    background: #ddd;
}

/* ===================================================================
   === MESSAGES D'ERREUR ===
   =================================================================== */
.adh-erreur {
    background: #fff0f0;
    border: 1px solid var(--adh-rouge);
    color: var(--adh-rouge);
    padding: 12px 16px;
    border-radius: 5px;
    margin-bottom: 16px;
    text-align: left;
    font-size: 14px;
}

/* ===================================================================
   === PIED DE PAGE ===
   =================================================================== */
.adh-pied {
    margin-top: 40px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 11px;
    color: #666;
}

/* ===================================================================
   === POPUP DE RÈGLEMENT ===
   =================================================================== */
.adh-popup-fond {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 10px;
    overflow-y: auto;
    z-index: 9999;
}

.adh-popup-boite {
    background: #fff;
    max-width: 940px;
    width: 100%;
    padding: 10px 24px 24px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

.adh-popup-consigne {
    font-size: 15px;
    font-weight: bold;
    margin: 4px 0 16px;
}

.adh-popup-message {
    background: #f0fff0;
    border: 1px solid #2e8b3e;
    color: #1c6b2a;
    padding: 22px 18px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

/* Encart du code adhérent affiché dans le message final */
.adh-code-final {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #2e8b3e;
    font-size: 15px;
}

.adh-code-final strong {
    font-family: monospace;
    font-size: 24px;
    letter-spacing: 4px;
    color: var(--adh-rouge);
}

.adh-code-final span {
    display: block;
    font-weight: normal;
    font-size: 13px;
    color: #444;
    margin-top: 6px;
}

/* Consignes de paiement (chèque / virement) affichées dans le message final */
.adh-consigne-paiement {
    margin-top: 16px;
    padding: 14px;
    background: #fff;
    border: 1px dashed #2e8b3e;
    border-radius: 5px;
    font-weight: normal;
    font-size: 15px;
    color: #1a1a1a;
}

.adh-iban {
    display: block;
    margin-top: 8px;
    font-family: monospace;
    font-size: 17px;
    letter-spacing: 1px;
    font-weight: bold;
    /* Permet la sélection/copie facile de l'IBAN */
    user-select: all;
    word-break: break-all;
}

.adh-bic {
    display: block;
    margin-top: 4px;
    font-family: monospace;
    font-size: 14px;
    color: #555;
}

/* Les trois boutons de sortie sous le message final */
.adh-boutons-fin {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.adh-bouton-fin {
    background: #fff;
    color: var(--adh-rouge);
    border: 2px solid var(--adh-rouge);
    border-radius: 5px;
    padding: 11px 18px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--adh-police);
    min-height: 46px;
}

.adh-bouton-fin:hover {
    background: var(--adh-rouge);
    color: #fff;
}

/* Le bouton "Quitter" est volontairement plus neutre */
.adh-bouton-quitter {
    color: #555;
    border-color: #999;
}

.adh-bouton-quitter:hover {
    background: #555;
    border-color: #555;
    color: #fff;
}

/* ===================================================================
   === TABLEAU DES COTISATIONS ===
   =================================================================== */
/* Conteneur avec défilement horizontal : indispensable sur mobile,
   sinon le tableau à 5 colonnes déborde de l'écran. */
.adh-tableau-conteneur {
    overflow-x: auto;
}

.adh-tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 620px;
}

.adh-tableau thead th {
    background: var(--adh-gris-titre);
    border: 1px solid #ccc;
    padding: 8px 6px;
    font-size: 12px;
    text-align: center;
    width: 80px;
}

.adh-tableau thead .adh-th-coti {
    text-align: left;
    width: auto;
    font-size: 19px;
    font-weight: bold;
    padding: 14px 10px;
}

/* Reproduit les petites majuscules du mot "COTISATION" du PDF */
.adh-tableau .adh-pc {
    font-size: 14px;
}

.adh-tableau td {
    border: 1px solid #ccc;
    padding: 8px;
    vertical-align: middle;
}

.adh-tableau tbody tr:nth-child(even) {
    background: var(--adh-gris-doux);
}

.adh-td-tarif strong {
    display: block;
    font-size: 14px;
}

.adh-sousgroupe {
    display: block;
    color: #777;
    font-size: 11.5px;
    margin-bottom: 4px;
}

.adh-calcul {
    font-weight: bold;
    color: var(--adh-rouge);
    margin-right: 8px;
}

.adh-detail {
    color: #333;
}

.adh-td-case {
    text-align: center;
}

.adh-td-case input {
    width: 20px;
    height: 20px;
    accent-color: var(--adh-rouge);
    cursor: pointer;
}

/* ===================================================================
   === RESPONSIVE MOBILE ===
   =================================================================== */
@media (max-width: 780px) {

    /* Chaque champ prend toute la largeur */
    .adh-moitie,
    .adh-tiers,
    .adh-quart {
        flex: 1 1 100%;
    }

    .adh-ligne {
        gap: 14px;
        margin-bottom: 12px;
    }

    .adh-entete {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .adh-logo {
        flex: 0 0 auto;
        max-width: 170px;
    }

    .adh-bandeau h1 {
        font-size: 21px;
    }

    /* Zone code : centrée et pleine largeur sur mobile */
    .adh-zone-code {
        align-items: stretch;
    }

    .adh-code-groupe {
        flex-direction: column;
        align-items: stretch;
    }

    #adh-code-saisi {
        width: 100%;
    }

    /* Toggle : les 2 positions l'une au-dessus de l'autre */
    .adh-toggle {
        flex-direction: column;
        width: 100%;
    }

    .adh-popup-boite {
        padding: 8px 12px 18px;
    }

    .adh-bouton {
        width: 100%;
    }

    .adh-boutons-fin {
        flex-direction: column;
    }
}
