/* ==========================================================================
   Composants FCPM : tout ce qui est ajouté au site, lot après lot.
   Prolonge le style fait main d'origine (bleu #2448B6, marine #082270,
   jaune « Complet », Poppins, bouton1 en relief) au lieu d'en créer un autre.
   Chargée seulement sur les pages qui s'en servent (pas sur l'accueil).
   ========================================================================== */

:root {
    --fcpm-bleu: #2448B6;
    --fcpm-marine: #082270;
    --fcpm-jaune: #FFC72C;
    --fcpm-rouge: #E3262E;
    --fcpm-vert: #157347;
    --fcpm-texte: #3a4255;
    --fcpm-gris: #5b6478;
    --fcpm-trait: #dde3f3;
    --fcpm-bleu-doux: #eef2fc;
    --fcpm-vert-doux: #e8f6ee;
    --fcpm-rouge-doux: #fdecec;

    --fcpm-arrondi: 10px;
    --fcpm-arrondi-carte: 16px;
    --fcpm-pilule: 999px;

    --fcpm-ombre-carte: 0 10px 30px rgba(8, 34, 112, 0.10), 0 2px 6px rgba(8, 34, 112, 0.08);
    /* Le relief de bouton1, en plus doux : lumière en haut, ombre en bas */
    --fcpm-relief: inset 0 2px 2px rgba(255, 255, 255, 0.7), inset 0 -2px 3px rgba(8, 34, 112, 0.10), 0 4px 12px rgba(8, 34, 112, 0.10);
    --fcpm-anneau: 0 0 0 3px rgba(255, 199, 44, 0.75);
}

/* ---------- Typographie : pas de mot tout seul en bout de ligne ---------- */

.fcpm-equilibre { text-wrap: balance; }
.fcpm-soigne { text-wrap: pretty; }

/* ---------- Lien d'action : souligné qui se dessine au survol ---------- */

.fcpm-lien {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fcpm-bleu);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.fcpm-lien:hover {
    color: var(--fcpm-marine);
    text-decoration-color: var(--fcpm-jaune);
}

.fcpm-lien svg {
    flex: none;
    transition: transform .2s ease;
}

.fcpm-lien:hover svg.fcpm-fleche {
    transform: translateX(3px);
}

/* ---------- Bouton secondaire : même gabarit que bouton1, en clair ---------- */

.fcpm-bouton-clair {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    padding: 12px 18px;
    border: 2px solid var(--fcpm-bleu);
    border-radius: var(--fcpm-arrondi);
    background: #fff;
    box-shadow: var(--fcpm-relief);
    color: var(--fcpm-bleu);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-wrap: balance;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.fcpm-bouton-clair:hover {
    background: var(--fcpm-bleu-doux);
    color: var(--fcpm-marine);
    transform: translateY(-1px);
}

/* ---------- Pilules : petits repères d'état ---------- */

.fcpm-pilule {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: var(--fcpm-pilule);
    background: var(--fcpm-bleu-doux);
    color: var(--fcpm-bleu);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.fcpm-pilule::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.fcpm-pilule.fcpm-ok { background: var(--fcpm-vert-doux); color: var(--fcpm-vert); }
.fcpm-pilule.fcpm-alerte { background: var(--fcpm-rouge-doux); color: var(--fcpm-rouge); }

/* ---------- Petit titre au-dessus d'une valeur ---------- */

.fcpm-surtitre {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--fcpm-gris);
}

/* ---------- Focus clavier visible, aux couleurs du site ---------- */

.fcpm-lien:focus-visible,
.fcpm-bouton-clair:focus-visible,
.fcpm-focus:focus-visible {
    outline: none;
    box-shadow: var(--fcpm-anneau);
    border-radius: var(--fcpm-arrondi);
}

/* ---------- Fenêtres (liste d'attente, puis réservation au lot 3) ---------- */

.fcpm-modale .modal-content {
    border: 0;
    border-top: 5px solid var(--fcpm-bleu);
    border-radius: var(--fcpm-arrondi-carte);
    box-shadow: 0 24px 60px rgba(8, 34, 112, 0.25);
}

.fcpm-modale .modal-header {
    padding: 20px 24px 12px;
    border-bottom: 0;
}

.fcpm-modale .modal-title {
    font-weight: 700;
    color: var(--fcpm-marine) !important;
    text-wrap: balance;
}

.fcpm-modale .modal-body {
    padding: 4px 24px 24px;
}

.fcpm-modale .form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fcpm-texte);
}

.fcpm-modale .form-control,
.fcpm-modale .form-select {
    border-color: var(--fcpm-trait);
    border-radius: var(--fcpm-arrondi);
    padding: 10px 14px;
}

/* Les menus gardent la place de leur flèche : un long nom de stage s'arrête avant */
.fcpm-modale .form-select {
    padding-right: 40px;
    text-overflow: ellipsis;
}

.fcpm-modale .form-control:focus,
.fcpm-modale .form-select:focus {
    border-color: var(--fcpm-bleu);
    box-shadow: 0 0 0 3px rgba(36, 72, 182, 0.15);
}

.fcpm-modale .bouton1 {
    width: 100%;
    border-radius: var(--fcpm-arrondi);
}

.fcpm-modale .fcpm-rappel {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: var(--fcpm-arrondi);
    background: var(--fcpm-bleu-doux);
    color: var(--fcpm-texte);
    font-size: 14px;
    text-wrap: pretty;
}

.fcpm-modale .fcpm-rappel strong {
    color: var(--fcpm-marine);
}

.fcpm-modale .fcpm-rappel svg {
    flex: none;
    margin-top: 2px;
    color: var(--fcpm-bleu);
}

/* Blocs d'un formulaire long (réservation) : un petit titre par groupe de champs */
.fcpm-modale fieldset {
    margin: 0 0 6px;
    padding: 16px 0 4px;
    border-top: 1px solid var(--fcpm-trait);
}

.fcpm-modale fieldset:first-of-type {
    padding-top: 4px;
    border-top: 0;
}

.fcpm-modale legend {
    float: none;
    width: auto;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--fcpm-bleu);
}

/* Total calculé en direct : places × prix */
.fcpm-modale .reserverTotal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: var(--fcpm-arrondi);
    background: var(--fcpm-bleu-doux);
    color: var(--fcpm-texte);
}

.fcpm-modale .reserverTotal:empty {
    display: none;
}

.fcpm-modale .reserverTotal strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--fcpm-bleu);
    font-variant-numeric: tabular-nums;
}

.fcpm-modale .reserverMention {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--fcpm-gris);
    text-align: center;
    text-wrap: balance;
}

/* Message de réussite d'un formulaire */
.fcpm-modale .reserverSucces {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 18px 8px 8px;
    text-align: center;
}

.fcpm-modale .reserverSucces.d-none {
    display: none;
}

.fcpm-modale .reserverSucces svg {
    color: var(--fcpm-vert);
}

.fcpm-modale .reserverSucces h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--fcpm-marine);
}

.fcpm-modale .reserverSucces p {
    margin: 0 0 8px;
    max-width: 46ch;
    color: var(--fcpm-texte);
    text-wrap: balance;
}

/* Lot 5 : documents à lire, accepter et signer avant d'envoyer la demande */
.fcpm-modale .reserverAide {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--fcpm-gris);
    text-wrap: pretty;
}

.fcpm-modale .reserverAide--petit {
    margin: 8px 0 4px;
    font-size: 13px;
}

.fcpm-modale .documentsListe {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.fcpm-modale .documentOuvrir {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--fcpm-trait);
    border-radius: var(--fcpm-arrondi);
    background: #fff;
    color: var(--fcpm-marine);
    font-weight: 600;
    text-align: left;
    transition: border-color .2s ease, background-color .2s ease;
}

.fcpm-modale .documentOuvrir:hover,
.fcpm-modale .documentOuvrir[aria-expanded="true"] {
    border-color: var(--fcpm-bleu);
    background: var(--fcpm-bleu-doux);
}

.fcpm-modale .documentOuvrir:focus-visible {
    outline: none;
    box-shadow: var(--fcpm-anneau);
}

.fcpm-modale .documentOuvrir svg {
    flex: none;
    color: var(--fcpm-bleu);
}

.fcpm-modale .documentTitre {
    flex: 1;
    min-width: 0;
}

.fcpm-modale .documentLire {
    flex: none;
    padding: 3px 12px;
    border-radius: var(--fcpm-pilule);
    background: var(--fcpm-bleu);
    color: #fff;
    font-size: 13px;
}

.fcpm-modale .documentTexte {
    max-height: 280px;
    margin-top: 6px;
    padding: 14px 16px;
    overflow-y: auto;
    border: 1px solid var(--fcpm-trait);
    border-radius: var(--fcpm-arrondi);
    background: #fff;
    color: var(--fcpm-texte);
    font-size: 14px;
    line-height: 1.55;
}

.fcpm-modale .documentTexte:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(36, 72, 182, 0.15);
}

.fcpm-modale .documentTexte p {
    margin: 0 0 6px;
}

.fcpm-modale .documentTexte h2,
.fcpm-modale .documentTexte h3 {
    margin: 12px 0 6px;
    font-size: 16px;
    color: var(--fcpm-marine);
}

.fcpm-modale .documentTexte .documentRempli {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--fcpm-bleu-doux);
    font-size: 13px;
}

.fcpm-modale .documentTexte .documentRempli strong {
    color: var(--fcpm-marine);
}

/* Décharge : déclarations ☐ cochées une par une (calendar.js, convertirCases) */
.fcpm-modale .documentCompteur {
    flex: none;
    padding: 3px 10px;
    border-radius: var(--fcpm-pilule);
    background: var(--fcpm-rouge-doux);
    color: var(--fcpm-rouge);
    font-size: 13px;
    font-weight: 600;
}

.fcpm-modale .documentCompteur--ok {
    background: var(--fcpm-vert-doux);
    color: var(--fcpm-vert);
}

.fcpm-modale .documentTexte .documentDeclaration {
    position: relative;
    margin: 0 0 8px;
    padding: 8px 10px 8px 38px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--fcpm-trait);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.fcpm-modale .documentTexte .documentDeclaration:hover {
    border-color: var(--fcpm-bleu);
}

.fcpm-modale .documentTexte .documentDeclaration--cochee {
    background: var(--fcpm-bleu-doux);
    border-color: var(--fcpm-bleu-doux);
}

.fcpm-modale .documentTexte .documentCase {
    position: absolute;
    top: 10px;
    left: 11px;
    width: 1.15em;
    height: 1.15em;
    margin: 0;
    border-color: var(--fcpm-bleu);
    cursor: pointer;
}

.fcpm-modale .documentTexte .documentCase:checked {
    background-color: var(--fcpm-bleu);
}

.fcpm-modale .documentChargement {
    color: var(--fcpm-gris);
}

.fcpm-modale .reserverAccord {
    margin: 0 0 14px;
    padding: 12px 14px 12px 42px;
    border-radius: var(--fcpm-arrondi);
    background: var(--fcpm-bleu-doux);
    color: var(--fcpm-texte);
    font-size: 15px;
    text-wrap: pretty;
}

.fcpm-modale .reserverAccord .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: .15em;
    border-color: var(--fcpm-bleu);
}

.fcpm-modale .reserverAccord .form-check-input:checked {
    background-color: var(--fcpm-bleu);
}

.fcpm-modale .reserverSignature {
    font-size: 18px;
    font-weight: 600;
    color: var(--fcpm-marine);
}

/* Carte cadeau dans la fenêtre de réservation : le code paie une place */
.fcpm-modale .reserverTotal__cadeau {
    flex-basis: 100%;
    order: 2;
    font-size: 14px;
    font-weight: 600;
    color: var(--fcpm-vert);
}

.fcpm-modale .reserverTotal__reste {
    order: 3;
    font-size: 14px;
    color: var(--fcpm-gris);
}

.fcpm-modale .reserverTotal strong {
    order: 4;
}

.fcpm-modale .reserverCadeau {
    margin: 0 0 14px;
}

.fcpm-modale .reserverCadeau__ouvrir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: 0;
    background: none;
    font-weight: 600;
    color: var(--fcpm-bleu);
    text-decoration: underline;
    text-decoration-color: rgba(36, 72, 182, 0.35);
    text-underline-offset: 4px;
}

.fcpm-modale .reserverCadeau__ouvrir:hover {
    text-decoration-color: currentColor;
}

.fcpm-modale .reserverCadeau__ouvrir:focus-visible {
    outline: none;
    box-shadow: var(--fcpm-anneau);
    border-radius: 4px;
}

.fcpm-modale .reserverCadeau__ouvrir[hidden],
.fcpm-modale .reserverCadeau__zone[hidden],
.fcpm-modale .reserverCadeau__ok[hidden] {
    display: none;
}

.fcpm-modale .reserverCadeau__zone {
    margin-top: 6px;
    padding: 12px 16px 4px;
    border-left: 4px solid var(--fcpm-jaune);
    border-radius: var(--fcpm-arrondi);
    background: var(--fcpm-bleu-doux);
}

.fcpm-modale .reserverCadeau__ligne {
    display: flex;
    gap: 10px;
}

.fcpm-modale .reserverCadeau__ligne .form-control {
    max-width: 260px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fcpm-modale .reserverCadeau__ligne .fcpm-bouton-clair {
    flex: none;
    width: auto;
    min-height: 0;
    padding: 8px 18px;
}

.fcpm-modale .reserverCadeau__message {
    min-height: 1.4em;
    margin: 6px 0 8px;
    font-size: 14px;
    color: var(--fcpm-gris);
    text-wrap: pretty;
}

.fcpm-modale .reserverCadeau__message--erreur {
    color: var(--fcpm-rouge);
}

.fcpm-modale .reserverCadeau__ok {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--fcpm-arrondi);
    background: var(--fcpm-vert-doux);
    color: var(--fcpm-texte);
}

.fcpm-modale .reserverCadeau__ok svg {
    flex: none;
    color: var(--fcpm-vert);
}

.fcpm-modale .reserverCadeau__ok div {
    flex: 1;
    min-width: 0;
    text-wrap: pretty;
}

.fcpm-modale .reserverCadeau__ok strong {
    display: block;
    color: var(--fcpm-marine);
}

.fcpm-modale .reserverCadeau__ok span {
    font-size: 14px;
}

.fcpm-modale .reserverCadeau__ok .fcpm-lien {
    flex: none;
    border: 0;
    background: none;
    padding: 0;
    font-size: 14px;
}

/* Code promo : même présentation que la carte cadeau, juste en dessous */
.fcpm-modale .reserverCadeau + .reserverPromo {
    margin-top: -8px;
}

.fcpm-modale .reserverTotal__promo {
    flex-basis: 100%;
    order: 2;
    font-size: 14px;
    font-weight: 600;
    color: var(--fcpm-vert);
}

/* « Sous réserve de présentation du justificatif » : bien visible, sans alarmer */
.fcpm-modale .reserverCadeau__ok .reserverPromo__conditions {
    display: block;
    margin-top: 6px;
    padding: 6px 10px;
    border-left: 3px solid var(--fcpm-jaune);
    border-radius: 6px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--fcpm-marine);
}

.fcpm-modale .reserverPromo__conditions:empty {
    display: none;
}

/* Réservation à plusieurs : une ligne par autre participant */
.fcpm-modale .reserverParticipants[hidden] {
    display: none;
}

.fcpm-modale .reserverParticipant {
    margin: 0 0 12px;
    padding: 10px 14px 4px;
    border-left: 4px solid var(--fcpm-bleu);
    border-radius: var(--fcpm-arrondi);
    background: var(--fcpm-bleu-doux);
}

.fcpm-modale .reserverParticipant__titre {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fcpm-marine);
}

.fcpm-modale .reserverParticipant .col-md-4 {
    margin-bottom: 8px;
}

/* Fenêtre de signature d'un participant : documents ouverts d'office */
#signerModal .documentOuvrir {
    cursor: default;
}

#signerModal .documentOuvrir:hover {
    border-color: var(--fcpm-trait);
    background: #fff;
}

#signerModal .documentTexte {
    max-height: 320px;
}

#signerModal .reserverAccord[hidden] {
    display: none;
}

@media (max-width: 575px) {
    .fcpm-modale .reserverCadeau__ligne {
        flex-direction: column;
    }

    .fcpm-modale .reserverCadeau__ligne .form-control {
        max-width: none;
    }

    .fcpm-modale .reserverCadeau__ligne .fcpm-bouton-clair {
        width: 100%;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fcpm-lien, .fcpm-lien svg, .fcpm-bouton-clair { transition: none; }
    .fcpm-bouton-clair:hover { transform: none; }
}
