/* ──────────────────────────────────────────────────────────
   NR1-X · ANIMAÇÕES
   ────────────────────────────────────────────────────────── */

/* ═══════════════ KEYFRAMES BASE ═══════════════ */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes slide-up   { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes slide-down { from { opacity:0; transform:translateY(-12px);} to { opacity:1; transform:translateY(0); } }
@keyframes slide-left { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes slide-right{ from { opacity:0; transform:translateX(-20px);} to { opacity:1; transform:translateX(0); } }
@keyframes scale-in   { from { opacity:0; transform:scale(0.94); }      to { opacity:1; transform:scale(1); } }
@keyframes pop-bounce { 0%{transform:scale(0.6);opacity:0} 60%{transform:scale(1.12);opacity:1} 100%{transform:scale(1)} }
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes shimmer    { 0%{background-position:-1000px 0} 100%{background-position:1000px 0} }
@keyframes float      { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

/* ─── FIX: cubic-bezier inline (var() em animation shorthand não funciona em todos os browsers) ─── */
.anim-fade   { animation: fade-in    380ms cubic-bezier(0.16,1,0.3,1)    both; }
.anim-up     { animation: slide-up   520ms cubic-bezier(0.16,1,0.3,1)    both; }
.anim-down   { animation: slide-down 400ms cubic-bezier(0.16,1,0.3,1)    both; }
.anim-left   { animation: slide-left  480ms cubic-bezier(0.16,1,0.3,1)   both; }
.anim-right  { animation: slide-right 480ms cubic-bezier(0.16,1,0.3,1)   both; }
.anim-scale  { animation: scale-in   400ms cubic-bezier(0.34,1.56,0.64,1) both; }
.anim-pop    { animation: pop-bounce  560ms cubic-bezier(0.34,1.56,0.64,1) both; }
.float       { animation: float 5s ease-in-out infinite; }

/* stagger: children animate in sequence
   opacity:0 é intencional + fill:both = opacity:1 ao final.
   sem animation (reduced-motion), forçamos opacity:1 no @media abaixo. */
.stagger > * {
  opacity: 0;
  animation: slide-up 540ms cubic-bezier(0.16,1,0.3,1) both;
}
.stagger > *:nth-child(1) { animation-delay:  60ms; }
.stagger > *:nth-child(2) { animation-delay: 140ms; }
.stagger > *:nth-child(3) { animation-delay: 220ms; }
.stagger > *:nth-child(4) { animation-delay: 300ms; }
.stagger > *:nth-child(5) { animation-delay: 380ms; }
.stagger > *:nth-child(6) { animation-delay: 460ms; }
.stagger > *:nth-child(7) { animation-delay: 540ms; }
.stagger > *:nth-child(8) { animation-delay: 620ms; }
.stagger > *:nth-child(9) { animation-delay: 700ms; }

/* ═══════════════ FULL-SCREEN LIQUID LOADER ═══════════════ */
.fs-liquid {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}
.fs-liquid.active  { display: block; pointer-events: auto; animation: fade-in 200ms ease-out; }
.fs-liquid.closing { animation: fade-out 320ms ease-in forwards; }

.fs-liquid-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  background: #7C187C;
  transition: height 700ms cubic-bezier(0.65,0,0.35,1), background 500ms ease-out;
  overflow: visible;
}
.fs-liquid.success .fs-liquid-body,
.fs-liquid.success .fs-liquid-body::before,
.fs-liquid.success .fs-liquid-body::after { background: #1E6FFF; }
.fs-liquid.error .fs-liquid-body,
.fs-liquid.error .fs-liquid-body::before,
.fs-liquid.error .fs-liquid-body::after   { background: #E5293A; }

.fs-liquid-body::before,
.fs-liquid-body::after {
  content: '';
  position: absolute;
  left: -10%; right: -10%;
  top: -38px;
  height: 80px;
  background: inherit;
  border-radius: 45% 45% 0 0;
  animation: liquid-wave 5s linear infinite;
}
.fs-liquid-body::after {
  top: -28px;
  opacity: 0.55;
  animation: liquid-wave 7s linear infinite reverse;
}
@keyframes liquid-wave {
  0%   { transform: translateX(0) scaleY(1); }
  50%  { transform: translateX(-6%) scaleY(0.9); }
  100% { transform: translateX(0) scaleY(1); }
}

.fs-liquid-bubbles { position: absolute; inset: 0; pointer-events: none; }
.fs-liquid-bubbles span {
  position: absolute;
  bottom: -40px;
  width: 18px; height: 18px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  animation: bubble-up 4s ease-in infinite;
}
.fs-liquid-bubbles span:nth-child(1) { left:10%; animation-delay:0.4s; width:12px; height:12px; }
.fs-liquid-bubbles span:nth-child(2) { left:25%; animation-delay:1.2s; width:24px; height:24px; }
.fs-liquid-bubbles span:nth-child(3) { left:40%; animation-delay:0.8s; width:10px; height:10px; }
.fs-liquid-bubbles span:nth-child(4) { left:55%; animation-delay:1.6s; width:18px; height:18px; }
.fs-liquid-bubbles span:nth-child(5) { left:70%; animation-delay:0.2s; width:14px; height:14px; }
.fs-liquid-bubbles span:nth-child(6) { left:85%; animation-delay:1.8s; width:20px; height:20px; }
@keyframes bubble-up {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  20%  { opacity: 0.8; }
  100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

.fs-liquid-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  color: #FFFFFF;
  padding: 32px;
  z-index: 2;
}
.fs-liquid-content .label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
}
.fs-liquid.success .fs-liquid-content .label,
.fs-liquid.error   .fs-liquid-content .label { color: rgba(255,255,255,0.85); }
.fs-liquid-content .h {
  font-size: 28px; font-weight: 300;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 12px;
  max-width: 540px;
}
.fs-liquid-content .s {
  font-size: 14px; color: rgba(255,255,255,0.7);
  max-width: 460px; line-height: 1.55;
}

.fs-liquid-icon {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  opacity: 0; transform: scale(0.5);
  transition: opacity 500ms ease-out 200ms, transform 600ms cubic-bezier(0.34,1.56,0.64,1) 200ms;
}
.fs-liquid.success .fs-liquid-icon,
.fs-liquid.error   .fs-liquid-icon { opacity: 1; transform: scale(1); }
.fs-liquid-icon svg { width: 56px; height: 56px; stroke: white; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }

.fs-liquid-spinner {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.22);
  border-top-color: #FFD400;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}
.fs-liquid.success .fs-liquid-spinner,
.fs-liquid.error   .fs-liquid-spinner { display: none; }

/* ═══════════════ PAGE TRANSITION ═══════════════ */
.page { display: none; animation: page-in 400ms cubic-bezier(0.16,1,0.3,1) both; }
.page.active { display: flex; flex-direction: column; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* slide questions */
.q-slide     { animation: q-slide-in 360ms cubic-bezier(0.16,1,0.3,1) both; }
.q-slide.exit{ animation: q-slide-out 220ms cubic-bezier(0.65,0,0.35,1) both; }
@keyframes q-slide-in  { from { opacity: 0; transform: translateX(36px); }  to { opacity: 1; transform: translateX(0); } }
@keyframes q-slide-out { from { opacity: 1; transform: translateX(0); }      to { opacity: 0; transform: translateX(-36px); } }

/* ═══════════════ COUNTER ═══════════════ */
@keyframes count-pop { 0%{transform:scale(1)} 50%{transform:scale(1.06)} 100%{transform:scale(1)} }
.counter-pop { animation: count-pop 320ms cubic-bezier(0.16,1,0.3,1); }

/* ═══════════════ GAUGE ═══════════════ */
.gauge .fill {
  stroke: #FFD400;
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1400ms cubic-bezier(0.65,0,0.35,1);
}

/* ═══════════════ TYPING DOTS ═══════════════ */
.typing-dots { display: inline-flex; align-items: center; gap: 4px; }
.typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.35; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ═══════════════ RIPPLE ═══════════════ */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transform: scale(0);
  animation: ripple 600ms ease-out;
  pointer-events: none;
}
.btn-amarelo .ripple   { background: rgba(43,43,43,0.18); }
.btn-secondary .ripple,
.btn-ghost .ripple     { background: rgba(124,24,124,0.18); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ═══════════════ SHIMMER ═══════════════ */
.shimmer {
  background: linear-gradient(90deg, #F6F6F6 0%, #ECECEC 50%, #F6F6F6 100%);
  background-size: 1000px 100%;
  animation: shimmer 1.8s linear infinite;
}

/* ═══════════════ HOVER LIFT ═══════════════ */
.lift { transition: transform 320ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 320ms cubic-bezier(0.16,1,0.3,1); }
.lift:hover { transform: translateY(-4px); }

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(43,43,43,0.16); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(43,43,43,0.32); }

/* ═══════════════ ICON SPIN ═══════════════ */
.mini-spin {
  width: 14px; height: 14px;
  border: 2px solid rgba(124,24,124,0.18);
  border-top-color: #7C187C;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ═══════════════ PULSE DOT ═══════════════ */
.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px; height: 8px;
  background: #1E6FFF;
  border-radius: 50%;
}
.pulse-dot::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3); opacity: 0; }
}

/* ═══════════════ INK BAR (tabs) ═══════════════ */
.tabs { display: flex; gap: 24px; position: relative; }
.tabs .tab {
  position: relative;
  padding: 12px 0;
  font-size: 14px; font-weight: 500;
  color: #2B2B2B; opacity: 0.5;
  cursor: pointer;
  transition: opacity 200ms ease-out, color 200ms ease-out;
}
.tabs .tab:hover { opacity: 0.8; }
.tabs .tab.active { opacity: 1; color: #7C187C; }
.tabs .tab::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: #7C187C;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 360ms cubic-bezier(0.34,1.56,0.64,1);
}
.tabs .tab.active::after { transform: scaleX(1); }

/* ═══════════════ REDUCED MOTION FALLBACK ═══════════════
   Se o browser desabilita animações, garante que tudo seja visível.
   Também serve como fallback para browsers que não suportam fill-mode.
   ═════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  /* garante visibilidade de elementos com opacity:0 */
  .stagger > *  { opacity: 1 !important; }
  .anim-fade,
  .anim-up,
  .anim-down,
  .anim-left,
  .anim-right,
  .anim-scale,
  .anim-pop     { opacity: 1 !important; transform: none !important; }
}
