/* =====================================================================
   AFP - Module formations (site public)
   Sessions de la fiche formation, planning de la Home, inscription, filtres du catalogue.
   Charte du thème : dégradé #2f57ef -> #b966e7, titres #192335, texte #6b7385.
   ===================================================================== */

:root {
    --afpf-primary: #2f57ef;
    --afpf-secondary: #b966e7;
    --afpf-gradient: linear-gradient(90deg, #2f57ef 0%, #b966e7 100%);
    --afpf-heading: #192335;
    --afpf-body: #6b7385;
    --afpf-border: #e6e3f1;
    --afpf-soft: #f4f5ff;
    --afpf-radius: 14px;
    --afpf-shadow: 0 6px 34px rgba(215, 216, 222, .41);
    --afpf-shadow-hover: 0 14px 40px rgba(47, 87, 239, .16);
}

/* --- éléments communs ------------------------------------------------ */
.afpf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--afpf-soft);
    color: var(--afpf-primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}
.afpf-chip i { font-size: 13px; }
.afpf-chip--mod { background: rgba(185, 102, 231, .12); color: #8a3dbf; }
.afpf-chip--prof { background: rgba(47, 87, 239, .08); color: var(--afpf-primary); }
.afpf-chip--warn { background: #fff3e2; color: #b26200; }
.afpf-chip--muted { background: #eef0f4; color: var(--afpf-body); }
.afpf-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.afpf-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--afpf-primary);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}
.afpf-link:hover { text-decoration: underline; }
.afpf-link i { margin-right: 4px; }

.afpf-kicker {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 100px;
    background: rgba(47, 87, 239, .08);
    color: var(--afpf-primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* tuile date (style calendrier) */
.afpf-date {
    flex: 0 0 74px;
    width: 74px;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    background: #fff;
    border: 1px solid var(--afpf-border);
    box-shadow: 0 4px 14px rgba(25, 35, 53, .06);
    line-height: 1.1;
    align-self: flex-start;
}
.afpf-date__m {
    display: block;
    padding: 5px 0;
    background: var(--afpf-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    order: -1;
}
.afpf-date { display: flex; flex-direction: column; }
.afpf-date__d { display: block; padding: 8px 0 0; font-size: 26px; font-weight: 700; color: var(--afpf-heading); }
.afpf-date__y { display: block; padding: 0 0 7px; font-size: 12px; color: var(--afpf-body); }

/* --- sessions de la fiche formation ---------------------------------- */
.afpf-sessions { display: flex; flex-direction: column; gap: 16px; }
.afpf-session {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid var(--afpf-border);
    border-radius: var(--afpf-radius);
    background: #fff;
    transition: box-shadow .25s, transform .25s, border-color .25s;
}
.afpf-session:hover { box-shadow: var(--afpf-shadow-hover); border-color: transparent; transform: translateY(-2px); }
.afpf-session.is-highlight { border-color: var(--afpf-primary); box-shadow: 0 0 0 4px rgba(47, 87, 239, .12); }
.afpf-session.is-full { opacity: .8; }
.afpf-session__body { flex: 1; min-width: 0; }
.afpf-session__title { color: var(--afpf-heading); font-weight: 600; font-size: 17px; line-height: 1.4; }
.afpf-session__meta { margin-top: 4px; color: var(--afpf-body); font-size: 15px; }
.afpf-session__meta i { color: var(--afpf-primary); margin-right: 4px; }
.afpf-session__info { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--afpf-soft); color: var(--afpf-heading); font-size: 14px; line-height: 1.5; }
.afpf-session__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.afpf-session__cta { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.afpf-session__cta .afpf-link { font-size: 13px; max-width: 170px; }
.afpf-sessions__more { margin: 18px 0 0; text-align: center; }

.afpf-nosession {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border: 1px dashed #cfd3ea;
    border-radius: var(--afpf-radius);
    background: var(--afpf-soft);
}
.afpf-nosession h5 { margin: 0 0 4px; font-size: 17px; }
.afpf-nosession p { margin: 0; font-size: 15px; }
.afpf-nosession > div:nth-child(2) { flex: 1; }
.afpf-nosession__icon {
    flex: 0 0 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--afpf-gradient);
    color: #fff;
    font-size: 22px;
}

/* bandeau de la fiche : prochaine session + professions */
.afpf-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.afpf-hero-meta a { color: var(--afpf-heading); }
.afpf-hero-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(47, 87, 239, .12);
    color: var(--afpf-heading);
    font-weight: 600;
    font-size: 15px;
}
.afpf-hero-next i { color: var(--afpf-primary); }

/* --- planning (Home) ------------------------------------------------- */
.afpf-agenda__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.afpf-agenda__head .title { margin: 10px 0 0; }
.afpf-agenda__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.afpf-toggle { display: inline-flex; padding: 5px; border-radius: 100px; background: #fff; box-shadow: var(--afpf-shadow); }
.afpf-toggle button {
    border: 0;
    background: none;
    padding: 8px 18px;
    border-radius: 100px;
    color: var(--afpf-body);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
.afpf-toggle button.is-active { background: var(--afpf-gradient); color: #fff; }
.afpf-toggle button i { margin-right: 6px; }
.afpf-filter-mod { display: flex; flex-wrap: wrap; gap: 8px; }
.afpf-filter-mod button {
    border: 1px solid var(--afpf-border);
    background: #fff;
    padding: 7px 14px;
    border-radius: 100px;
    color: var(--afpf-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.afpf-filter-mod button.is-active { border-color: var(--afpf-primary); color: var(--afpf-primary); background: rgba(47, 87, 239, .06); }

.afpf-month { margin-bottom: 34px; }
.afpf-month__title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    font-size: 20px;
    text-transform: capitalize;
    color: var(--afpf-heading);
}
.afpf-month__title::after { content: ""; flex: 1; height: 1px; background: var(--afpf-border); }
.afpf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; }

.afpf-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--afpf-radius);
    background: #fff;
    box-shadow: var(--afpf-shadow);
    transition: transform .25s, box-shadow .25s;
}
.afpf-card:hover { transform: translateY(-4px); box-shadow: var(--afpf-shadow-hover); }
.afpf-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.afpf-card__title { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.afpf-card__title a { color: var(--afpf-heading); }
.afpf-card__title a:hover { color: var(--afpf-primary); }
.afpf-card__meta { display: flex; flex-direction: column; gap: 3px; color: var(--afpf-body); font-size: 14px; }
.afpf-card__meta i { color: var(--afpf-primary); width: 16px; }
.afpf-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.afpf-card .rbt-btn.btn-sm { padding: 0 18px; height: 40px; line-height: 40px; font-size: 14px; }

.afpf-agenda__empty { padding: 40px; border-radius: var(--afpf-radius); background: #fff; box-shadow: var(--afpf-shadow); text-align: center; }
.afpf-agenda__more { margin-top: 10px; text-align: center; }

/* vue calendrier */
.afpf-cal { border-radius: var(--afpf-radius); background: #fff; box-shadow: var(--afpf-shadow); overflow: hidden; }
.afpf-cal__nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--afpf-border); }
.afpf-cal__nav h4 { margin: 0; font-size: 20px; text-transform: capitalize; }
.afpf-cal__nav button {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--afpf-border);
    background: #fff;
    color: var(--afpf-heading);
    cursor: pointer;
}
.afpf-cal__nav button:hover { border-color: var(--afpf-primary); color: var(--afpf-primary); }
.afpf-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.afpf-cal__dow { padding: 10px 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--afpf-body); text-transform: uppercase; background: #fafbff; }
.afpf-cal__day {
    min-height: 96px;
    padding: 8px;
    border-top: 1px solid var(--afpf-border);
    border-right: 1px solid var(--afpf-border);
    font-size: 13px;
}
.afpf-cal__day:nth-child(7n) { border-right: 0; }
.afpf-cal__day.is-out { background: #fbfbfd; color: #c0c4cf; }
.afpf-cal__day.is-today .afpf-cal__num { background: var(--afpf-gradient); color: #fff; }
.afpf-cal__num { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; color: var(--afpf-heading); }
.afpf-cal__ev {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 3px 6px;
    border: 0;
    border-radius: 6px;
    background: rgba(47, 87, 239, .09);
    color: var(--afpf-primary);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.afpf-cal__ev:hover { background: var(--afpf-gradient); color: #fff; }

/* --- fenêtre d'inscription ------------------------------------------- */
.afpf-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.afpf-modal[hidden] { display: none; }
.afpf-modal__backdrop { position: absolute; inset: 0; background: rgba(25, 35, 53, .55); backdrop-filter: blur(3px); }
.afpf-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 34px 36px 28px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(25, 35, 53, .3);
    animation: afpfIn .25s ease-out;
}
@keyframes afpfIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.afpf-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--afpf-soft);
    color: var(--afpf-heading);
    font-size: 18px;
    cursor: pointer;
}
.afpf-modal__head h3 { margin: 12px 0 4px; font-size: 26px; }
.afpf-modal__formation { margin: 0 0 18px; color: var(--afpf-primary); font-weight: 600; font-size: 16px; }
body.afpf-noscroll { overflow: hidden; }

.afpf-form { display: flex; flex-direction: column; gap: 14px; }
.afpf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.afpf-field { display: flex; flex-direction: column; gap: 6px; }
.afpf-field label { font-size: 14px; font-weight: 600; color: var(--afpf-heading); }
.afpf-field input,
.afpf-field select,
.afpf-field textarea {
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--afpf-border);
    border-radius: 10px;
    background: #fff;
    color: var(--afpf-heading);
    font-size: 15px;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s;
}
.afpf-field textarea { min-height: 90px; resize: vertical; }
.afpf-field input:focus,
.afpf-field select:focus,
.afpf-field textarea:focus { outline: 0; border-color: var(--afpf-primary); box-shadow: 0 0 0 4px rgba(47, 87, 239, .12); }
.afpf-field.is-invalid input,
.afpf-field.is-invalid select,
.afpf-field.is-invalid textarea { border-color: #e5484d; }
.afpf-field__err { color: #d13438; font-size: 13px; }
.afpf-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--afpf-body); cursor: pointer; }
.afpf-check input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--afpf-primary); }
.afpf-check.is-invalid span { color: #d13438; }
.afpf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.afpf-alert { padding: 12px 14px; border-radius: 10px; background: #fdecec; color: #b42318; font-size: 14px; }
.afpf-note { margin: 0; text-align: center; font-size: 13px; color: var(--afpf-body); }
.afpf-submit[disabled] { opacity: .7; cursor: progress; }
.afpf-success { text-align: center; padding: 20px 0 6px; }
.afpf-success__icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--afpf-gradient);
    color: #fff;
    font-size: 32px;
}

/* --- filtres du catalogue -------------------------------------------- */
.afpf-filters .afpf-filter-group { margin-bottom: 26px; }
.afpf-filters .afpf-filter-group h6 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--afpf-border); font-size: 17px; }
.afpf-filters label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    color: var(--afpf-body);
    font-size: 15px;
    cursor: pointer;
}
.afpf-filters label input { width: 17px; height: 17px; accent-color: var(--afpf-primary); flex-shrink: 0; }
.afpf-filters label span.count {
    margin-left: auto;
    min-width: 28px;
    padding: 1px 8px;
    border-radius: 100px;
    background: var(--afpf-soft);
    color: var(--afpf-body);
    font-size: 12px;
    text-align: center;
}
.afpf-filters label:hover { color: var(--afpf-primary); }
.afpf-filters .afpf-reset { margin-top: 6px; }
.afpf-card-hidden { display: none !important; }
.afpf-catalogue-empty { padding: 40px; border-radius: var(--afpf-radius); background: #fff; box-shadow: var(--afpf-shadow); text-align: center; }

@media (max-width: 767px) {
    .afpf-session { flex-wrap: wrap; }
    .afpf-session__cta { width: 100%; align-items: stretch; text-align: left; }
    .afpf-row { grid-template-columns: 1fr; }
    .afpf-modal__dialog { padding: 26px 20px 20px; }
    .afpf-grid { grid-template-columns: 1fr; }
    .afpf-cal__day { min-height: 64px; padding: 4px; }
    .afpf-cal__ev { font-size: 10px; padding: 2px 4px; }
    .afpf-nosession { flex-wrap: wrap; }
}

/* --- neutralisation des styles du thème dans nos composants ---------- */
/* le thème masque les cases à cocher natives : on les réaffiche */
.afpf-modal input[type=checkbox],
.afpf-filters input[type=checkbox] {
    position: static !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 18px !important;
    height: 18px !important;
    min-height: 0 !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: var(--afpf-primary);
}
.afpf-modal .afpf-check::before,
.afpf-modal .afpf-check::after,
.afpf-filters label::before,
.afpf-filters label::after { display: none !important; }
/* menus natifs (bootstrap-select retiré par le script) */
.afpf-modal select { display: block !important; -webkit-appearance: menulist; appearance: auto; }
.afpf-modal .bootstrap-select { display: none !important; }
.afpf-modal__head { margin-bottom: 18px; }
.afpf-modal__head .afpf-modal__formation { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
    .afpf-modal__dialog { animation: none; }
    .afpf-card, .afpf-session { transition: none; }
}

/* catalogue : prochaine session mise en avant */
.afpf-next.afpf-has-date { color: var(--afpf-primary); font-weight: 600; }
.afpf-next.afpf-has-date i { color: var(--afpf-primary); }
.rbt-card .afpf-chips .afpf-chip { font-size: 12px; padding: 3px 10px; }
