/* Temas de datas comemorativas (28/11/2026, TEMPORÁRIOS): só valem com <html class="com-tema tema-<id>"> (publico/temas.js liga pela data).
   Por cima do visual de sempre: mesmo Liquid Glass, mesmas cores Eztec. Desenhos próprios em /temas/<id>-*.svg.
   Animações só com transform e opacity; enfeites não recebem clique (só o personagem, que fala quando tocado). */

.tema-fundo, .tema-pendurados, .tema-faixa, .tema-personagem, .tema-fala { display: none; }

/* ---------- fundo: luz quente da data + partículas caindo atrás do vidro ---------- */
.com-tema { --tema-luz-1: rgba(255, 205, 120, .18); --tema-luz-2: rgba(255, 190, 110, .12); }
.com-tema .tema-fundo {
  display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(38% 26% at 92% 10%, var(--tema-luz-1) 0%, transparent 70%),
    radial-gradient(34% 24% at 6% 62%, var(--tema-luz-2) 0%, transparent 70%),
    radial-gradient(30% 20% at 70% 96%, var(--tema-luz-2) 0%, transparent 70%);
}
.com-tema .tema-fundo::before, .com-tema .tema-fundo::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; pointer-events: none; will-change: transform; }
.com-tema .tema-fundo::before { top: -260px; background-size: 260px 260px; animation: tema-cai-1 26s linear infinite; }
.com-tema .tema-fundo::after { top: -420px; background-size: 420px 420px; animation: tema-cai-2 40s linear infinite; }
@keyframes tema-cai-1 { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(26px, 260px, 0); } }
@keyframes tema-cai-2 { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-30px, 420px, 0); } }
/* neve (Natal) */
.com-tema .tema-neve::before { opacity: .75; background-image:
  radial-gradient(1.6px 1.6px at 24px 40px, #fff 60%, transparent 62%), radial-gradient(1.2px 1.2px at 96px 120px, #fff 60%, transparent 62%),
  radial-gradient(2px 2px at 170px 30px, #fff 60%, transparent 62%), radial-gradient(1.4px 1.4px at 210px 200px, #fff 60%, transparent 62%),
  radial-gradient(1.8px 1.8px at 60px 215px, #fff 60%, transparent 62%), radial-gradient(1.2px 1.2px at 140px 160px, #fff 60%, transparent 62%),
  radial-gradient(1.6px 1.6px at 236px 92px, #fff 60%, transparent 62%); }
.com-tema .tema-neve::after { opacity: .45; background-image:
  radial-gradient(3px 3px at 60px 80px, rgba(255,255,255,.95) 30%, transparent 70%), radial-gradient(2.6px 2.6px at 300px 40px, rgba(255,255,255,.95) 30%, transparent 70%),
  radial-gradient(3.4px 3.4px at 200px 300px, rgba(255,255,255,.95) 30%, transparent 70%), radial-gradient(2.4px 2.4px at 380px 230px, rgba(255,255,255,.95) 30%, transparent 70%),
  radial-gradient(3px 3px at 120px 370px, rgba(255,255,255,.95) 30%, transparent 70%); }
/* confete (Carnaval, Dia das Crianças) */
.com-tema .tema-confete::before { opacity: .8; background-image:
  radial-gradient(2.4px 2.4px at 24px 40px, #ffe35a 60%, transparent 64%), radial-gradient(2.2px 2.2px at 96px 120px, #3dd6ff 60%, transparent 64%),
  radial-gradient(2.6px 2.6px at 170px 30px, #ff3d8b 60%, transparent 64%), radial-gradient(2.2px 2.2px at 210px 200px, #7dff9b 60%, transparent 64%),
  radial-gradient(2.4px 2.4px at 60px 215px, #b45cff 60%, transparent 64%), radial-gradient(2px 2px at 140px 160px, #ffe35a 60%, transparent 64%),
  radial-gradient(2.4px 2.4px at 236px 92px, #ff7a3d 60%, transparent 64%); }
.com-tema .tema-confete::after { opacity: .55; background-image:
  radial-gradient(3.4px 3.4px at 60px 80px, #3dd6ff 50%, transparent 66%), radial-gradient(3.2px 3.2px at 300px 40px, #ffe35a 50%, transparent 66%),
  radial-gradient(3.6px 3.6px at 200px 300px, #ff3d8b 50%, transparent 66%), radial-gradient(3px 3px at 380px 230px, #b45cff 50%, transparent 66%),
  radial-gradient(3.4px 3.4px at 120px 370px, #7dff9b 50%, transparent 66%); }
/* pétalas (Dia das Mães, Primavera) */
.com-tema .tema-petalas::before { opacity: .7; background-image:
  radial-gradient(5px 3px at 24px 40px, #ffb3c8 55%, transparent 70%), radial-gradient(4px 2.6px at 96px 120px, #ffd0de 55%, transparent 70%),
  radial-gradient(5.4px 3.2px at 170px 30px, #ff8fb0 55%, transparent 70%), radial-gradient(4.4px 2.8px at 210px 200px, #ffc2d4 55%, transparent 70%),
  radial-gradient(5px 3px at 60px 215px, #ffe0ea 55%, transparent 70%); }
.com-tema .tema-petalas::after { opacity: .45; background-image:
  radial-gradient(7px 4.2px at 60px 80px, #ff8fb0 50%, transparent 70%), radial-gradient(6px 3.6px at 300px 40px, #ffd0de 50%, transparent 70%),
  radial-gradient(7.4px 4.4px at 200px 300px, #ffb3c8 50%, transparent 70%), radial-gradient(6px 3.6px at 120px 370px, #ffe0ea 50%, transparent 70%); }
.com-tema .tema-petalas::before { animation-duration: 34s; } .com-tema .tema-petalas::after { animation-duration: 52s; }
/* brilho dourado (Black November) */
.com-tema .tema-brilho::before { opacity: .55; background-image:
  radial-gradient(1.4px 1.4px at 24px 40px, #ffe9a8 60%, transparent 64%), radial-gradient(1.2px 1.2px at 170px 30px, #ffd36b 60%, transparent 64%),
  radial-gradient(1.6px 1.6px at 210px 200px, #fff0c2 60%, transparent 64%), radial-gradient(1.2px 1.2px at 60px 215px, #ffd36b 60%, transparent 64%); animation-duration: 60s; }

/* luz de cada data (no fundo) */
.tema-carnaval { --tema-luz-1: rgba(180, 92, 255, .22); --tema-luz-2: rgba(255, 61, 139, .14); }
.tema-pascoa { --tema-luz-1: rgba(127, 211, 255, .16); --tema-luz-2: rgba(255, 194, 212, .14); }
.tema-dia-das-maes { --tema-luz-1: rgba(255, 143, 176, .22); --tema-luz-2: rgba(255, 194, 212, .14); }
.tema-festa-junina { --tema-luz-1: rgba(255, 170, 60, .22); --tema-luz-2: rgba(255, 120, 40, .14); }
.tema-ferias-julho { --tema-luz-1: rgba(120, 190, 255, .20); --tema-luz-2: rgba(180, 220, 255, .12); }
.tema-dia-dos-pais { --tema-luz-1: rgba(110, 160, 255, .18); --tema-luz-2: rgba(255, 210, 120, .10); }
.tema-primavera { --tema-luz-1: rgba(255, 220, 90, .20); --tema-luz-2: rgba(120, 230, 140, .12); }
.tema-dia-das-criancas { --tema-luz-1: rgba(61, 214, 255, .18); --tema-luz-2: rgba(255, 61, 139, .14); }
.tema-halloween { --tema-luz-1: rgba(255, 138, 28, .22); --tema-luz-2: rgba(123, 60, 200, .16); }
.tema-ferias-janeiro { --tema-luz-1: rgba(255, 215, 80, .26); --tema-luz-2: rgba(255, 160, 60, .14); }
.tema-black-november { --tema-luz-1: rgba(255, 205, 110, .16); --tema-luz-2: rgba(255, 205, 110, .08); }
.tema-black-november .tema-fundo { background-color: rgba(0, 0, 0, .34); } /* black: o fundo escurece, o ouro brilha */

/* ---------- enfeites pendurados no topo, balançando ---------- */
.com-tema .tema-pendurados { display: block; position: fixed; z-index: 21; right: 6px; top: env(safe-area-inset-top); width: 84px; height: 1px; pointer-events: none; }
.com-tema .com-casca .tema-pendurados { top: var(--tema-topo, 0px); }
.com-tema .tema-pendurados i { position: absolute; top: 0; width: 28px; height: var(--fio); transform-origin: 50% 0; animation: tema-balanca 3.4s ease-in-out infinite alternate; }
.com-tema .tema-pendurados i::before { content: ""; position: absolute; left: 50%; top: 0; width: 1.2px; height: calc(var(--fio) - 28px); margin-left: -.6px; background: linear-gradient(#f6d58b, #c99a45); }
.com-tema .tema-pendurados i::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 36px; background: var(--tema-pendurado) no-repeat center / contain;
  filter: drop-shadow(0 4px 8px rgba(8, 2, 6, .45));
}
.com-tema .tema-pendurados i:nth-child(1) { left: 0; --fio: 46px; animation-duration: 3.1s; }
.com-tema .tema-pendurados i:nth-child(2) { left: 28px; --fio: 64px; animation-delay: -1.2s; }
.com-tema .tema-pendurados i:nth-child(3) { left: 56px; --fio: 40px; animation-duration: 3.8s; animation-delay: -2s; }
/* variação de cor nos enfeites de algumas datas (bolas, ovos, balões, flores, corações) */
.tema-natal .tema-pendurados i:nth-child(2)::after { filter: hue-rotate(38deg) saturate(.85) brightness(1.35) drop-shadow(0 4px 8px rgba(8, 2, 6, .45)); }
.tema-natal .tema-pendurados i:nth-child(3)::after { filter: saturate(0) brightness(1.7) drop-shadow(0 4px 8px rgba(8, 2, 6, .45)); }
:is(.tema-pascoa, .tema-dia-das-criancas, .tema-primavera) .tema-pendurados i:nth-child(2)::after { filter: hue-rotate(120deg) drop-shadow(0 4px 8px rgba(8, 2, 6, .45)); }
:is(.tema-pascoa, .tema-dia-das-criancas, .tema-primavera) .tema-pendurados i:nth-child(3)::after { filter: hue-rotate(220deg) drop-shadow(0 4px 8px rgba(8, 2, 6, .45)); }
.tema-dia-das-maes .tema-pendurados i:nth-child(2)::after { filter: hue-rotate(-25deg) brightness(1.15) drop-shadow(0 4px 8px rgba(8, 2, 6, .45)); }
.tema-halloween .tema-pendurados i { animation-name: tema-desce; animation-duration: 4.2s; } /* aranha sobe e desce no fio */
@keyframes tema-balanca { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes tema-desce { from { transform: translateY(-10px); } to { transform: translateY(6px); } }
@media (min-width: 960px) { .com-tema .com-casca .tema-pendurados { top: 0; right: 40px; } }

/* bandeirinhas de festa junina (no lugar dos enfeites) */
.com-tema .tema-faixa {
  display: block; position: fixed; z-index: 21; left: 0; right: 0; top: env(safe-area-inset-top); height: 30px; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='30'><path d='M0 3 Q75 12 150 3' fill='none' stroke='%23c99a45' stroke-width='1.4'/><path d='M6 4.5 L24 6.8 L13 24 Z' fill='%23ff3d63'/><path d='M36 7.2 L54 8.6 L44 26 Z' fill='%23ffd23f'/><path d='M66 8.6 L84 8.6 L75 27 Z' fill='%2337c26a'/><path d='M96 8.6 L114 7.2 L106 26 Z' fill='%233d8bff'/><path d='M126 6.8 L144 4.5 L137 24 Z' fill='%23ff8a1c'/></svg>") repeat-x 0 0 / 150px 30px;
  filter: drop-shadow(0 3px 4px rgba(8, 2, 6, .35));
  animation: tema-bandeira 2.8s ease-in-out infinite alternate; transform-origin: 50% 0;
}
.com-tema .com-casca .tema-faixa { top: var(--tema-topo, 0px); }
@media (min-width: 960px) { .com-tema .com-casca .tema-faixa { top: 0; left: var(--lateral, 248px); } }
@keyframes tema-bandeira { from { transform: scaleY(1); } to { transform: scaleY(.88) skewX(-2deg); } }

/* ---------- personagem escondido: espia de trás da barra de vidro, acena e fala ---------- */
.com-tema .tema-personagem {
  display: block; position: fixed; z-index: 29; /* atrás da barra (30): o corpo aparece desfocado pelo vidro */
  right: 22px; bottom: 0; width: 96px; height: 160px; overflow: hidden; pointer-events: none;
}
.com-tema .tema-personagem svg {
  position: absolute; left: 0; bottom: 0; width: 96px; height: auto; pointer-events: auto; cursor: pointer;
  transform: translateY(110%); animation: tema-espia 34s cubic-bezier(.34, 1.4, .64, 1) 6s infinite;
}
/* quanto ele sobe em cada tela (valores fixos nos quadros: var() dentro de @keyframes falha no Safari e às vezes no Chrome) */
@keyframes tema-espia { 0% { transform: translateY(110%); } 4%, 17% { transform: translateY(-54px); } 19.5%, 100% { transform: translateY(110%); } } /* celular: a cabeça passa da barra */
@keyframes tema-espia-canto { 0% { transform: translateY(110%); } 4%, 17% { transform: translateY(30%); } 19.5%, 100% { transform: translateY(110%); } } /* login: só a cabeça */
@keyframes tema-espia-pc { 0% { transform: translateY(110%); } 4%, 17% { transform: translateY(22%); } 19.5%, 100% { transform: translateY(110%); } } /* computador */
.com-tema .tema-personagem .acena { transform-box: view-box; animation: tema-acena 34s ease-in-out 6s infinite; }
@keyframes tema-acena {
  0%, 5% { transform: rotate(0deg); } 6.2% { transform: rotate(-16deg); } 7.4% { transform: rotate(10deg); } 8.6% { transform: rotate(-16deg); }
  9.8% { transform: rotate(10deg); } 11% { transform: rotate(-12deg); } 12.5%, 100% { transform: rotate(0deg); }
}
.com-tema .tema-personagem .olhos { transform-box: view-box; animation: tema-pisca 4.2s infinite; }
@keyframes tema-pisca { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
/* tela de entrar (sem barra): só a cabeça aparece, no canto de baixo */
.com-tema body:not(.com-casca) .tema-personagem svg { animation-name: tema-espia-canto; }
.com-tema body:not(.com-casca) .tema-fala { bottom: 84px; }
/* computador: sem barra, ele espia do canto de baixo da tela */
@media (min-width: 960px) {
  .com-tema .tema-personagem { right: 40px; width: 124px; height: 200px; }
  .com-tema .tema-personagem svg { width: 124px; animation-name: tema-espia-pc; }
}

/* balão de fala, de vidro */
.com-tema .tema-fala {
  display: block; position: fixed; z-index: 31; right: 104px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 108px);
  max-width: 210px; padding: 9px 14px; border-radius: 18px 18px 4px 18px; pointer-events: none;
  font-size: 14px; font-weight: 700; color: #fff; line-height: 1.25;
  background: linear-gradient(140deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .10)); border: 1px solid rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 10px 26px rgba(8, 2, 6, .45);
  opacity: 0; transform: translateY(6px) scale(.92); transform-origin: 100% 100%;
}
.com-tema .tema-fala.falando { animation: tema-fala 5s ease forwards; }
@keyframes tema-fala { 0% { opacity: 0; transform: translateY(6px) scale(.92); } 8%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (min-width: 960px) { .com-tema .tema-fala { right: 160px; bottom: 100px; } }

/* ---------- acessório da data (gorrinho, orelhinhas, chapéu…) no avatar, na bolha da página aberta e nos ícones do Início ---------- */
.com-tema .avatar, .com-tema .atalho-ic { position: relative; }
.com-tema .avatar::after, .com-tema .bolha::before, .com-tema .atalho-ic::after {
  content: ""; position: absolute; pointer-events: none; background: var(--tema-acessorio) no-repeat center / contain;
  filter: drop-shadow(0 2px 3px rgba(8, 2, 6, .4));
}
.com-tema .avatar::after { width: 30px; height: 25px; top: -14px; left: -10px; transform: rotate(-22deg); }
.com-tema .lat-conta .avatar::after { width: 26px; height: 22px; top: -12px; left: -9px; }
.com-tema .bolha::before { width: 26px; height: 22px; top: -13px; left: -7px; transform: rotate(-20deg); z-index: 2; }
.com-tema .atalho-ic::after { width: 24px; height: 20px; top: -12px; right: -11px; transform: rotate(18deg); }
/* gravata-borboleta (Dia dos Pais) vai embaixo, como no pescoço */
.tema-dia-dos-pais .avatar::after { top: auto; bottom: -11px; left: 50%; margin-left: -13px; width: 26px; height: 21px; transform: none; }
.tema-dia-dos-pais .bolha::before { top: auto; bottom: -9px; left: 50%; margin-left: -11px; width: 22px; height: 18px; transform: none; }
.tema-dia-dos-pais .atalho-ic::after { top: auto; bottom: -9px; right: auto; left: 50%; margin-left: -11px; width: 22px; height: 18px; transform: none; }
/* óculos escuros (Férias de janeiro): em cima da cabeça, quase retos */
.tema-ferias-janeiro .avatar::after, .tema-ferias-janeiro .bolha::before, .tema-ferias-janeiro .atalho-ic::after { transform: rotate(-8deg); }

/* ---------- neve acumulada em cima da barra e do cartão de entrar (Natal) ---------- */
.tema-neve-na-barra .barra::after, .tema-neve-na-barra .cartao-login::after {
  content: ""; position: absolute; top: -7px; left: 20px; right: 20px; height: 14px; pointer-events: none; z-index: 3;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 18' preserveAspectRatio='none'><path d='M0 12 C10 4 22 3 34 6 C46 9 52 2 66 3 C80 4 86 9 100 6 C114 3 124 1 138 4 C152 7 160 3 172 4 C186 5 194 8 200 12 L200 15 L0 15 Z' fill='%23ffffff'/><ellipse cx='42' cy='15' rx='2.6' ry='3' fill='%23ffffff'/><ellipse cx='118' cy='15.5' rx='2.2' ry='2.6' fill='%23ffffff'/><ellipse cx='163' cy='14.8' rx='1.8' ry='2.2' fill='%23ffffff'/></svg>") no-repeat center / 100% 100%;
  filter: drop-shadow(0 1px 1.5px rgba(110, 140, 190, .45));
}

/* ---------- saudação da data: no Início (no lugar de "Portal do Corretor") e no login ---------- */
.com-tema .cab-pagina:has(~ #f-busca) .tema { font-size: 0; }
.com-tema .cab-pagina:has(~ #f-busca) .tema::after { content: var(--tema-saudacao); font-size: 12px; }
.com-tema .cartao-login:has(#f-login) .tema::after { content: "  ·  " var(--tema-saudacao); white-space: pre; }
.com-tema .cab-pagina:has(~ #f-busca) .tema::after, .com-tema .cartao-login:has(#f-login) .tema::after { color: #ffd98a; text-shadow: 0 0 10px rgba(255, 200, 110, .55); }

/* ---------- menos movimento: tudo parado (personagem espiando parado, nada caindo) ---------- */
@media (prefers-reduced-motion: reduce) and (min-width: 960px) { .com-tema .tema-personagem svg { transform: translateY(22%) !important; } }
@media (prefers-reduced-motion: reduce) {
  .com-tema .tema-fundo::before, .com-tema .tema-fundo::after, .com-tema .tema-pendurados i, .com-tema .tema-faixa, .com-tema .tema-personagem .acena, .com-tema .tema-personagem .olhos { animation: none; }
  .com-tema .tema-personagem svg { animation: none; transform: translateY(-54px); }
  .com-tema body:not(.com-casca) .tema-personagem svg { transform: translateY(30%); }
  .com-tema .tema-fala.falando { animation: none; opacity: 1; transform: none; }
}
