/*
 * Funil de assessoria (nov/2026). Par de Views/Shared/_AssessoriaFunil.cshtml e assets/js/assessoria-funil.js.
 * IDÊNTICO no SITE.Leilao e no SITE.Caixa (o DuplicacaoAssessoriaTests confere); as cores vêm dos tokens --asr-*
 * definidos na partial de cada site.
 *
 * Aqui fica só o que NÃO é da primeira pintura do bloco: a etapa final, os estados de toque e foco e a faixa fixa
 * do celular. O cartão, a 1ª pergunta e a regra de [hidden] estão embutidos na partial, para nada piscar enquanto
 * este arquivo não chega.
 *
 * Camadas: faixa 1030, abaixo do modal do Bootstrap (1050), como as outras barras do site.
 */

/* ---------- toque e foco ---------- */
.asr .asr-opt { transition: border-color .15s ease, background-color .15s ease; -webkit-tap-highlight-color: transparent; }
.asr .asr-opt:hover { border-color: var(--asr-marca); background: var(--asr-marca-suave); color: var(--asr-tinta); }
.asr .asr-opt:focus-visible,
.asr .asr-lnk:focus-visible,
.asr .asr-btn-wa:focus-visible,
.asr .asr-btn-gr:focus-visible,
.asr .asr-previa summary:focus-visible,
.asr-faixa .asr-faixa-btn:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
.asr .asr-perg:focus-visible { outline: 2px dashed var(--asr-linha); outline-offset: 4px; border-radius: 4px; }
.asr .asr-lnk:hover { color: var(--asr-tinta); text-decoration: underline; }
.asr .asr-volta { margin-top: 10px; text-decoration: none; }
.asr .asr-volta .asr-i { width: 16px; height: 16px; }

/* ---------- etapa final ---------- */
.asr .asr-aviso { margin: 0; padding: 12px; border-radius: 10px; background: #fff6e0; color: #6b4500; font-size: 14px; }
.asr .asr-campo label { display: block; margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--asr-tinta); }
.asr .asr-opcional { font-weight: 400; color: var(--asr-apoio); }
.asr .asr-campo input {
    display: block; width: 100%; min-height: 48px; margin: 0; padding: 10px 12px; border: 1.5px solid #8b93a5;
    border-radius: 10px; background: #fff; color: var(--asr-tinta); font: inherit; box-shadow: none;
}
.asr .asr-campo input:focus { outline: 3px solid #1f6feb; outline-offset: 1px; border-color: var(--asr-tinta); }

.asr .asr-btn-wa,
.asr .asr-btn-gr {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin: 0;
    padding: 12px 16px; border-radius: 12px; font: inherit; font-weight: 700; line-height: 1.25; text-align: center;
    text-decoration: none; text-transform: none; cursor: pointer; transition: background-color .15s ease;
}
.asr .asr-btn-wa,
.asr .asr-btn-wa:visited { border: 1.5px solid var(--asr-zap); background: var(--asr-zap); color: #fff; }
.asr .asr-btn-wa:hover { background: var(--asr-zap-forte); border-color: var(--asr-zap-forte); color: #fff; }
/* Sem href (questionário incompleto) o botão não age; a etapa que o contém também está escondida. */
.asr .asr-btn-wa:not([href]) { opacity: .5; pointer-events: none; }
.asr .asr-btn-gr,
.asr .asr-btn-gr:visited { min-height: 48px; border: 1.5px solid var(--asr-zap); background: #fff; color: var(--asr-zap-forte); }
.asr .asr-btn-gr:hover { background: #eaf6ef; color: var(--asr-zap-forte); }
/* Leilão encerrado: o grupo é tão útil quanto o atendimento, então os dois botões têm o mesmo peso. */
.asr--encerrado .asr-btn-gr,
.asr--encerrado .asr-btn-gr:visited { min-height: 52px; background: var(--asr-zap); color: #fff; }
.asr--encerrado .asr-btn-gr:hover { background: var(--asr-zap-forte); border-color: var(--asr-zap-forte); color: #fff; }

.asr .asr-nota { margin: 0; font-size: 13px; color: var(--asr-apoio); }
.asr .asr-previa { font-size: 13px; color: var(--asr-apoio); }
.asr .asr-previa summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 600; color: #30426a; }
.asr .asr-previa-texto {
    margin: 4px 0 0; padding: 10px 12px; border: 1px dashed #b9c0cf; border-radius: 10px; background: #f9fafb;
    color: #30426a; font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere;
}

/* ---------- faixa fixa (só no celular e no tablet em pé) ---------- */
@media (max-width: 899.98px) {
    html.asr-tem {
        --asr-faixa-altura: 68px;
        --asr-faixa-seguro: env(safe-area-inset-bottom, 0px);
    }
    .asr-faixa {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; align-items: center; gap: 10px;
        min-height: var(--asr-faixa-altura, 68px); margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--asr-linha); background: #fff; box-shadow: 0 -6px 20px rgba(8, 18, 43, .1);
        transform: translateY(110%); visibility: hidden; transition: transform .22s ease-out, visibility 0s linear .22s;
    }
    .asr-faixa.asr-on { transform: none; visibility: visible; transition: transform .22s ease-out, visibility 0s; }
    .asr-faixa-texto { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; color: var(--asr-apoio); }
    .asr-faixa-texto b { display: block; font-size: 14.5px; font-weight: 700; color: var(--asr-tinta); }
    .asr-faixa-texto span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .asr-faixa .asr-faixa-btn {
        flex: none; min-width: 48px; min-height: 48px; margin: 0; padding: 0 18px; border: 0; border-radius: 10px;
        background: var(--asr-marca-forte); color: #fff; font: inherit; font-weight: 700; text-transform: none;
        white-space: nowrap; cursor: pointer; box-shadow: none;
    }

    /* ---------- flutuantes do site enquanto a faixa está na tela ---------- */
    html.asr-faixa-on body { padding-bottom: calc(var(--asr-faixa-altura) + var(--asr-faixa-seguro)); }
    html.asr-faixa-on #scrollUp { display: none !important; }
    /* Chat do SendPulse (Núcleo): sobe por transform no host, como nas outras barras; o anel acompanha sozinho. */
    html.asr-faixa-on sp-live-chat {
        display: block; position: relative;
        transform: translateY(calc(-1 * (var(--asr-faixa-altura) + var(--asr-faixa-seguro) - 8px)));
    }
    html.asr-faixa-on .pa-toast { bottom: calc(var(--asr-faixa-altura) + var(--asr-faixa-seguro) + 12px); }
    /* Caixa: nas páginas com o bloco, a faixa substitui o WhatsApp flutuante do _Layout (que vai sem perguntas). */
    html.asr-tem #chat-whatsapp { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .asr .asr-opt, .asr .asr-btn-wa, .asr .asr-btn-gr { transition: none; }
    .asr-faixa, .asr-faixa.asr-on { transition: none; }
}
