/* ============================================================
   COMPONENTS — nav, botões, listas, código, formulários
   ============================================================ */

/* ---------- Loader / abertura cinematográfica ---------- */
#loader {
  position: fixed; inset: 0;
  z-index: 200;
  display: grid; place-items: center;
  /* failsafe: se o JS não completar, o loader sai sozinho */
  animation: loaderFailsafe 0.6s var(--ease-soft) 7s forwards;
}
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; } }
#loader::before, #loader::after {
  content: ""; position: absolute; left: 0; right: 0; height: 50.5%;
  background: #04060d;
  transition: transform 0.85s var(--ease-out) 0.15s;
}
#loader::before { top: 0; }
#loader::after { bottom: 0; }
.loader-center {
  position: relative; z-index: 2;
  text-align: center;
  transition: opacity 0.4s var(--ease-soft), transform 0.4s var(--ease-soft);
}
.loader-mark {
  width: 52px; height: 52px; border-radius: 16px;
  margin-inline: auto;
  animation: loaderBeat 1.6s var(--ease-soft) infinite;
}
.loader-mark svg { width: 30px; height: 30px; }
@keyframes loaderBeat { 50% { transform: scale(1.08); box-shadow: 0 0 42px rgba(73, 121, 255, 0.7); } }
.loader-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.4rem; letter-spacing: -0.01em;
  margin-top: 0.9rem;
}
.loader-status {
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  color: var(--ink-mute); letter-spacing: 0.08em;
  margin-top: 0.5rem;
}
.loader-num { color: var(--accent-2); margin-left: 0.6rem; }
.loader-bar {
  width: 220px; height: 2px; margin: 1rem auto 0;
  background: var(--stroke);
  border-radius: 2px; overflow: hidden;
}
.loader-bar i {
  display: block; height: 100%; width: 0%;
  background: var(--grad-hero);
  box-shadow: 0 0 12px rgba(73, 121, 255, 0.8);
  transition: width 0.2s linear;
}
#loader.is-done { pointer-events: none; }
#loader.is-done::before { transform: translateY(-101%); }
#loader.is-done::after { transform: translateY(101%); }
#loader.is-done .loader-center { opacity: 0; transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) { #loader { display: none; } }

/* ---------- Grão de filme ---------- */
.grain {
  position: fixed; inset: -80%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  animation: grainShift 7s steps(8) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -2%); }
  100% { transform: translate(3%, 3%); }
}
@media (prefers-reduced-motion: reduce) { .grain { display: none; } }

/* ---------- Letterbox (modo cinema) ---------- */
.letterbox i {
  position: fixed; left: 0; right: 0;
  height: clamp(34px, 5vh, 56px);
  background: #02040a;
  z-index: 70;
  pointer-events: none;
  transition: transform 0.75s var(--ease-out);
}
.lb-t { top: 0; transform: translateY(-101%); }
.lb-b { bottom: 0; transform: translateY(101%); }
body.is-cinema .lb-t, body.is-cinema .lb-b { transform: none; }

/* ---------- Cursor customizado ---------- */
.pf-cursor, .pf-cursor-ring {
  position: fixed; top: 0; left: 0;
  z-index: 210;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
}
.pf-cursor {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(73, 121, 255, 0.9);
}
.pf-cursor-ring {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid rgba(73, 121, 255, 0.55);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              margin 0.3s var(--ease-out), border-color 0.3s, background 0.3s;
}
.pf-cursor-ring.is-hover {
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-color: rgba(73, 121, 255, 0.9);
  background: rgba(73, 121, 255, 0.08);
}
.pf-cursor-ring.is-down { transform-origin: center; border-color: #fff; }
html.has-cursor, html.has-cursor body, html.has-cursor body * { cursor: none !important; }

/* ---------- Botão "disparar teste" do console ---------- */
.console-bar .console-fire {
  margin-left: auto;
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  color: var(--accent-2);
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(73, 121, 255, 0.4);
  border-radius: 999px;
  transition: background 0.25s, box-shadow 0.25s, transform 0.15s;
}
.console-bar .console-fire:hover {
  background: rgba(73, 121, 255, 0.12);
  box-shadow: 0 0 16px rgba(73, 121, 255, 0.25);
}
.console-bar .console-fire:active { transform: scale(0.95); }
.console-bar .console-fire + .console-live { margin-left: 0.7rem; }
.console-fire.is-armed { animation: firePulse 0.5s var(--ease-out); }
@keyframes firePulse { 30% { box-shadow: 0 0 26px rgba(73, 121, 255, 0.7); } }

/* ---------- Chips de resposta do chat (IA interativa) ---------- */
.chat-choices {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  align-self: flex-start;
  animation: msgIn 0.45s var(--ease-out);
}
.chat-chip {
  font-size: 0.78rem; font-weight: 500;
  color: #d9d3ff;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(139, 123, 255, 0.5);
  border-radius: 999px;
  background: rgba(139, 123, 255, 0.08);
  transition: background 0.25s, transform 0.2s var(--ease-out), box-shadow 0.25s;
}
.chat-chip:hover {
  background: rgba(139, 123, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(139, 123, 255, 0.3);
}
.chat-chip.replay { border-style: dashed; color: var(--ink-mute); }

/* ---------- KPI vivo (tick) ---------- */
.kpi b span.tick { animation: kpiTick 0.55s var(--ease-out); display: inline-block; }
@keyframes kpiTick {
  30% { transform: translateY(-3px) scale(1.05); color: var(--accent-2); }
}

/* ---------- Progress bar ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: var(--z-progress);
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--grad-hero);
  box-shadow: 0 0 12px rgba(73, 121, 255, 0.7);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  transition: background var(--dur) var(--ease-soft), border-color var(--dur) var(--ease-soft);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(5, 8, 16, 0.72);
  border-bottom-color: var(--stroke);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.nav-inner {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
  display: flex; align-items: center; gap: 2rem;
  padding-block: 0.9rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }

/* logo oficial (versões aparadas, sem margem transparente) */
.brand-logo { height: 26px; width: auto; display: block; }
.footer .brand-logo { height: 22px; }
.loader-logo {
  height: 42px; width: auto;
  display: block; margin-inline: auto;
  filter: drop-shadow(0 0 22px rgba(73, 121, 255, 0.4));
  animation: logoBeat 1.6s var(--ease-soft) infinite;
}
@keyframes logoBeat { 50% { transform: scale(1.05); } }
@media (max-width: 640px) {
  .brand-logo { height: 22px; }
  .loader-logo { height: 34px; }
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #2f5fe0);
  box-shadow: var(--glow-accent);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 1.6rem; margin-inline: auto; }
.nav-links a {
  font-size: var(--fs-small); font-weight: 500; color: var(--ink-soft);
  transition: color 0.25s;
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px; border-radius: 2px;
  background: var(--accent-2);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.3s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { display: flex; gap: 0.7rem; }

.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span {
  width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink); transition: transform 0.3s, opacity 0.3s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column; gap: 0.4rem;
  padding: 0.8rem var(--gutter) 1.4rem;
  background: rgba(5, 8, 16, 0.95);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-mobile a { padding: 0.55rem 0.2rem; font-weight: 500; color: var(--ink-soft); }
.nav-mobile .btn { margin-top: 0.6rem; justify-content: center; }
.nav-mobile.is-open { display: flex; }

@media (max-width: 960px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; margin-left: auto; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: var(--fs-small);
  padding: 0.72rem 1.35rem;
  border-radius: 12px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  will-change: transform;
}
.btn-lg { padding: 0.95rem 1.8rem; font-size: 1rem; border-radius: 14px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #5c88ff, var(--accent) 55%, #2f5fe0);
  box-shadow: 0 8px 28px rgba(73, 121, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(73, 121, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--stroke-strong);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: rgba(122, 162, 255, 0.55); background: var(--glass-strong); }

/* ---------- Check list ---------- */
.check-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.65rem;
  color: var(--ink-soft);
}
.check-list li::before {
  content: "";
  position: absolute; left: 0; top: 0.42em;
  width: 15px; height: 15px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(73, 121, 255, 0.25), transparent 70%);
  border: 1px solid rgba(73, 121, 255, 0.6);
}
.check-list li::after {
  content: "";
  position: absolute; left: 4px; top: calc(0.42em + 3px);
  width: 7px; height: 4px;
  border-left: 1.6px solid var(--accent-2);
  border-bottom: 1.6px solid var(--accent-2);
  transform: rotate(-45deg);
}
.check-list code { color: var(--accent-2); }

/* ---------- Console / código ---------- */
.console-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--stroke);
}
.console-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.console-title {
  margin-left: 0.6rem;
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  color: var(--ink-mute); letter-spacing: 0.04em;
}
.console-live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  color: var(--accent-4);
}

.code-window { overflow: hidden; }
.code-tabs { display: flex; gap: 0.3rem; margin-left: 0.8rem; }
.code-tabs button {
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  color: var(--ink-mute);
  padding: 0.35rem 0.8rem; border-radius: 8px;
  transition: color 0.25s, background 0.25s;
}
.code-tabs button:hover { color: var(--ink); }
.code-tabs button.is-active { color: var(--accent-2); background: rgba(73, 121, 255, 0.08); }

.code-body {
  display: none;
  padding: 1.3rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.83rem; line-height: 1.7;
  color: var(--ink-soft);
  overflow-x: auto;
  white-space: pre;
}
.code-body.is-active { display: block; }
.code-body .c { color: var(--ink-dim); }
.code-body .s { color: #9dd3a8; }
.code-body .k { color: #7aa2ff; }

/* ---------- Formulário de lead ---------- */
.lead-form {
  display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center;
  margin-top: 1.6rem;
}
.lead-form input[type="email"] {
  flex: 1 1 260px; max-width: 360px;
  font: inherit; color: var(--ink);
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.lead-form input[type="email"]::placeholder { color: var(--ink-dim); }
.lead-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(73, 121, 255, 0.25);
}
.lead-form .hp { position: absolute; left: -9999px; opacity: 0; }
.form-ok { width: 100%; color: var(--accent-4); font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: var(--z-content);
  border-top: 1px solid var(--stroke);
  background: linear-gradient(180deg, transparent, rgba(4, 6, 13, 0.9) 30%);
  padding-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
}
.footer-grid nav { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-grid nav b { margin-bottom: 0.35rem; font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
.footer-grid nav a { color: var(--ink-soft); font-size: var(--fs-small); transition: color 0.25s; }
.footer-grid nav a:hover { color: var(--accent-2); }
.footer-tag { margin-top: 0.9rem; color: var(--ink-mute); font-size: var(--fs-small); max-width: 26ch; }
.footer-base {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.4rem;
  border-top: 1px solid var(--stroke);
  color: var(--ink-dim); font-size: var(--fs-tiny);
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- CTA flutuante (aparece após o hero) ---------- */
.float-cta {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 60;
  opacity: 0;
  transform: translateY(18px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.float-cta.is-show { opacity: 1; transform: none; pointer-events: auto; }
.float-cta .btn { box-shadow: 0 14px 40px rgba(73, 121, 255, 0.5); }
body.is-cinema .float-cta { opacity: 0; pointer-events: none; } /* some no modo cinema */
@media (max-width: 640px) {
  .float-cta { right: 12px; bottom: 12px; left: 12px; }
  .float-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- FAQ (details nativo: conteúdo sempre no DOM) ---------- */
.faq-group { display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--glass);
  overflow: hidden;
  transition: border-color 0.25s;
}
.faq-item[open] { border-color: var(--stroke-strong); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 1.15rem 3.2rem 1.15rem 1.4rem;
  position: relative;
  font-weight: 600; font-size: 1.02rem;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 1.4rem; top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item summary:hover { color: var(--accent-2); }
.faq-answer { padding: 0 1.4rem 1.35rem; color: var(--ink-soft); font-size: var(--fs-small); }
.faq-answer > * + * { margin-top: 0.8rem; }
.faq-answer a { color: #8fb0ff; text-decoration: underline; text-underline-offset: 3px; }
.faq-answer ul { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; }
