/* ============================================================
   Nomdo — Tour guiado / balões de ajuda (onboarding.js)
   ============================================================
   Usado em toda página que estende base_dash.html ou base_auth.html.
   Não depende das variáveis --primary/--surface/--border de cada
   página (cada template redefine essas variáveis do seu próprio
   jeito, e várias nem as têm), por isso os tons aqui são fixos,
   batendo com a cor da marca (#0052D4) usada em toda parte.
   ============================================================ */

/* Botão flutuante de ajuda (?) — sempre visível, reabre o tour da
   página atual a qualquer momento. */
.nomdo-help-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0052D4, #4364F7);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 82, 212, 0.35);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3000;
    transition: transform .2s ease, box-shadow .2s ease;
}

.nomdo-help-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 24px rgba(0, 82, 212, 0.45);
}

.nomdo-help-fab:active {
    transform: translateY(0) scale(.97);
}

.nomdo-help-fab .nomdo-help-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 82, 212, 0.55);
    animation: nomdoHelpPulse 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes nomdoHelpPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 82, 212, 0.45); }
    70%  { box-shadow: 0 0 0 14px rgba(0, 82, 212, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 82, 212, 0); }
}

@media (max-width: 600px) {
    .nomdo-help-fab {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
        right: 14px;
        bottom: 14px;
    }
}

/* Backdrop — bloqueia cliques no resto da página durante o tour.
   Fica transparente de propósito: o escurecimento visual vem do
   box-shadow gigante do próprio .nomdo-tour-spot (ver abaixo). */
.nomdo-tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10049;
    background: transparent;
    cursor: default;
}

/* "Spotlight" — recorte visual em volta do elemento em destaque.
   Fundo transparente + box-shadow enorme escurece tudo em volta
   sem cobrir o próprio elemento (a área do elemento fica visível
   por baixo, já que este div não tem background próprio). */
.nomdo-tour-spot {
    position: fixed;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .62);
    transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
    pointer-events: none;
    z-index: 10050;
}

.nomdo-tour-spot.nomdo-tour-spot--none {
    box-shadow: none;
    background: rgba(15, 23, 42, .5);
    inset: 0;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

.nomdo-tour-bubble {
    position: fixed;
    z-index: 10051;
    width: min(340px, calc(100vw - 32px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .28);
    padding: 18px 20px 16px;
    box-sizing: border-box;
    font-family: Poppins, sans-serif;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, top .28s ease, left .28s ease;
}

.nomdo-tour-bubble.nomdo-tour-bubble--visible {
    opacity: 1;
    transform: translateY(0);
}

.nomdo-tour-progress {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0052D4;
    margin-bottom: 6px;
}

.nomdo-tour-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nomdo-tour-title i {
    color: #0052D4;
    font-size: .95rem;
}

.nomdo-tour-text {
    font-size: .86rem;
    line-height: 1.5;
    color: #475569;
    margin: 0 0 14px;
}

.nomdo-tour-dots {
    display: flex;
    gap: 5px;
    margin-bottom: 14px;
}

.nomdo-tour-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background .2s ease, transform .2s ease;
}

.nomdo-tour-dots span.nomdo-tour-dot--active {
    background: #0052D4;
    transform: scale(1.3);
}

.nomdo-tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nomdo-tour-skip {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
}

.nomdo-tour-skip:hover {
    color: #64748b;
    text-decoration: underline;
}

.nomdo-tour-nav {
    display: flex;
    gap: 8px;
}

.nomdo-tour-nav button {
    border: none;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 700;
    padding: 9px 16px;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}

.nomdo-tour-back {
    background: rgba(0, 82, 212, 0.08);
    color: #0052D4;
}

.nomdo-tour-back:hover {
    background: rgba(0, 82, 212, 0.14);
}

.nomdo-tour-back:disabled {
    opacity: .4;
    cursor: default;
}

.nomdo-tour-next {
    background: linear-gradient(135deg, #0052D4, #4364F7);
    color: #fff;
}

.nomdo-tour-next:hover {
    transform: translateY(-1px);
}

/* Modo "cartão inferior" — telas estreitas, sempre grudado embaixo,
   sem tentar calcular lado/seta (mais confiável em qualquer tamanho
   de tela e evita o balão saindo da viewport). */
@media (max-width: 640px) {
    .nomdo-tour-bubble {
        left: 10px !important;
        right: 10px;
        bottom: 14px !important;
        top: auto !important;
        width: auto;
        max-width: none;
    }
}

/* ===== DARK MODE — segue o mesmo padrão de theme_dark.css (fundo
   azul-marca em vez de superfícies brancas) ===== */
body.theme-dark .nomdo-tour-bubble {
    background: #0052D4;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}

body.theme-dark .nomdo-tour-title {
    color: rgba(255, 255, 255, .95);
}

body.theme-dark .nomdo-tour-title i {
    color: #9dc1ff;
}

body.theme-dark .nomdo-tour-text {
    color: rgba(255, 255, 255, .75);
}

body.theme-dark .nomdo-tour-progress {
    color: #9dc1ff;
}

body.theme-dark .nomdo-tour-dots span {
    background: rgba(255, 255, 255, .18);
}

body.theme-dark .nomdo-tour-dots span.nomdo-tour-dot--active {
    background: #9dc1ff;
}

body.theme-dark .nomdo-tour-back {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

body.theme-dark .nomdo-tour-back:hover {
    background: rgba(255, 255, 255, .16);
}

body.theme-dark .nomdo-tour-skip {
    color: rgba(255, 255, 255, .55);
}

body.theme-dark .nomdo-tour-skip:hover {
    color: rgba(255, 255, 255, .8);
}
