/* ── Tutoriels guidés : modal #modal-tuto (carrousel d'étapes, voir tuto.js) ── */
#modal-tuto {
    width: min(900px, 94%);
    max-height: 92%;
    top: 4% !important;
    overflow: hidden;
}

#modal-tuto.open {
    display: flex !important;
    flex-direction: column;
}

#modal-tuto > .modal-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 20px 8px;
}

#modal-tuto .tuto-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

#modal-tuto .tuto-title {
    margin: 0;
    font-size: 1.25rem;
}

#modal-tuto .tuto-close {
    display: flex;
    color: #607d8b;
}

#modal-tuto .tuto-body {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#modal-tuto.landscape .tuto-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

#modal-tuto .tuto-figure {
    display: flex;
    justify-content: center;
}

#modal-tuto .tuto-image {
    display: block;
    max-width: 100%;
    max-height: min(68vh, 640px);
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

#modal-tuto.landscape .tuto-image {
    max-height: min(50vh, 460px);
}

#modal-tuto .tuto-step {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    background: #eceff1;
    color: #546e7a;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* aide d'un onglet réduite à une seule étape : ni numéro d'étape ni point de navigation */
#modal-tuto .tuto-step:empty,
#modal-tuto .tuto-dot:only-child {
    display: none;
}

#modal-tuto .tuto-step-title {
    margin: 10px 0 8px;
    font-size: 1.15rem;
}

#modal-tuto .tuto-step-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #37474f;
}

#modal-tuto > .modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
    height: auto;
    padding: 8px 12px;
}

#modal-tuto > .modal-footer .btn,
#modal-tuto > .modal-footer .btn-flat {
    display: inline-flex;
    align-items: center;
    float: none;
    margin: 0;
    flex: 0 0 auto;
}

#modal-tuto .tuto-prev.disabled {
    visibility: hidden;
}

#modal-tuto .tuto-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

#modal-tuto .tuto-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #cfd8dc;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

#modal-tuto .tuto-dot:focus {
    background: #90a4ae;
}

#modal-tuto .tuto-dot.active {
    background: #546e7a;
    transform: scale(1.3);
}

@media (max-width: 700px) {
    /* Hauteur fixe : les boutons Précédent / Suivant ne bougent pas d'une étape à l'autre */
    #modal-tuto {
        width: 96%;
        height: 95%;
        max-height: 95%;
        top: 2.5% !important;
    }

    #modal-tuto > .modal-content {
        padding: 12px 14px 6px;
    }

    #modal-tuto .tuto-title {
        font-size: 1.05rem;
    }

    #modal-tuto .tuto-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }

    #modal-tuto .tuto-image,
    #modal-tuto.landscape .tuto-image {
        max-height: 46vh;
    }

    #modal-tuto .tuto-step-title {
        font-size: 1.05rem;
    }

    #modal-tuto .tuto-prev span {
        display: none;
    }
}

/* Bouton « Tuto » en haut d'une page de saisie ou de chacun de ses onglets (feuille de pointage, feuille
   individuelle, feuille chauffeur) : ouvre le tutoriel guidé, ou seulement les étapes de l'onglet. Même allure
   que le bouton « Tutoriel guidé » de la page d'aide (.aide-tuto-btn). */
/* pas une .col : sur feuille.html, #tab-preview > .col est stylé en carte et masqué / déplié par feuille.js */
.tab-help-row {
    display: flex;
    justify-content: flex-end;
    padding: 0 .75rem;
    margin-bottom: 8px;
}

.tab-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 10px;
    border: none;
    border-radius: 20px;
    background: var(--feuilles-de-pointage-color);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .2s, box-shadow .2s;
}

.tab-help:hover,
.tab-help:focus {
    background: var(--feuilles-de-pointage-color);
    filter: brightness(0.92);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.tab-help .material-icons {
    font-size: 20px;
}

.tab-help .aide-tuto-count {
    font-weight: 400;
    opacity: .9;
}

.tab-help .aide-tuto-count:not(:empty)::before {
    content: "· ";
}

/* Bouton « Tuto » d'une étape (feuille individuelle / chauffeur), dans l'en-tête de l'étape : plus petit */
.tab-help.step-tuto {
    gap: 4px;
    margin-right: 6px;
    padding: 3px 10px 3px 6px;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
}

/* l'en-tête d'étape donne à ses icônes la taille d'un bouton rond (.step-actions i.material-icons) */
.step-actions .tab-help.step-tuto i.material-icons {
    width: auto;
    height: auto;
    font-size: 16px !important;
    color: #fff;
}
