/**
 * AVOTRA — Camada Visual & Animações do Site Público
 * Alinhado 1:1 com o protótipo editorial aprovado
 */

:root {
  --av-bg: #06090F;
  --av-bg-2: #080D15;
  --av-surface: #0A1019;
  --av-surface-2: #0E1522;
  --av-line: #131C2B;
  --av-line-2: #1B2638;
  --av-line-input: #243452;
  --av-text: #EEF3FA;
  --av-text-2: #B6C3D6;
  --av-muted: #9FB0C6;
  --av-accent: #00E599;
  --av-accent-dark: #04110C;
  --av-accent-dim: #0F2A27;
  --av-accent-line: #14543F;
  --av-warning: #F5B84A;
  --av-danger: #FF8A8A;
}

/* Reset base para as páginas públicas */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body.av-public-body {
  margin: 0;
  background: var(--av-bg);
  color: var(--av-text);
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--av-accent);
  outline-offset: 3px;
}

/* Tipografia editorial */
.font-display {
  font-family: 'Sora', system-ui, sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(0, 229, 153, .55);
}

.btn .arr {
  display: inline-block;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}

.btn:hover .arr {
  transform: translateX(5px);
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--av-accent) !important;
  background: rgba(0, 229, 153, .07);
}

/* Cartões com elevação suave */
.lift {
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s ease;
}

.lift:hover {
  transform: translateY(-6px);
  border-color: #1F6B55 !important;
}

/* Pílulas e chips interativos */
.chip {
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.chip:hover {
  border-color: var(--av-accent) !important;
}

/* Campos de Formulário com anel de foco verde */
.fld {
  transition: border-color .2s ease, box-shadow .2s ease;
}

.fld:focus {
  border-color: var(--av-accent) !important;
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 229, 153, .14) !important;
}

/* Faixa de sinais (Marquee Infinito) */
.mqwrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.mq {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: mq 60s linear infinite;
}

.mqwrap:hover .mq {
  animation-play-state: paused;
}

@keyframes mq {
  to { transform: translateX(-50%); }
}

/* Efeitos de Flutuação e Deriva */
@keyframes fl {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes fl2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

@keyframes dr {
  0% { transform: translate(0, 0) rotate(0); }
  100% { transform: translate(-40px, 30px) rotate(2deg); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 153, .5); }
  100% { box-shadow: 0 0 0 14px rgba(0, 229, 153, 0); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes ty {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes rot {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.fl { animation: fl 7s ease-in-out infinite; }
.fl2 { animation: fl2 8s ease-in-out infinite; }
.dr { animation: dr 22s ease-in-out infinite alternate; }
.dot { animation: pulse 1.8s ease-out infinite; }
.cur { animation: blink 1s steps(1) infinite; }
.rot { animation: rot 18s linear infinite; }
.shake { animation: shake 0.4s ease-in-out; }
.fade-in { animation: fadeSlide 0.3s cubic-bezier(.16, 1, .3, 1) both; }
.code1 { animation: ty 2.2s steps(40) both; }

/* Demonstração animada: ciclo de 22s em loop */
.s1, .s2, .s3, .s4, .s5, .s6, .s7, .s8, .s9 {
  opacity: 0;
}

.s1 { animation: s1 22s infinite; }
.s2 { animation: s2 22s infinite; }
.s3 { animation: s3 22s infinite; }
.s4 { animation: s4 22s infinite; }
.s5 { animation: s5 22s infinite; }
.s6 { animation: s6 22s infinite; }
.s7 { animation: s7 22s infinite; }
.s8 { animation: s8 22s infinite; }
.s9 { animation: s9 22s infinite; }

@keyframes s1 { 0%, 4% { opacity: 0; transform: translateY(14px); } 7%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateY(14px); } }
@keyframes s2 { 0%, 14% { opacity: 0; transform: translateY(14px); } 17%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateY(14px); } }
@keyframes s3 { 0%, 26% { opacity: 0; transform: translateY(14px); } 29%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateY(14px); } }
@keyframes s4 { 0%, 34% { opacity: 0; transform: translateY(14px); } 37%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateY(14px); } }
@keyframes s5 { 0%, 42% { opacity: 0; transform: translateX(18px); } 45%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateX(18px); } }
@keyframes s6 { 0%, 50% { opacity: 0; transform: translateX(18px); } 53%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateX(18px); } }
@keyframes s7 { 0%, 58% { opacity: 0; transform: translateX(18px); } 61%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateX(18px); } }
@keyframes s8 { 0%, 66% { opacity: 0; transform: translateX(18px); } 69%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateX(18px); } }
@keyframes s9 { 0%, 76% { opacity: 0; transform: translateY(14px); } 79%, 93% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: translateY(14px); } }

.hl {
  transform-origin: left;
  animation: hl 22s infinite;
}

@keyframes hl {
  0%, 32% { transform: scaleX(0); }
  38%, 93% { transform: scaleX(1); }
  97%, 100% { transform: scaleX(0); }
}

/* Revelar ao rolar (Scroll Reveal universal e estável via IntersectionObserver) */
.rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(.16, 1, .3, 1), transform .65s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}

.rv.is-in,
.rv.in-view {
  opacity: 1 !important;
  transform: none !important;
}

/* Índice lateral (Termos & Privacidade) */
.toc a {
  transition: color .2s ease, padding-left .25s ease;
  display: block;
}

.toc a:hover {
  color: var(--av-accent);
  padding-left: 8px;
}

/* Pulsação do Coração do Rodapé */
.av-heart-pulse {
  display: inline-block;
  animation: avHeartBeat 1.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes avHeartBeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.35); }
  28% { transform: scale(1); }
  42% { transform: scale(1.35); }
  70% { transform: scale(1); }
}

/* Ícones Sociais do Rodapé */
.av-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--av-surface);
  color: var(--av-muted);
  border: 1px solid var(--av-line-2);
  transition: all .25s ease;
}

.av-social-icon:hover {
  color: var(--av-accent);
  border-color: var(--av-accent);
  background: rgba(0, 229, 153, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.22);
}

/* Responsividade Geral */
@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: 1fr !important;
  }
  .steps-grid > div {
    margin-top: 0 !important;
  }
  .hide-mobile {
    display: none !important;
  }
  .mobile-stack {
    flex-direction: column !important;
  }
}

/* Garantir que as animações do site público executem perfeitamente em desktop e mobile */
.av-public-body .fl { animation: fl 7s ease-in-out infinite !important; }
.av-public-body .fl2 { animation: fl2 8s ease-in-out infinite !important; }
.av-public-body .dr { animation: dr 22s ease-in-out infinite alternate !important; }
.av-public-body .dot { animation: pulse 1.8s ease-out infinite !important; }
.av-public-body .cur { animation: blink 1s steps(1) infinite !important; }
.av-public-body .rot { animation: rot 18s linear infinite !important; }
.av-public-body .mq { animation: mq 60s linear infinite !important; }
.av-public-body .av-heart-pulse { animation: avHeartBeat 1.4s ease-in-out infinite !important; }

/* Demo: ciclo de 22s em loop contínuo */
.av-public-body .s1 { animation: s1 22s infinite !important; }
.av-public-body .s2 { animation: s2 22s infinite !important; }
.av-public-body .s3 { animation: s3 22s infinite !important; }
.av-public-body .s4 { animation: s4 22s infinite !important; }
.av-public-body .s5 { animation: s5 22s infinite !important; }
.av-public-body .s6 { animation: s6 22s infinite !important; }
.av-public-body .s7 { animation: s7 22s infinite !important; }
.av-public-body .s8 { animation: s8 22s infinite !important; }
.av-public-body .s9 { animation: s9 22s infinite !important; }
.av-public-body .hl { animation: hl 22s infinite !important; }

/* Acessibilidade: transições suaves */
@media (prefers-reduced-motion: reduce) {
  .rv {
    transition-duration: 0.3s !important;
  }
}

