/*
 * Compléments à la feuille de style d'origine.
 * Uniquement ce que le site WordPress obtenait par son JavaScript ou par des
 * éléments d'interface que l'application remplace.
 */

/* Message d'erreur de validation, repris de la charte Formidable. */
.frm_error_style {
    background: #fee4e2;
    color: #f04438;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.frm_message {
    background: #e6f5f4;
    color: #017a72;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

/* Bouton « Retour » : même gabarit que le bouton de validation, en retrait. */
.frm_submit .frm_prev_page {
    background: none;
    color: #667085;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.frm_submit .frm_prev_page:hover {
    background: #f9fafb;
    color: #1d2939;
}

/* Sections répétables : bouton d'ajout et de retrait d'une ligne. */
.frm_repeat_buttons button {
    background: none;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 14px;
    color: #667085;
    cursor: pointer;
}

.frm_repeat_buttons button:hover {
    border-color: #019a90;
    color: #019a90;
}

/* ---------- Boutons de navigation du parcours ---------- */

.rse-actions {
    display: block;
    margin-top: 24px;
}

/* « Précédent » à gauche, « Valider et continuer » à sa droite. */
.rse-actions__ligne {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rse-actions__brouillon {
    text-align: center;
    margin-top: 12px;
}

.rse-precedent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Sur mobile, la flèche seule suffit : le libellé prendrait trop de place. */
@media (max-width: 480px) {
    .rse-precedent__texte {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* Sauvegarde du brouillon : action secondaire, présentée comme un lien. */
.rse-actions__brouillon .frm_save_draft {
    background: none;
    border: none;
    color: #667085;
    font-family: inherit;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px;
}

.rse-actions__brouillon .frm_save_draft:hover {
    color: #019a90;
}

/* ---------- Colonne latérale : chapitres cliquables ---------- */

.svg-item.rse-chapitre--ouvrable {
    cursor: pointer;
    transition: transform .15s ease;
}

.svg-item.rse-chapitre--ouvrable:hover,
.svg-item.rse-chapitre--ouvrable:focus-visible {
    transform: scale(1.06);
}

.svg-item.rse-chapitre--ouvrable:focus-visible {
    outline: 2px solid #019a90;
    outline-offset: 3px;
    border-radius: 50%;
}

.svg-item[aria-disabled="true"] {
    cursor: default;
}

/* ---------- Sommaire d'un chapitre ---------- */

.rse-sommaire {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 69, 72, .55);
    padding: 20px;
}

.rse-sommaire[hidden] {
    display: none;
}

.rse-sommaire__boite {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px 28px 24px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, .25);
}

.rse-sommaire__fermer {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 2px solid #019a90;
    border-radius: 6px;
    background: #fff;
    color: #019a90;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.rse-sommaire__fermer:hover {
    background: #019a90;
    color: #fff;
}

.rse-sommaire__chapitre {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: #174548;
}

.rse-sommaire__compte {
    margin: 0 0 20px;
    font-size: 13px;
    color: #667085;
}

.rse-sommaire__liste {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rse-sommaire__item + .rse-sommaire__item {
    border-top: 1px solid #eaecf0;
}

.rse-sommaire__item a,
.rse-sommaire__item span[aria-disabled] {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 4px;
    text-decoration: none;
    color: #344054;
    font-size: 14.5px;
    line-height: 1.4;
}

.rse-sommaire__item a:hover {
    color: #019a90;
}

/* Une page pas encore atteinte reste visible mais en retrait. */
.rse-sommaire__item--verrouille {
    opacity: .45;
}

.rse-sommaire__item--verrouille span[aria-disabled] {
    cursor: not-allowed;
}

.rse-sommaire__puce {
    flex: 0 0 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #d0d5dd;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    color: transparent;
    margin-top: 1px;
}

.rse-sommaire__item--repondu .rse-sommaire__puce {
    background: #019a90;
    border-color: #019a90;
    color: #fff;
}

.rse-sommaire__item--courante {
    background: #e6f5f4;
    border-radius: 8px;
}

.rse-sommaire__item--courante .rse-sommaire__texte {
    font-weight: 600;
    color: #017a72;
}

body.rse-sommaire-ouvert {
    overflow: hidden;
}

/* ---------- Champs fichier : aperçus ---------- */

.rse-fichiers {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rse-fichier {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 140px;
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
}

.rse-fichier__apercu {
    width: 100%;
    height: 90px;
    object-fit: contain;
    background: #f9fafb;
    border-radius: 4px;
}

/* Fichier introuvable sur le disque : on le signale sans casser la mise en page. */
.rse-fichier__absent {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    background: #f9fafb;
    border-radius: 4px;
    color: #98a2b3;
    font-size: 28px;
}

.rse-fichier__nom {
    font-size: 12px;
    color: #475467;
    word-break: break-word;
    line-height: 1.3;
}

.rse-fichier__retirer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #667085;
    cursor: pointer;
}

.rse-fichier__retirer input { accent-color: #f04438; }

/* Une image cochée pour retrait est visiblement mise de côté. */
.rse-fichier:has(input:checked) {
    border-color: #f04438;
    opacity: .55;
}

.rse-fichier:has(input:checked) .rse-fichier__nom {
    text-decoration: line-through;
}

.rse-fichier__aide,
.rse-fichier__complet {
    font-size: 13px;
    color: #667085;
    margin-top: 6px;
}
