form {
    margin: 20px 0;
    clear: both;
}
fieldset {
    border: none;
}
legend {
    font-weight: 600;
}
textarea,
.champ,
select {
    font-style: normal;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
input,
textarea,
select {
    display: table-cell;
    margin: .5em 0;
    padding: .5em;
    vertical-align: middle;
    border-radius: 5px;
    max-width: 100%;
}
select {
    max-width: 100%;
    width: 100%;
}
option {
    padding: .3em;
    border: none;
    max-width: 100%;
    width: 100%;
}
input:focus,
input.sffocus,
textarea:focus,
textarea.sffocus,
select:focus,
select.sffocus {
    font-weight: normal;
    outline-offset: 2px;
}
.required {}
:valid {}
[required],
:required {}

/* -- Labels ---------------------------------------------------------- */

label {
    display: table-cell;
    width: 45%;
    font-weight: 600;
    vertical-align: bottom;
    padding: .5em 5% .5em 0;
}
textarea,
input[type=text],
input[type=email],
input[type=file],
input[type=username],
input[type=password] {
    width: 95%;
    padding-left: 2.5%;
    padding-right: 2.5%;
}

/* Champs obligatoires : bordure gauche discrète (couleur définie dans couleur.css) */
input[required],
select[required],
textarea[required] {
    border-left-width: 3px;
    border-left-style: solid;
}

/* -- Boutons --------------------------------------------------------- */

button,
input[type=button],
input[type=submit] {
    padding: 1em 1.5em;
    margin: 1em 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color .2s;
}
button.submit_precedent,
input[type=submit].submit_precedent {
    margin-right: .5em;
}

/* -- Radio / Checkbox ----------------------------------------------- */

input[type=radio],
input[type=checkbox] {
    width: 40px;
}
input[type=radio]:checked + label,
input[type=checkbox]:checked + label {
    font-weight: 600;
}
input[type=file] {}

/* -- Formulaire (classe .formulaire) --------------------------------- */
/* Règles héritées de l'ancien espace privé SPIP, conservées pour compat */

.formulaire form {
    clear: both;
}
.formulaire form H4,
.formulaire form .chapo {
    color: black;
}
.formulaire .label,
.formulaire .ligne,
.formulaire .ligne a {
    color: black;
    font-style: normal;
}
.formulaire hr {
    border-top: 1px dashed black;
}
.champ .submit,
.formulaire .submit {
    background-color: #FFFFFF;
    color: #058CC9;
    font-weight: 600;
    text-align: center;
}
.formulaire,
.formulaire .champ table {
    color: black;
    font-style: italic;
    font-size: 11px;
}

/* -- Structure générale des champs saisies --------------------------- */

form li {
    list-style: none;
}
.fieldset {
    margin: 15px 0;
    clear: both;
}

/* Légende fieldset SPIP saisies (section fieldset) */
fieldset.saisie_fieldset > legend,
.saisie_fieldset fieldset > legend.legend {
    display: block;
    border-bottom: 2px solid transparent;
    width: 100%;
    margin: 10px 0;
    padding: 10px 0;
    text-align: left;
}

/* Légende des checkbox/radio alignée comme un label de champ input */
/* Utilisé uniquement dans le contexte .editer (saisies SPIP) */
.saisie_checkbox > legend.editer-label,
.saisie_radio > legend.editer-label {
    display: table-cell;
    width: 45%;
    font-weight: 600;
    vertical-align: bottom;
    padding: .5em 5% .5em 0;
    border-bottom: none;
    margin: 0;
}

.fieldset ul {
    list-style: none;
}
.fieldset ul li {}

/* Champs en disposition tableau (label 45% | champ 55%) */
.saisie_date,
.saisie_input,
.saisie_email,
.saisie_nom_inscription,
.saisie_mail_inscription,
.saisie_selection {
    display: table;
    width: 100%;
    clear: both;
    padding: .75em 0;
}

/* Checkbox et radio : legend positionnée absolument à gauche,
   choix dans la zone droite (padding-left: 45%) */
.editer.saisie_checkbox,
.editer.saisie_radio {
    display: block;
    width: 100%;
    clear: both;
    padding: .5em 0 .5em 45%;
    box-sizing: border-box;
    position: relative;
}
.editer.saisie_checkbox > legend.editer-label,
.editer.saisie_radio > legend.editer-label {
    position: absolute;
    left: 0;
    top: .5em;
    width: 45%;
    font-weight: 600;
    padding-right: 5%;
    box-sizing: border-box;
    border-bottom: none;
    margin: 0;
}

/* Labels dans les choix */
.saisie_checkbox label,
.saisie_radio label,
.saisie_oui_non label,
.saisie_case label {
    display: block;
    width: 100%;
}
.saisie_radio .choix {
    display: inline-table;
    width: 100%;
}
.saisie_case .choix {
    display: table;
    width: 100%;
}
.choix input {
    width: 45px;
}
.choix label {
    width: auto;
}
.saisie_date .choix label,
.saisie_checkbox .choix label,
.saisie_radio .choix label,
.saisie_oui_non .choix label,
.saisie_case .choix label {
    display: table-cell;
    font-weight: normal;
    font-size: 1em;
}
.saisie_checkbox .choix label,
.saisie_radio .choix label,
.saisie_oui_non .choix label,
.saisie_case .choix label {
    width: 100%;
}

/* Zone de clic élargie sur radio/checkbox */
.saisie_radio .choix label,
.saisie_checkbox .choix label {
    padding: .4em 0;
    cursor: pointer;
}

/* Textarea */
.saisie_textarea {}
.saisie_textarea label {}
.saisie_textarea textarea {
    width: 95%;
    padding: .5em 2.5%;
}

/* -- Boutons de soumission ------------------------------------------- */

p.boutons {
    text-align: center;
}

/* -- Messages d'erreur et d'alerte ----------------------------------- */

.reponse_formulaire_erreur,
.erreur_message {
    font-weight: 600;
    color: red;
}
.alerte_message {
    font-weight: 600;
    color: #ff8d00;
}
/* Erreurs globales (classe .erreur sur le conteneur) */
.erreur input,
.erreur textarea,
.erreur select,
.erreur option {
    border: 1px solid red;
    background-color: #FFEFEF;
}
/* Erreurs inline par champ (.editer.erreur) */
.editer.erreur input,
.editer.erreur select,
.editer.erreur textarea {
    border: 2px solid #FB4204;
    background-color: #FFEFEF;
}
.editer.erreur .explication {
    color: #FB4204;
    font-weight: 600;
}
.msg_err { color: #FB4204; }
.msg_ok  { color: #058CC9; }

/* -- Explication / aide ---------------------------------------------- */

.formulaire_spip .explication {
    padding: 5px 10px;
    margin-bottom: 0;
    background-color: #F5F5F5;
}

/* -- Séparation entre fieldsets participants ------------------------- */

.saisie_fieldset + .saisie_fieldset {
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

/* -- Checkbox éditable (saisies SPIP) -------------------------------- */

.editer.saisie_checkbox .choix {
    float: left;
    min-width: 25%;
    width: 100%;
    display: table;
    text-align: left;
}
.editer.saisie_checkbox .choix input {
    width: 25px;
    text-align: left;
}
.editer.saisie_checkbox .choix label {
    width: 100%;
    text-align: left;
}
.editer.saisie_fichiers {}
.editer.saisie_fichiers .choix {
    display: block;
}
.editer.saisie_fichiers .choix input {
    width: 95%;
}
.editer.saisie_checkbox .choix.choix_alternatif {
    display: block;
}
.editer.saisie_checkbox .choix.choix_alternatif * {
    display: inline-block;
}
.editer.saisie_checkbox .choix.choix_alternatif label {
    width: auto;
    float: left;
}
.editer.saisie_checkbox .choix.choix_alternatif input {
    width: 50%;
}

/* -- Checkbox stylée Font Awesome ------------------------------------ */

.checkbox input[type=checkbox] {
    display: none;
}
.checkbox input[type=checkbox] + label:before {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    font-family: 'Font Awesome 6 Free', serif;
    font-weight: normal;
    padding: 0 .5em;
    width: 20px;
    height: 20px;
    font-size: 20px;
    content: "\f0c8";
}
.checkbox input[type=checkbox]:checked + label:before {
    content: "\f14a";
}

/* -------------------------------------------------------
   Navigation multi-étapes (couleurs dans couleur.css)
------------------------------------------------------- */

.formulaire_spip__etapes {
    margin: 1.5em 0 2em;
    overflow: hidden;
}
.etapes__items {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: etape;
    align-items: flex-start;
}
.etapes__item {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: .8em;
    color: #aaa;
    padding: .25em .25em;
    counter-increment: etape;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Ligne de connexion entre étapes */
.etapes__item::before {
    content: '';
    position: absolute;
    top: 15px;
    left: calc(-50%);
    right: calc(50%);
    height: 2px;
    /*background-color: #e0e0e0;*/
    z-index: 0;
}
.etapes__item:first-child::before {
    display: none;
}
/* Cercle numéroté */
.etapes__item::after {
    content: counter(etape);
    display: block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #aaa;
    font-weight: 700;
    font-size: 1em;
    margin: 0 auto .5em;
    position: relative;
    z-index: 1;
    border: 2px solid #e0e0e0;
}
/* Label de l'étape */
.etapes__item > button,
.etapes__item > em,
.etapes__item > span {
    display: block;
    margin-top: .25em;
    padding: .3em 0;
    line-height: 1.2;
}
.etapes__item[aria-current="step"]::after {
    font-size: 1em;
}
.etapes__item[aria-current="step"] em {
    font-style: normal;
    font-weight: 700;
}
/* Bouton retour (étapes passées) */
.etapes__item button.submit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
    font-weight: normal;
    color: inherit;
}
/* Étapes futures */
.etapes__item span {
    color: #ccc;
}

/* -------------------------------------------------------
   Responsive : empilé sous 600px
------------------------------------------------------- */

@media (max-width: 600px) {
    label {
        display: block;
        width: 100%;
        padding: .3em 0;
    }
    .saisie_date,
    .saisie_input,
    .saisie_email,
    .saisie_nom_inscription,
    .saisie_mail_inscription,
    .saisie_selection {
        display: block;
    }
    textarea,
    input[type=text],
    input[type=email],
    input[type=file],
    input[type=password] {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }
    /* Checkbox/radio : legend en bloc, plus de position absolute */
    .editer.saisie_checkbox,
    .editer.saisie_radio {
        padding-left: 0;
    }
    .editer.saisie_checkbox > legend.editer-label,
    .editer.saisie_radio > legend.editer-label {
        position: static;
        width: 100%;
        padding-right: 0;
    }
    /* Nav étapes : liste verticale */
    .etapes__items {
        flex-direction: column;
        gap: .25em;
    }
    .etapes__item::before {
        display: none;
    }
    .etapes__item::after {
        display: inline-block;
        margin: 0 .5em 0 0;
        vertical-align: middle;
    }
    .etapes__item > button,
    .etapes__item > em,
    .etapes__item > span {
        display: inline;
        vertical-align: middle;
    }
}
