/* ══ Fox — atendimento com IA da SlyBot ══════════════════════════════════
   Mesmo molde da Sofia (Newhotel): o botão no canto com o rosto do Fox e
   anéis que respiram; o painel que entra pela direita, por cima do site,
   com o fundo escurecido. Cores da SlyBot (laranja sobre grafite).        */
.fox, .fox-lancador {
    --fox-laranja: #FF6A00;
    --fox-laranja-2: #FF8A3D;
    --fox-fundo: #0E1320;
    --fox-fundo-2: #151B2B;
    --fox-linha: rgba(255,255,255,0.08);
    --fox-texto: #E5E7EB;
    --fox-tenue: rgba(229,231,235,0.6);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* o rosto: a raposa, redonda, com dois anéis que respiram */
.fox-orbe {
    position: relative; display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px;
    border-radius: 50%;
}
.fox-orbe img {
    position: relative; z-index: 1; display: block; width: 100%; height: 100%;
    border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,106,0,0.55);
}
.fox-orbe i {
    position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid rgba(255,106,0,0.5);
    animation: fox-respira 2.8s ease-out infinite;
}
.fox-orbe i + i { animation-delay: 1.4s; }
@keyframes fox-respira { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }

/* ── O botão do canto ─────────────────────────────────────────────────── */
.fox-lancador {
    position: fixed; right: 22px; bottom: 22px; z-index: 380;
    display: inline-flex; align-items: center; gap: 12px;
    padding: 7px 20px 7px 7px; border-radius: 999px; border: 1px solid rgba(255,106,0,0.35); cursor: pointer;
    background: #111827; color: #fff; text-align: left;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    animation: fox-lancador-entra .5s cubic-bezier(.2,.8,.2,1) both;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.fox-lancador[hidden] { display: none; }
.fox-lancador:hover { transform: translateY(-2px); border-color: var(--fox-laranja); box-shadow: 0 20px 46px rgba(0,0,0,0.5); }
.fox-lancador .fox-orbe { flex-basis: 44px; width: 44px; height: 44px; }
.fox-lancador__texto { display: flex; flex-direction: column; line-height: 1.2; }
.fox-lancador__texto b { font-weight: 700; font-size: .9rem; letter-spacing: .02em; }
.fox-lancador__texto small { font-size: .74rem; color: rgba(255,255,255,0.7); }
@keyframes fox-lancador-entra { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
/* o "Instalar app" da área do cliente fica no mesmo canto: o Fox sobe */
body:has(#pwa-install:not([hidden])) .fox-lancador { bottom: 80px; }
/* enquanto o aviso de cookies está na tela, o Fox espera (não cobre o Aceitar/Recusar) */
body:has(#slybot-lgpd:not([hidden])) .fox-lancador { display: none; }
@media (max-width: 900px) {
    .fox-lancador { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 5px; }
    .fox-lancador__texto { display: none; }
    /* na área do cliente, acima da barra de navegação de baixo */
    body.is-account .fox-lancador { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ── O painel por cima do site ────────────────────────────────────────── */
html.com-fox { overflow: hidden; }
.fox { position: fixed; inset: 0; z-index: 400; color: var(--fox-texto); }
.fox[hidden] { display: none; }
.fox__fundo {
    position: absolute; inset: 0; background: rgba(4,6,12,0.55);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0; transition: opacity .35s ease;
}
.fox__painel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
    display: flex; flex-direction: column; background: var(--fox-fundo);
    border-left: 1px solid var(--fox-linha);
    box-shadow: -24px 0 70px rgba(0,0,0,0.45);
    transform: translateX(100%); transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.fox.esta-aberto .fox__fundo { opacity: 1; }
.fox.esta-aberto .fox__painel { transform: none; }

.fox__topo {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--fox-linha); background: var(--fox-fundo-2);
}
.fox__quem { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.fox__nome { font-size: 1rem; font-weight: 700; letter-spacing: .02em; color: #fff; }
.fox__nome span { font-weight: 400; color: var(--fox-tenue); font-size: .86rem; }
.fox__quem small { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--fox-tenue); }
.fox__ponto { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.fox__recomecar {
    margin-left: auto; background: none; border: 0; cursor: pointer;
    font: inherit; font-size: .8rem; color: var(--fox-tenue);
    text-decoration: underline; text-underline-offset: 3px;
}
.fox__recomecar:hover { color: #fff; }
.fox__fechar {
    display: grid; place-items: center; width: 38px; height: 38px; margin-left: 4px; border-radius: 50%;
    border: 1px solid var(--fox-linha); background: transparent; color: #fff; cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}
.fox__recomecar[hidden] + .fox__fechar { margin-left: auto; }
.fox__fechar:hover { background: rgba(255,255,255,0.06); border-color: var(--fox-laranja); }
.fox__fechar svg { width: 18px; height: 18px; }

.fox__conversa {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 22px 18px 8px; display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}
.fox__msg {
    max-width: 88%; padding: 12px 16px; border-radius: 18px;
    font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere;
    animation: fox-entra .32s cubic-bezier(.2,.7,.3,1) both;
}
.fox__msg p { margin: 0 0 8px; }
.fox__msg p:last-child, .fox__msg ul:last-child, .fox__msg ol:last-child { margin-bottom: 0; }
.fox__msg ul, .fox__msg ol { margin: 4px 0 8px; padding-left: 20px; }
.fox__msg li { margin: 2px 0; }
.fox__msg b { font-weight: 700; color: #fff; }
.fox__msg a { color: var(--fox-laranja-2); text-decoration: underline; text-underline-offset: 2px; }
.fox__msg code { font-family: ui-monospace, Consolas, monospace; font-size: .84em; background: rgba(255,255,255,0.07); padding: 1px 5px; border-radius: 5px; }
.fox__msg pre {
    margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,0.35);
    font: .78rem/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.fox__msg--fox { align-self: flex-start; background: var(--fox-fundo-2); border: 1px solid var(--fox-linha); border-bottom-left-radius: 6px; }
.fox__msg--eu  { align-self: flex-end; background: var(--fox-laranja); color: #fff; border-bottom-right-radius: 6px; }
.fox__msg--eu b { color: #fff; }
/* um log colado: monoespaçado e com altura limitada */
.fox__msg--log { font: .74rem/1.45 ui-monospace, Consolas, monospace; max-height: 220px; overflow: auto; white-space: pre-wrap; background: #3a2412; border: 1px solid rgba(255,106,0,0.4); }
.fox__msg--erro { align-self: flex-start; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35); color: #FCA5A5; font-size: .86rem; }
@keyframes fox-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* os três pontos enquanto "escreve" */
.fox__msg--pontos { padding: 15px 18px; }
.fox__pontos { display: flex; gap: 5px; }
.fox__pontos i { width: 6px; height: 6px; border-radius: 50%; background: var(--fox-tenue); animation: fox-ponto 1.1s infinite ease-in-out; }
.fox__pontos i:nth-child(2) { animation-delay: .16s; }
.fox__pontos i:nth-child(3) { animation-delay: .32s; }
@keyframes fox-ponto { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.fox__sugestoes { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 12px; }
.fox__sugestoes[hidden] { display: none; }
.fox__sugestao {
    font: inherit; font-size: .84rem; cursor: pointer;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid rgba(255,106,0,0.45); background: transparent; color: #fff;
    transition: border-color .2s ease, background .2s ease;
}
.fox__sugestao:hover { border-color: var(--fox-laranja); background: rgba(255,106,0,0.12); }

.fox__barra {
    display: flex; gap: 10px; align-items: flex-end;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--fox-linha); background: var(--fox-fundo);
}
.fox__barra textarea {
    flex: 1; resize: none; min-height: 46px; max-height: 160px;
    border: 1px solid var(--fox-linha); border-radius: 22px;
    padding: 12px 18px; font: inherit; font-size: .93rem; line-height: 1.45;
    background: var(--fox-fundo-2); color: #fff;
    transition: border-color .2s ease;
}
.fox__barra textarea::placeholder { color: rgba(229,231,235,0.4); }
.fox__barra textarea:focus { outline: 0; border-color: var(--fox-laranja); }
.fox__barra button {
    flex: 0 0 46px; width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: var(--fox-laranja); color: #fff; cursor: pointer;
    display: grid; place-items: center; transition: background .2s ease, opacity .2s ease;
}
.fox__barra button:hover { background: #E65C00; }
.fox__barra button:disabled { opacity: .5; cursor: default; }
.fox__barra button svg { width: 19px; height: 19px; }
.fox__armadilha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fox__aviso {
    margin: 0; padding: 9px 18px 12px; font-size: .7rem; line-height: 1.45; color: var(--fox-tenue);
    border-top: 1px solid var(--fox-linha); background: var(--fox-fundo-2);
}
.fox__aviso a { color: var(--fox-tenue); }

@media (max-width: 560px) {
    .fox__painel { width: 100vw; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .fox__painel, .fox__fundo, .fox-lancador { transition: none; animation: none; }
    .fox-orbe i { animation: none; }
}
