/* =========================================================
   LOOPAYS — Sistema visual
   Identidad: "el dinero circula entre personas" → loops,
   órbitas, flujo continuo. Gradiente cyan → blue → purple.
   ========================================================= */

:root {
  --c-cyan: #18C7D7;
  --c-blue: #4F6FFF;
  --c-purple: #7C3AED;
  --c-ink: #08121F;
  --c-cloud: #F8FAFC;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--c-cloud);
  color: var(--c-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(79, 111, 255, .18); color: var(--c-ink); }

/* ---------------------------------------------------------
   Tipografía / texto
   --------------------------------------------------------- */
.text-gradient {
  background: linear-gradient(100deg, var(--c-cyan) 0%, var(--c-blue) 48%, var(--c-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   Fondos
   --------------------------------------------------------- */
.hero-mesh {
  background:
    radial-gradient(64rem 42rem at 88% -12%, rgba(124, 58, 237, .13), transparent 62%),
    radial-gradient(52rem 38rem at -12% 18%, rgba(24, 199, 215, .16), transparent 60%),
    radial-gradient(48rem 42rem at 52% 118%, rgba(79, 111, 255, .12), transparent 60%),
    var(--c-cloud);
}

.bg-grid-fade {
  background-image:
    linear-gradient(rgba(8, 18, 31, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 18, 31, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 30%, black 30%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 30%, black 30%, transparent 100%);
}

.bg-gradient-animated {
  background: linear-gradient(115deg, #18C7D7, #4F6FFF 30%, #7C3AED 55%, #4F6FFF 80%, #18C7D7);
  background-size: 280% 280%;
  animation: gradient-shift 14s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* Textura sutil de grano — evita el look "plano de template" */
.noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------
   Glassmorphism y profundidad
   --------------------------------------------------------- */
.glass {
  background: rgba(255, 255, 255, .74);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .7);
}

.glass-dark {
  background: rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .1);
}

.card-hover {
  transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .45s cubic-bezier(.22, .61, .36, 1);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 16px -6px rgba(8, 18, 31, .1), 0 32px 72px -20px rgba(79, 111, 255, .28);
}

/* Borde gradiente (tarjeta Community, score card) */
.gradient-border {
  position: relative;
  background: #fff;
  background-clip: padding-box;
  border: 1.5px solid transparent;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: -1.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--c-cyan), var(--c-blue), var(--c-purple));
}

/* ---------------------------------------------------------
   Navbar
   --------------------------------------------------------- */
#navbar {
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
#navbar.nav-scrolled {
  background: rgba(248, 250, 252, .82);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: rgba(8, 18, 31, .06);
  box-shadow: 0 8px 32px -16px rgba(8, 18, 31, .12);
}

.nav-link {
  position: relative;
  transition: color .25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}
.nav-link:hover { color: var(--c-ink); }
.nav-link:hover::after { transform: scaleX(1); }

/* ---------------------------------------------------------
   Botones
   --------------------------------------------------------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, var(--c-blue) 0%, var(--c-purple) 100%);
  box-shadow: 0 1px 2px rgba(8, 18, 31, .2), 0 12px 32px -10px rgba(79, 111, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .25s cubic-bezier(.22, .61, .36, 1), box-shadow .25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(8, 18, 31, .2), 0 20px 44px -10px rgba(124, 58, 237, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:active { transform: translateY(0) scale(.98); }

/* Destello que recorre el botón al hacer hover */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: left .6s cubic-bezier(.22, .61, .36, 1);
}
.btn-primary:hover::after { left: 130%; }

.btn-secondary {
  background: #fff;
  border: 1px solid rgba(8, 18, 31, .1);
  box-shadow: 0 1px 2px rgba(8, 18, 31, .06), 0 8px 24px -12px rgba(8, 18, 31, .12);
  transition: transform .25s cubic-bezier(.22, .61, .36, 1), box-shadow .25s ease, border-color .25s ease;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 111, 255, .35);
  box-shadow: 0 2px 4px rgba(8, 18, 31, .06), 0 14px 32px -12px rgba(79, 111, 255, .3);
}

/* ---------------------------------------------------------
   Animaciones flotantes / órbita
   --------------------------------------------------------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.animate-float       { animation: float 7s ease-in-out infinite; }
.animate-float-slow  { animation: float 9s ease-in-out 1.4s infinite; }
.animate-float-fast  { animation: float 6s ease-in-out .6s infinite; }

@keyframes spin-slow { to { transform: rotate(360deg); } }
.animate-orbit {
  animation: spin-slow 46s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.6); opacity: .55; }
}
.pulse-dot { animation: pulse-dot 2.4s ease-in-out infinite; }

/* ---------------------------------------------------------
   Scroll reveal
   --------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity .9s cubic-bezier(.22, .61, .36, 1),
    transform .9s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal="scale"] { transform: scale(.94); }
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* Líneas de gráficos que se dibujan al entrar en viewport */
.chart-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 2.2s cubic-bezier(.22, .61, .36, 1) .35s;
}
.is-revealed .chart-line, .is-revealed.chart-host .chart-line { stroke-dashoffset: 0; }

.chart-area {
  opacity: 0;
  transition: opacity 1.4s ease 1.1s;
}
.is-revealed .chart-area { opacity: 1; }

.bar {
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .9s cubic-bezier(.22, .61, .36, 1);
}
.is-revealed .bar { transform: scaleY(1); }

/* Anillo de score que se completa */
.score-ring-fg {
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  transition: stroke-dashoffset 1.8s cubic-bezier(.22, .61, .36, 1) .4s;
}
.is-revealed .score-ring-fg { stroke-dashoffset: 11.6; } /* 96 de 100 */

/* ---------------------------------------------------------
   Marquee de países
   --------------------------------------------------------- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------
   Timeline "Cómo funciona"
   --------------------------------------------------------- */
.timeline-line {
  background: linear-gradient(180deg, rgba(24, 199, 215, 0), var(--c-cyan) 12%, var(--c-blue) 50%, var(--c-purple) 88%, rgba(124, 58, 237, 0));
}

.step-node {
  background: #fff;
  border: 1.5px solid rgba(79, 111, 255, .25);
  box-shadow: 0 0 0 6px var(--c-cloud), 0 8px 20px -8px rgba(79, 111, 255, .4);
}

/* ---------------------------------------------------------
   FAQ accordion
   --------------------------------------------------------- */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.22, .61, .36, 1);
}
.faq-panel > div { overflow: hidden; }
.faq-item.open .faq-panel { grid-template-rows: 1fr; }

.faq-icon { transition: transform .35s cubic-bezier(.22, .61, .36, 1), background .3s, color .3s; }
.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--c-blue), var(--c-purple));
  color: #fff;
  border-color: transparent;
}

/* ---------------------------------------------------------
   Detalles
   --------------------------------------------------------- */
.tick { stroke-dasharray: 24; stroke-dashoffset: 24; }
.is-revealed .tick { animation: draw-tick .6s ease forwards .6s; }
@keyframes draw-tick { to { stroke-dashoffset: 0; } }

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar discreto (WebKit) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(8, 18, 31, .18); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------
   Accesibilidad — movimiento reducido
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}
