:root {
    --gbm-tour-fundo: #0d1b2d;
    --gbm-tour-borda: rgba(80, 227, 170, .55);
    --gbm-tour-verde: #50e3aa;
    --gbm-tour-verde-escuro: #258f65;
    --gbm-tour-texto: #f5f8fc;
    --gbm-tour-mutado: #b7c4d4;
    /* Lidos pelo JS para respeitar notch / barra de gestos. */
    --gbm-tour-inset-top: env(safe-area-inset-top, 0px);
    --gbm-tour-inset-bottom: env(safe-area-inset-bottom, 0px);
}

html.gbm-tour-bloqueado,
body.gbm-tour-bloqueado {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

#gbm-tour-overlay[hidden] {
    display: none !important;
}

#gbm-tour-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 2147483000;
    font-family: Inter, Arial, sans-serif;
    touch-action: pan-y;
    overscroll-behavior: none;
    isolation: isolate;
}

.gbm-tour-spotlight {
    position: fixed;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid var(--gbm-tour-verde);
    border-radius: 13px;
    box-shadow:
        0 0 0 9999px rgba(1, 7, 16, .86),
        0 0 28px rgba(80, 227, 170, .5);
    pointer-events: none;
    transition:
        top .22s ease,
        left .22s ease,
        width .22s ease,
        height .22s ease;
}

.gbm-tour-spotlight.gbm-tour-sem-alvo {
    top: -20px !important;
    left: -20px !important;
    width: 1px !important;
    height: 1px !important;
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 0 9999px rgba(1, 7, 16, .9);
}

.gbm-tour-caixa {
    position: fixed;
    z-index: 2;
    width: min(390px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--gbm-tour-borda);
    border-radius: 16px;
    background: var(--gbm-tour-fundo);
    color: var(--gbm-tour-texto);
    box-shadow: 0 22px 65px rgba(0, 0, 0, .65);
    box-sizing: border-box;
    outline: none;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.gbm-tour-caixa.gbm-tour-centralizada {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%);
}

.gbm-tour-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.gbm-tour-contador {
    color: var(--gbm-tour-mutado);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    white-space: nowrap;
    text-transform: uppercase;
}

.gbm-tour-fechar {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9px;
    background: rgba(255, 255, 255, .06);
    color: var(--gbm-tour-texto);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.gbm-tour-fechar:hover,
.gbm-tour-fechar:focus-visible {
    background: rgba(255, 255, 255, .14);
}

.gbm-tour-progresso {
    height: 4px;
    margin-bottom: 17px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
}

.gbm-tour-progresso > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2e8b57, #50e3aa);
    transition: width .2s ease;
}

.gbm-tour-caixa h2 {
    margin: 0 0 10px;
    color: var(--gbm-tour-verde);
    font-family: Rajdhani, Inter, Arial, sans-serif;
    font-size: 1.3rem;
    line-height: 1.2;
    letter-spacing: .02em;
}

.gbm-tour-caixa p {
    margin: 0 0 20px;
    color: var(--gbm-tour-texto);
    font-size: .94rem;
    line-height: 1.58;
}

.gbm-tour-rodape {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gbm-tour-navegacao {
    display: flex;
    gap: 8px;
}

.gbm-tour-botao {
    min-height: 40px;
    padding: 9px 14px;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
}

.gbm-tour-botao[hidden] {
    display: none !important;
}

.gbm-tour-botao:focus-visible,
#gbm-tour-ajuda:focus-visible {
    outline: 3px solid rgba(80, 227, 170, .4);
    outline-offset: 2px;
}

.gbm-tour-secundario {
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .07);
    color: var(--gbm-tour-mutado);
}

.gbm-tour-secundario:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.gbm-tour-principal {
    background: var(--gbm-tour-verde-escuro);
    color: #fff;
}

.gbm-tour-principal:hover {
    background: #2fb87e;
}

#gbm-tour-ajuda {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147482000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid rgba(80, 227, 170, .55);
    border-radius: 999px;
    background: #0d1b2d;
    color: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
    font-family: Inter, Arial, sans-serif;
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
}

#gbm-tour-ajuda:hover {
    background: #142941;
    border-color: var(--gbm-tour-verde);
}

#gbm-tour-ajuda .gbm-tour-ajuda-icone {
    color: var(--gbm-tour-verde);
    font-size: 1.05rem;
}

@media (max-width: 680px) {
    .gbm-tour-caixa:not(.gbm-tour-centralizada) {
        display: flex;
        flex-direction: column;
        max-width: calc(100% - 16px);
        padding: 14px;
        border-radius: 14px;
        overflow: hidden;
        transform: none !important;
    }

    /* Topo, progresso, titulo e rodape ficam sempre visiveis;
       apenas o texto rola dentro da caixa. */
    .gbm-tour-caixa:not(.gbm-tour-centralizada) .gbm-tour-topo,
    .gbm-tour-caixa:not(.gbm-tour-centralizada) .gbm-tour-progresso,
    .gbm-tour-caixa:not(.gbm-tour-centralizada) h2,
    .gbm-tour-caixa:not(.gbm-tour-centralizada) .gbm-tour-rodape {
        flex: 0 0 auto;
    }

    .gbm-tour-caixa:not(.gbm-tour-centralizada) .gbm-tour-texto {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }


    .gbm-tour-caixa.gbm-tour-centralizada {
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        padding: 16px;
    }

    .gbm-tour-topo {
        gap: 10px;
        margin-bottom: 7px;
    }

    .gbm-tour-contador {
        font-size: .68rem;
        letter-spacing: .04em;
    }

    .gbm-tour-fechar {
        width: 32px;
        height: 32px;
    }

    .gbm-tour-progresso {
        margin-bottom: 10px;
    }

    .gbm-tour-caixa h2 {
        margin-bottom: 7px;
        font-size: 1.15rem;
    }

    .gbm-tour-caixa p {
        margin-bottom: 12px;
        font-size: .86rem;
        line-height: 1.42;
    }

    .gbm-tour-rodape {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
    }

    .gbm-tour-navegacao {
        display: contents;
    }

    .gbm-tour-botao {
        width: 100%;
        min-height: 44px;
        padding: 8px;
        font-size: .8rem;
        line-height: 1.2;
    }

    .gbm-tour-pular {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .gbm-tour-voltar {
        grid-column: 1;
        grid-row: 2;
    }

    .gbm-tour-avancar {
        grid-column: 2;
        grid-row: 2;
    }

    .gbm-tour-rodape.gbm-tour-sem-voltar .gbm-tour-avancar {
        grid-column: 1 / -1;
    }

    #gbm-tour-ajuda {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 46px;
        height: 46px;
        justify-content: center;
        padding: 0;
    }

    #gbm-tour-ajuda .gbm-tour-ajuda-texto {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gbm-tour-spotlight,
    .gbm-tour-progresso > span {
        transition: none;
    }
}
