/* Styles listes + modales BIV (biv-modal, biv-btn-*, etc.).
 * Thème sombre des modales / Select2 / Tom Select : assets/styles/modal-dark.css (import ci-dessous).
 */
@import "list-page-rU2XaRP.css";
@import "modal-dark-KamPVKg.css";

html {
    height: 100%;
}

body {
    min-height: 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.wrapper {
    width: 100%;
}

/* ── Layout principal ────────────────────────────────────── */
.my-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

/* ── Composants généraux ─────────────────────────────────── */
.charts {
    width: 300px;
    height: 300px;
}

ul {
    padding: 20px 10px 10px 10px;
}

li button,
li a {
    border-radius: 5px;
    transition: all 200ms ease-in-out;
}

.required:after {
    content: " *";
    color: red;
}

.actionCursor {
    cursor: pointer;
}

.center-div {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.grabbable {
    cursor: grab;
}

.grabbable:active {
    cursor: grabbing;
}

.filter-div {
    display: inline;
    width: 20%;
}

#checklistFilesBox {
    display: none;
}

#auditFilesBox {
    display: none;
}

.questionsScroll {
    max-height: 30rem;
}

.renderedForm_inputs {
    max-height: 70vh;
}

@media (max-height: 700px) {
    .questionsScroll {
        max-height: 25rem;
    }

    .renderedForm_inputs {
        max-height: 45vh;
    }

    #checklistFormModal .biv-carousel-slide-wrap,
    #auditFormModal .biv-carousel-slide-wrap {
        max-height: 22rem;
    }
}

/* ── Carousel questions (modales checklist + audit) ───────── */
#checklistFormModal .biv-checklist-questions-carousel,
#auditFormModal .biv-checklist-questions-carousel {
    min-height: 0;
}

#checklistFormModal .biv-carousel-slide-wrap,
#auditFormModal .biv-carousel-slide-wrap {
    max-height: 30rem;
    min-height: 11rem;
    padding-inline: 1rem;
}

@media (min-width: 992px) {
    #checklistFormModal .biv-carousel-slide-wrap,
    #auditFormModal .biv-carousel-slide-wrap {
        padding-inline: 1.25rem;
    }
}

/* Une seule colonne flex : en-tête fixe, zone réponses scroll */
#checklistFormModal .biv-carousel-slide-wrap > ul#questionsList,
#auditFormModal .biv-carousel-slide-wrap > ul#questionsList {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#checklistFormModal ul#questionsList > li.biv-carousel-slide-active,
#auditFormModal ul#questionsList > li.biv-carousel-slide-active {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
}

/* Bloc Symfony pour une question : texte + type visibles, partie réponses extensible */
#checklistFormModal .biv-checklist-question-root,
#auditFormModal .biv-checklist-question-root {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

#checklistFormModal .biv-checklist-question-root > *:not(.biv-checklist-qvalues-mount),
#auditFormModal .biv-checklist-question-root > *:not(.biv-checklist-qvalues-mount) {
    flex-shrink: 0;
}

#checklistFormModal .biv-checklist-question-root > .biv-checklist-qvalues-mount,
#auditFormModal .biv-checklist-question-root > .biv-checklist-qvalues-mount {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0.125rem;
}

#checklistFormModal .biv-checklist-question-values-scroll,
#auditFormModal .biv-checklist-question-values-scroll {
    flex: 1 1 auto;
    min-height: 4rem;
    max-height: 14rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.15rem;
    margin-top: 0.25rem;
    scrollbar-width: thin;
}

@media (min-width: 992px) {
    #checklistFormModal .biv-checklist-question-values-scroll,
    #auditFormModal .biv-checklist-question-values-scroll {
        max-height: 18rem;
    }
}

#checklistFormModal .biv-checklist-question-values-scroll::-webkit-scrollbar,
#auditFormModal .biv-checklist-question-values-scroll::-webkit-scrollbar {
    width: 6px;
}

#checklistFormModal .biv-checklist-question-values-scroll::-webkit-scrollbar-thumb,
#auditFormModal .biv-checklist-question-values-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(var(--bs-secondary-rgb, 108, 117, 125), 0.45);
    border-radius: 999px;
}

/* Champs question / réponses : pleine largeur dans le panneau */
#checklistFormModal #questionsList .form-select,
#checklistFormModal #questionsList textarea.form-control,
#checklistFormModal #questionsList input.form-control:not(.biv-checklist-qvalue-field),
#auditFormModal #questionsList .form-select,
#auditFormModal #questionsList textarea.form-control,
#auditFormModal #questionsList input.form-control:not(.biv-checklist-qvalue-field) {
    width: 100% !important;
    max-width: none;
}

#checklistFormModal #questionsList .w-75,
#auditFormModal #questionsList .w-75 {
    width: 100% !important;
}

/* Lignes « Valeur n » — une seule ligne, poubelle intégrée */
#checklistFormModal .biv-checklist-qvalue-row__inner,
#auditFormModal .biv-checklist-qvalue-row__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    width: 100%;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--bs-tertiary-bg);
}

#checklistFormModal .biv-checklist-qvalue-row:focus-within .biv-checklist-qvalue-row__inner,
#checklistFormModal .biv-checklist-qvalue-row:hover .biv-checklist-qvalue-row__inner,
#auditFormModal .biv-checklist-qvalue-row:focus-within .biv-checklist-qvalue-row__inner,
#auditFormModal .biv-checklist-qvalue-row:hover .biv-checklist-qvalue-row__inner {
    border-color: var(--bs-secondary);
}

#checklistFormModal .biv-checklist-qvalue-row__label,
#auditFormModal .biv-checklist-qvalue-row__label {
    flex: 0 0 auto;
    min-width: 4.85rem;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
    white-space: nowrap;
}

#checklistFormModal .biv-checklist-qvalue-field.form-control,
#auditFormModal .biv-checklist-qvalue-field.form-control {
    width: auto !important;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0.375rem;
}

#checklistFormModal .biv-checklist-qvalue-actions,
#auditFormModal .biv-checklist-qvalue-actions {
    flex: 0 0 auto;
    width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#checklistFormModal .biv-checklist-qvalue-delete.btn,
#auditFormModal .biv-checklist-qvalue-delete.btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
}

#checklistFormModal ul#questionsList,
#auditFormModal ul#questionsList {
    padding: 0;
}

#checklistFormModal ul#questionsList > li.biv-carousel-question-slide:not(.biv-carousel-slide-active),
#auditFormModal ul#questionsList > li.biv-carousel-question-slide:not(.biv-carousel-slide-active) {
    display: none !important;
}

#checklistFormModal .biv-carousel-nav.btn-sm,
#auditFormModal .biv-carousel-nav.btn-sm {
    width: 2rem;
    height: 2rem;
    padding: 0;
    line-height: 1;
}

#checklistFormModal #checklistCarouselDeleteQuestion.biv-carousel-toolbar-icon,
#auditFormModal #auditCarouselDeleteQuestion.biv-carousel-toolbar-icon {
    width: 1.875rem;
    height: 1.875rem;
}

#checklistFormModal .biv-carousel-nav,
#auditFormModal .biv-carousel-nav {
    color: inherit;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

#checklistFormModal .biv-carousel-nav:hover:not(:disabled),
#checklistFormModal .biv-carousel-nav:focus:not(:disabled),
#auditFormModal .biv-carousel-nav:hover:not(:disabled),
#auditFormModal .biv-carousel-nav:focus:not(:disabled) {
    border-color: var(--bs-secondary);
}

#checklistFormModal #checklistCarouselCounter.biv-carousel-counter,
#auditFormModal #auditCarouselCounter.biv-carousel-counter {
    position: relative;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.45rem 1.1rem 0.5rem;
    color: #faf9f7 !important;
    background: linear-gradient(135deg, #2c2c31 0%, #4a4a52 55%, #38383e 100%);
    border: none;
    border-radius: 999px;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: saturate(1.1);
}

#checklistFormModal #checklistCarouselCounter .biv-carousel-counter__cur,
#auditFormModal #auditCarouselCounter .biv-carousel-counter__cur {
    font-size: 1.18em;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

#checklistFormModal #checklistCarouselCounter .biv-carousel-counter__sep,
#auditFormModal #auditCarouselCounter .biv-carousel-counter__sep {
    opacity: 0.55;
    font-weight: 500;
}

#checklistFormModal #checklistCarouselCounter .biv-carousel-counter__total,
#auditFormModal #auditCarouselCounter .biv-carousel-counter__total {
    opacity: 0.88;
    font-weight: 600;
}

[data-bs-theme="dark"] #checklistFormModal #checklistCarouselCounter.biv-carousel-counter,
[data-bs-theme="dark"] #auditFormModal #auditCarouselCounter.biv-carousel-counter {
    color: #1a1918 !important;
    background: linear-gradient(145deg, #fffcf5 0%, #eae6df 52%, #d8d4cc 100%);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 #fff;
}

[data-bs-theme="dark"] #checklistFormModal #checklistCarouselCounter .biv-carousel-counter__cur,
[data-bs-theme="dark"] #auditFormModal #auditCarouselCounter .biv-carousel-counter__cur {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] #checklistFormModal #checklistCarouselCounter .biv-carousel-counter__sep,
[data-bs-theme="dark"] #auditFormModal #auditCarouselCounter .biv-carousel-counter__sep {
    opacity: 0.5;
}

[data-bs-theme="dark"] #checklistFormModal #checklistCarouselCounter .biv-carousel-counter__total,
[data-bs-theme="dark"] #auditFormModal #auditCarouselCounter .biv-carousel-counter__total {
    opacity: 0.75;
}

/* ── Modal saisie résultats checklist / audit & modals contrôle admin (carousel par question) ───────── */
#checklistRenderedFormModal .biv-rendered-slides-mount,
#auditRenderedFormModal .biv-rendered-slides-mount,
#checklistControlModal .biv-rendered-slides-mount,
#auditControlModal .biv-rendered-slides-mount {
    min-height: min(52vh, 28rem);
}

/* Une question à la fois : aperçu + saisie. Résultat final (= readonly, tout déplié) sur la modal liste. Contrôle admin = une question visible. */
#checklistRenderedFormModal.biv-rendered-has-slides:not(.biv-rendered-readonly-results)
    .biv-rendered-q-slide:not(.biv-rendered-q-slide-active),
#auditRenderedFormModal.biv-rendered-has-slides:not(.biv-rendered-readonly-results)
    .biv-rendered-q-slide:not(.biv-rendered-q-slide-active),
#checklistControlModal.biv-rendered-has-slides .biv-rendered-q-slide:not(.biv-rendered-q-slide-active),
#auditControlModal.biv-rendered-has-slides .biv-rendered-q-slide:not(.biv-rendered-q-slide-active) {
    display: none !important;
}

#checklistRenderedFormModal .biv-rendered-q-card,
#auditRenderedFormModal .biv-rendered-q-card,
#checklistControlModal .biv-rendered-q-card,
#auditControlModal .biv-rendered-q-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 0.35rem 1.15rem rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] #checklistRenderedFormModal .biv-rendered-q-card,
[data-bs-theme="dark"] #auditRenderedFormModal .biv-rendered-q-card,
[data-bs-theme="dark"] #checklistControlModal .biv-rendered-q-card,
[data-bs-theme="dark"] #auditControlModal .biv-rendered-q-card {
    box-shadow: 0 0.35rem 1.35rem rgba(0, 0, 0, 0.35);
}

#checklistRenderedFormModal .biv-rendered-choice,
#auditRenderedFormModal .biv-rendered-choice {
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease;
}

#checklistRenderedFormModal .biv-rendered-choice:hover,
#checklistRenderedFormModal .biv-rendered-choice:focus-within,
#auditRenderedFormModal .biv-rendered-choice:hover,
#auditRenderedFormModal .biv-rendered-choice:focus-within {
    border-color: var(--bs-secondary) !important;
    box-shadow: 0 0.125rem 0.65rem rgba(var(--bs-primary-rgb), 0.14);
}

#checklistControlModal .biv-rendered-choice,
#auditControlModal .biv-rendered-choice {
    cursor: default;
}

/* Modal contrôle : scroll uniquement sur les questions ; en-tête + pied fixes */
#checklistControlModal.modal .modal-dialog.biv-modal-dialog--control,
#auditControlModal.modal .modal-dialog.biv-modal-dialog--control {
    max-height: calc(100vh - 3.5rem);
}
#checklistControlModal.modal .modal-content,
#auditControlModal.modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, calc(100vh - 3.5rem));
    min-height: 0;
}
#checklistControlModal.modal .modal-header.biv-modal__header--hero,
#checklistControlModal.modal .modal-header,
#auditControlModal.modal .modal-header.biv-modal__header--hero,
#auditControlModal.modal .modal-header {
    flex-shrink: 0;
}
#checklistControlModal.modal .modal-body.biv-checklist-control-modal__body,
#auditControlModal.modal .modal-body.biv-audit-control-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Zone questions : prend l’espace restant sous le bloc métadonnées */
#checklistControlModal .biv-rendered-slides-mount.biv-checklist-control-slides-mount,
#auditControlModal .biv-rendered-slides-mount.biv-audit-control-slides-mount {
    min-height: 0 !important;
    flex: 1 1 0%;
}
#checklistControlModal.modal .modal-body > #checklistControlChecklistFilesBox {
    flex-shrink: 0;
}

#checklistRenderedFormModal .biv-rendered-carousel-footer,
#auditRenderedFormModal .biv-rendered-carousel-footer,
#checklistControlModal .biv-rendered-carousel-footer,
#auditControlModal .biv-rendered-carousel-footer {
    background-color: var(--bs-body-bg);
    backdrop-filter: blur(10px);
}

@media (max-width: 767.98px) {
    #checklistRenderedFormModal .modal-body,
    #auditRenderedFormModal .modal-body,
    #checklistControlModal .modal-body,
    #auditControlModal .modal-body {
        padding-inline: 0.65rem;
    }

    #checklistRenderedFormModal .biv-rendered-carousel-footer .btn,
    #auditRenderedFormModal .biv-rendered-carousel-footer .btn,
    #checklistControlModal .biv-rendered-carousel-footer .btn,
    #auditControlModal .biv-rendered-carousel-footer .btn {
        min-height: 2.75rem;
    }
}

.loadingSpinner {
    width: 5rem;
    height: 5rem;
}

.select2-selection.select2-selection--single {
    padding-right: 50px !important;
}

/* Select2 Bootstrap 5 dans les modales : alignement `.form-select` (toutes .biv-modal) */
.biv-modal .select2-container--bootstrap-5 {
    display: block;
    max-width: 100%;
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--single {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.65rem 0.375rem 0.75rem !important;
    align-items: center;
}

.biv-modal .select2-container--bootstrap-5 .select2-selection__rendered {
    padding-left: 0;
}

.biv-modal .select2-container--bootstrap-5.select2-container--disabled .select2-selection {
    background-color: var(--bs-secondary-bg);
}

/* Sélection multiple (questions select-multiple) : pastilles compactes lisibles dans les modales. */
.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: calc(1.35em + 0.65rem + 2px);
    padding: 0.2rem 0.38rem;
    border-radius: var(--bs-border-radius-lg, 0.5rem);
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    align-items: center;
    padding: 0;
    margin: 0;
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    float: none;
    margin: 0;
    padding: 0.15rem 0.42rem;
    padding-right: 0.28rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    font-weight: 500;
    border-radius: 50rem;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

/* Accent pastilles — thème clair seulement (le sombre : modal-dark.css) */
:root:not([data-bs-theme="dark"]) .biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    border: 1px solid rgba(var(--bs-success-rgb), 0.4);
    background-color: rgba(var(--bs-success-rgb), 0.06);
    color: var(--bs-emphasis-color);
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__display {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(13rem, 100%);
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 0.08rem;
    padding: 0 0.2rem;
    font-size: 0.92rem;
    line-height: 1;
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline {
    float: none;
    margin-top: 0;
}

.biv-modal .select2-container--bootstrap-5 .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin: 0;
    min-height: 1.5rem;
    padding: 0.1rem 0.25rem !important;
    font-size: 0.875rem;
    line-height: 1.35;
}
