/* =========================================================
   Foxthree: camada visual compartilhada (premium effects)
   Carregado ANTES do <style> inline de cada página.
   Usa os tokens :root já definidos (--orange, --pink, --grad...).
   Tudo aqui é progressivo: se o JS não rodar, o site continua igual.
   ========================================================= */

:root {
  --fx-orange: var(--orange, #fe743d);
  --fx-pink: var(--pink, #fe3753);
}

/* ---------- Camadas de fundo globais (injetadas via JS) ---------- */
.fx-aurora,
.fx-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Aurora animada: substitui os "blobs" estáticos por algo vivo e sutil */
.fx-aurora {
  opacity: .9;
  background:
    radial-gradient(38% 44% at 18% 12%, rgba(254,116,61,.16), transparent 62%),
    radial-gradient(34% 40% at 84% 8%, rgba(254,55,83,.13), transparent 60%),
    radial-gradient(46% 50% at 70% 88%, rgba(254,116,61,.10), transparent 64%);
  filter: blur(8px);
  animation: fxAurora 26s var(--ease, cubic-bezier(.16,1,.3,1)) infinite alternate;
  will-change: transform, opacity;
}
@keyframes fxAurora {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1);    opacity: .75; }
  50%  { transform: translate3d(2%, 2%, 0)  scale(1.08);  opacity: 1; }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.03);  opacity: .8; }
}

/* Grão/noise: textura fina que tira o "flat" genérico */
.fx-grain {
  z-index: 2;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* Glow que segue o cursor, dando vida ao dark sem custo por card */
.fx-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(254,116,61,.12), rgba(254,55,83,.06) 38%, transparent 68%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .5s ease;
  will-change: transform;
}
body.fx-cursor-active .fx-cursor { opacity: 1; }

/* ---------- Spotlight nos cards (highlight radial seguindo o mouse) ---------- */
/* Reaproveita ::before livre na maioria; .depo-card usa ::after */
.dna-pillar,
.servico-card,
.labs-item,
.case,
.val,
.stat,
.meta-item,
.other-card,
.depo-card {
  position: relative;
}
.dna-pillar > *,
.servico-card > *,
.labs-item > *,
.case > *,
.val > *,
.stat > *,
.meta-item > *,
.other-card > *,
.depo-card > * {
  position: relative;
  z-index: 1;
}
.dna-pillar::before,
.servico-card::before,
.labs-item::before,
.case::before,
.val::before,
.stat::before,
.meta-item::before,
.other-card::before,
.depo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(254,116,61,.16), rgba(254,55,83,.06) 40%, transparent 65%);
}
.dna-pillar:hover::before,
.servico-card:hover::before,
.labs-item:hover::before,
.case:hover::before,
.val:hover::before,
.stat:hover::before,
.meta-item:hover::before,
.other-card:hover::before,
.depo-card:hover::after {
  opacity: 1;
}

/* Borda viva no hover: gradiente da marca acompanha o realce */
.dna-pillar:hover,
.servico-card:hover,
.labs-item:hover,
.case:hover,
.val:hover,
.stat:hover,
.meta-item:hover,
.other-card:hover,
.depo-card:hover {
  border-color: rgba(254,116,61,.35);
}

/* ---------- Botões com brilho sutil ---------- */
.btn-primary,
.nav-cta,
.lead-submit,
.cta-wpp-link {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after,
.nav-cta::after,
.cta-wpp-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s var(--ease, cubic-bezier(.16,1,.3,1));
}
.btn-primary:hover::after,
.nav-cta:hover::after,
.cta-wpp-link:hover::after {
  transform: translateX(120%);
}

/* ---------- Count-up: estado inicial discreto ---------- */
.fx-count { font-variant-numeric: tabular-nums; }

/* ---------- Acessibilidade / motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-aurora { animation: none; }
  .fx-cursor { display: none; }
  .btn-primary::after,
  .nav-cta::after,
  .cta-wpp-link::after { display: none; }
}

/* =========================================================
   Barra de contato fixa (todas as páginas)
   Desktop: pílula no canto, com rótulo permanente.
   Mobile: barra inferior com duas ações.
   Markup em partials/contato.php, comportamento em site.js.
   ========================================================= */
.fw {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .65rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s var(--ease, cubic-bezier(.16,1,.3,1)),
              transform .35s var(--ease, cubic-bezier(.16,1,.3,1));
}
.fw.fw-on { opacity: 1; transform: none; }
/* Some quando o formulário de contato está na tela: ali ele só atrapalha. */
.fw.fw-idle { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* ---------- Desktop: pílula ---------- */
.fw-btn {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 .65rem;
  padding: .7rem 1.15rem .7rem .95rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(37, 211, 102, .4);
  transition: transform .25s var(--ease, cubic-bezier(.16,1,.3,1)),
              box-shadow .25s var(--ease, cubic-bezier(.16,1,.3,1));
}
.fw-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(37, 211, 102, .5); }
.fw-icon { width: 26px; height: 26px; flex-shrink: 0; display: block; grid-row: span 2; }
.fw-label { font-size: .92rem; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.fw-hours { font-size: .68rem; font-weight: 400; opacity: .85; line-height: 1.2; white-space: nowrap; }

/* Pulso de chamada: roda poucas vezes e para. Movimento infinito o olho ignora. */
.fw-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(37, 211, 102, .55);
  animation: fw-pulse 2s ease-out 3;
  pointer-events: none;
}
@keyframes fw-pulse {
  0%   { transform: scale(1);    opacity: 1 }
  100% { transform: scale(1.16); opacity: 0 }
}

/* ---------- Balão de chamada ---------- */
.fw-bubble {
  position: relative;
  max-width: 260px;
  padding: .9rem 2rem .9rem 1rem;
  border-radius: 14px 14px 4px 14px;
  background: var(--surface, #16161a);
  border: 1px solid var(--border-med, rgba(255,255,255,.12));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  cursor: pointer;
  animation: fw-bubble-in .45s var(--ease, cubic-bezier(.16,1,.3,1)) both;
}
@keyframes fw-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(.96) }
  to   { opacity: 1; transform: none }
}
.fw-bubble-text { font-size: .88rem; line-height: 1.45; color: var(--text, #f5f3f0); font-weight: 400; }
.fw-bubble-meta { margin-top: .35rem; font-size: .74rem; color: var(--text-dim, #8a8a8f); }
.fw-bubble-close {
  position: absolute; top: .3rem; right: .45rem;
  width: 24px; height: 24px; border: 0; background: none;
  color: var(--text-muted, #5e5e63); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.fw-bubble-close:hover { color: var(--text, #f5f3f0); }

/* ---------- Mobile: barra de duas ações ---------- */
.fw-bar { display: none; }

@media (max-width: 760px) {
  .fw {
    left: 0; right: 0; bottom: 0;
    align-items: stretch;
    gap: 0;
  }
  .fw-btn { display: none; }
  .fw-bubble {
    margin: 0 .75rem .6rem auto;
    max-width: min(78vw, 260px);
  }
  .fw-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 11, 13, .92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border, rgba(255,255,255,.07));
  }
  .fw-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 52px;
    padding: 0 .75rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }
  .fw-bar-btn .fw-icon { width: 20px; height: 20px; }
  .fw-bar-wpp  { background: #25d366; color: #fff; }
  .fw-bar-form { background: var(--grad, linear-gradient(88deg,#fe743d,#fe3753)); color: #fff; }
  /* A barra cobre o rodapé; devolvemos o espaço. */
  body { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .fw { transition: none; }
  .fw-btn::before { animation: none; display: none; }
  .fw-bubble { animation: none; }
}

/* =========================================================
   Faixa de chamada no meio da página
   ========================================================= */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: 3.5rem;
  padding: 1.75rem clamp(1.25rem, 3vw, 2.25rem);
  border-radius: 18px;
  background: var(--surface, #16161a);
  border: 1px solid var(--border, rgba(255,255,255,.07));
}
.cta-band-title {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text, #f5f3f0);
  line-height: 1.25;
  text-wrap: balance;
}
.cta-band-sub { font-size: .88rem; color: var(--text-mid, #b8b6b3); margin-top: .35rem; }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cta-band-wpp, .cta-band-form {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.cta-band-wpp { background: #25d366; color: #fff; }
.cta-band-wpp:hover { background: #1fb855; }
.cta-band-form {
  color: var(--text, #f5f3f0);
  border: 1px solid var(--border-med, rgba(255,255,255,.12));
}
.cta-band-form:hover { border-color: var(--orange, #fe743d); color: var(--orange, #fe743d); }

@media (max-width: 700px) {
  .cta-band { flex-direction: column; align-items: flex-start; }
  .cta-band-actions { width: 100%; }
  .cta-band-wpp, .cta-band-form { flex: 1; justify-content: center; }
}
