:root {
    --tutorial-blue: #0878d1;
    --tutorial-navy: #103c67;
    --tutorial-ink: #183b5d;
}

.page-tutorial-launcher {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 1090;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: .65rem .9rem;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: linear-gradient(135deg, #0d6fbb, #2996e2);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    box-shadow: 0 12px 30px rgba(17, 72, 119, .25);
    transition: transform .18s ease, box-shadow .18s ease;
}

.page-tutorial-launcher:hover,
.page-tutorial-launcher:focus {
    color: #fff;
    outline: 0;
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(17, 72, 119, .34);
}

/* Repli sans JavaScript : sur la page Transfert, le guide reste au-dessus
   de la barre d'actions fixe. La mesure exacte est ensuite appliquée en JS. */
body[data-current-route="magasin_transfert_manutention"] .page-tutorial-launcher {
    bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

.page-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: none;
    pointer-events: none;
}

.page-tutorial-overlay.is-visible {
    display: block;
    pointer-events: auto;
}

.page-tutorial-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    color: rgba(255, 255, 255, .08);
    font-size: clamp(5rem, 18vw, 16rem);
    font-weight: 900;
    letter-spacing: .14em;
    line-height: 1;
    transform: translate(-50%, -50%) rotate(-12deg);
    user-select: none;
}

.page-tutorial-spotlight {
    position: fixed;
    z-index: 2052;
    display: none;
    border: 4px solid rgba(66, 177, 240, .95);
    border-radius: .8rem;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, .95),
        0 0 0 9999px rgba(7, 28, 49, .74);
    pointer-events: none;
    transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}

body.page-tutorial-open .page-tutorial-spotlight {
    display: block;
}

.page-tutorial-card {
    position: fixed;
    z-index: 2055;
    display: none;
    width: min(410px, calc(100vw - 2rem));
    padding: 1.15rem 1.2rem 1.1rem;
    border: 1px solid rgba(34, 116, 180, .18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .98);
    color: var(--tutorial-ink);
    box-shadow: 0 24px 70px rgba(0, 23, 45, .34);
    pointer-events: auto;
}

body.page-tutorial-open .page-tutorial-card {
    display: block;
}

.page-tutorial-card__topline,
.page-tutorial-actions,
.page-tutorial-actions > div {
    display: flex;
    align-items: center;
}

.page-tutorial-card__topline,
.page-tutorial-actions {
    justify-content: space-between;
}

.page-tutorial-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--tutorial-blue);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page-tutorial-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #edf5fb;
    color: #476985;
}

.page-tutorial-progress {
    height: 4px;
    margin: .8rem 0 .7rem;
    overflow: hidden;
    border-radius: 999px;
    background: #dceaf5;
}

.page-tutorial-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--tutorial-blue), #4eb8e8);
    transition: width .22s ease;
}

.page-tutorial-counter {
    margin: 0 0 .25rem;
    color: #71879a;
    font-size: .75rem;
    font-weight: 700;
}

.page-tutorial-card h2 {
    margin: 0 0 .45rem;
    color: var(--tutorial-navy);
    font-size: 1.3rem;
    font-weight: 800;
}

.page-tutorial-card > p:not(.page-tutorial-counter) {
    min-height: 3rem;
    margin: 0 0 1rem;
    color: #526d84;
    line-height: 1.5;
}

.page-tutorial-actions {
    gap: .75rem;
    padding-top: .85rem;
    border-top: 1px solid #e5eef5;
}

.page-tutorial-actions > div {
    gap: .45rem;
}

.page-tutorial-actions .btn {
    border-radius: .65rem;
    font-size: .82rem;
    font-weight: 700;
}

.page-tutorial-skip {
    padding-left: 0;
    color: #6d8294;
}

body.page-tutorial-open .page-tutorial-launcher {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 575.98px) {
    .page-tutorial-launcher span {
        display: none;
    }

    .page-tutorial-launcher {
        width: 46px;
        height: 46px;
        justify-content: center;
        padding: 0;
    }

    .page-tutorial-card {
        right: 1rem !important;
        bottom: 1rem !important;
        left: 1rem !important;
        top: auto !important;
        width: auto;
    }

    .page-tutorial-actions {
        align-items: flex-end;
    }

    .page-tutorial-actions > div {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-tutorial-launcher,
    .page-tutorial-spotlight,
    .page-tutorial-progress span {
        transition: none;
    }
}
