/* REVISION RESPONSIVE (2026-10-28)
 * Chargee en dernier (partials/css_include.php), apres le theme oneci.css et
 * style.css : corrige l'affichage telephone (< 576 px) et tablette (< 992 px)
 * sans toucher aux id/name utilises par les scripts de paiement. */

/* ---------- Base ---------- */

html,
body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* iOS zoome sur un champ dont le texte fait moins de 16 px. */
@media (max-width: 767.98px) {
    .form-control,
    .custom-select {
        font-size: 16px;
    }
}

/* ---------- En-tetes ---------- */

@media (max-width: 767.98px) {
    #hero-image {
        padding: 60px 0;
    }

    #hero-image h3 {
        font-size: 1.4rem;
    }

    #banner {
        padding: 30px 0;
    }

    #banner h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    #banner h2 {
        font-size: 1.25rem !important;
    }
}

/* ---------- Formulaires d'achat de timbre ---------- */

/* Bandeau d'avertissement (ancien <marquee>) : texte fixe, lisible en entier. */
.avertissement-identite {
    margin: 1.5rem 0 0;
    padding: .75rem 1rem;
    border-left: 4px solid #dc3545;
    background: #fdf2f3;
    color: #a71d2a;
    font-weight: 500;
    font-size: 1rem;
    text-align: left;
}

/* .form-group.row dont le libelle n'est pas dans une colonne : gouttieres. */
.formTimbre .form-group.row {
    margin-left: 0;
    margin-right: 0;
}

.formTimbre .form-group.row > label {
    width: 100%;
}

/* Cadre des choix (titre, lieu de demande, type de demande, formule...). */
.choix-cadre {
    border: 1px solid #95919130;
    border-radius: .25rem;
    width: 100%;
    padding: 6px;
    margin-left: 0;
    margin-right: 0;
}

/* Bouton radio et son libelle sur la meme ligne, zone tactile confortable. */
.formTimbre input.checkbox[type=radio],
.modal input.checkbox[type=radio] {
    float: left;
    width: 1.15rem;
    height: 1.15rem;
    margin: .55rem .6rem 0 0;
    accent-color: #f39200;
    cursor: pointer;
}

.formTimbre input.checkbox[type=radio] + label,
.modal input.checkbox[type=radio] + label {
    display: block;
    overflow: hidden;
    min-height: 2.25rem;
    padding: .35rem 0 .45rem;
    margin-bottom: 0;
    cursor: pointer;
}

.formTimbre input.checkbox + label > span:empty,
.formTimbre input.checkbox + label > span > img,
.modal input.checkbox + label > span > img {
    display: none;
}

/* Choix Oui / Non des fenetres Duplicata et Modification. */
.choix-oui-non {
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
}

.choix-oui-non > [class*=col-] {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0 1.25rem;
}

/* ---------- Fenetre de choix du moyen de paiement ----------
 * #chooseWay et non .paymentWayForm : ce <form> est imbrique dans #form_cni,
 * le navigateur l'ignore et il n'existe pas dans le DOM. */

#chooseWay .pw-mobile,
#chooseWay .pw-visa {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
    padding: .5rem;
    border: 2px solid #e9ecef;
    border-radius: .5rem;
    cursor: pointer;
    transition: border-color .2s;
}

#chooseWay .pw-mobile:has(input:checked),
#chooseWay .pw-visa:has(input:checked) {
    border-color: #f39200;
    background: #fff8ee;
}

#chooseWay .pw-mobile img,
#chooseWay .pw-visa img {
    max-height: 100px;
    width: auto;
}

@media (max-width: 767.98px) {
    #chooseWay .modal-body > .row > [class*=col-] {
        margin-bottom: .75rem;
    }

    /* Radio a gauche du logo : trois choix tiennent sur un ecran. */
    #chooseWay .pw-mobile,
    #chooseWay .pw-visa {
        flex-direction: row;
        justify-content: flex-start;
        gap: .75rem;
    }

    /* Images avec beaucoup de blanc autour du logo : hauteur genereuse. */
    #chooseWay .pw-mobile img,
    #chooseWay .pw-visa img {
        max-height: 96px;
        max-width: calc(100% - 2rem);
    }

    #chooseWay #payBtn {
        width: 100%;
    }
}

/* Fenetres modales : marges reduites et boutons empilables. */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: .5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer > .btn {
        flex: 1 1 auto;
    }
}

/* ---------- Tables en fiches (< 992 px) ----------
 * Table des centres d'enrolement et resultat de la recherche de recu : une
 * fiche par ligne, chaque valeur precedee du nom de sa colonne. */

@media (max-width: 991.98px) {
    .table-fiches,
    .table-fiches tbody,
    .table-fiches tr,
    .table-fiches td {
        display: block;
        width: 100% !important;
    }

    /* tfoot : repetition de l'en-tete. */
    .table-fiches tfoot {
        display: none;
    }

    .table-fiches thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .table-fiches tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .5rem;
        overflow: hidden;
        background: #fff;
    }

    .table-fiches td {
        border: 0 !important;
        border-bottom: 1px solid #f1f3f5 !important;
        padding: .5rem .75rem;
    }

    .table-fiches td:last-child {
        border-bottom: 0 !important;
    }

    .table-fiches td p {
        margin-bottom: 0;
    }

    .table-fiches td .btn {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .table-fiches td::before {
        display: block;
        font-size: .75rem;
        font-weight: 500;
        text-transform: uppercase;
        color: #66799e;
    }

    /* Centres d'enrolement */
    #centres td:nth-child(1)::before { content: "Région"; color: rgba(255, 255, 255, .85); }
    #centres td:nth-child(2)::before { content: "Département"; }
    #centres td:nth-child(3)::before { content: "Localité"; }
    #centres td:nth-child(4)::before { content: "Localisation"; }

    /* Resultat de la recherche de recu */
    #vouchers td:nth-child(1)::before { content: "Date du paiement"; }
    #vouchers td:nth-child(2)::before { content: "Nom et prénoms"; }
    #vouchers td:nth-child(3)::before { content: "Date de naissance"; }
    #vouchers td:nth-child(4)::before { content: "Type de demande"; }
    #vouchers td:nth-child(5)::before { content: "Statut"; }
    #vouchers td:nth-child(6)::before { content: none; }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0 !important;
        text-align: left;
    }
}

/* ---------- Pied de page ---------- */

/* #66799e sur #2a354f : contraste 2,9:1, insuffisant (WCAG AA : 4,5:1). */
#footer ul > li a,
#footer .text-gray {
    color: #b4c0d6 !important;
}

#footer ul > li a {
    display: inline-block;
    padding: .2rem 0;
}

@media (max-width: 767.98px) {
    #footer {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    #footer p.text-center a {
        word-break: break-word;
    }
}

/* ---------- Menu mobile ---------- */

@media (max-width: 991.98px) {
    .navbar-toggler {
        padding: .5rem .65rem;
    }

    #collapsibleNavId .nav-item .btn {
        padding: .75rem;
    }
}
