/* ==========================================================================
   Cómo funciona – Página rediseñada con hero, glass, partículas, pasos
   ========================================================================== */

body.page-como-funciona .section {
  min-height: auto !important;
}

body.page-como-funciona main {
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Hero – Partículas, mesh gradient, orbes luminosos, vidrio con desenfoque
   -------------------------------------------------------------------------- */

.cf-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-total, 120px) + var(--space-2xl)) var(--space-md) var(--space-2xl);
  overflow: hidden;
  background: linear-gradient(155deg, #050c14 0%, #0a1520 25%, #0E2D50 50%, #0d1f33 75%, #061018 100%);
}

/* Grid blockchain / circuit */
.cf-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(98, 126, 234, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 126, 234, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: cf-grid-move 20s linear infinite;
  z-index: 0;
}

@keyframes cf-grid-move {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Scanline sutil */
.cf-hero__scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 4;
}

/* Badges */
.cf-hero__badges {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-sm);
  z-index: 5;
}

.cf-hero__badge {
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 6px;
  backdrop-filter: blur(8px);
}

.cf-hero__badge--audit {
  background: rgba(14, 45, 80, 0.4);
  color: #93b8e8;
  border: 1px solid rgba(98, 126, 234, 0.4);
}

.cf-hero__badge--custody {
  background: rgba(98, 126, 234, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(98, 126, 234, 0.4);
}

.cf-hero__badge--chain {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mesh gradient animado de fondo */
.cf-hero__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 20% 30%, rgba(98, 126, 234, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 80% 100% at 80% 70%, rgba(14, 45, 80, 0.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
  animation: cf-mesh-shift 12s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes cf-mesh-shift {
  0% { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0.9; transform: scale(1.05) rotate(1deg); }
}

/* Orbes luminosos flotantes */
.cf-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: 0;
}

.cf-hero__glow--1 {
  width: 400px;
  height: 400px;
  background: rgba(98, 126, 234, 0.3);
  top: -10%;
  left: -5%;
  animation: cf-glow-float 8s ease-in-out infinite;
}

.cf-hero__glow--2 {
  width: 300px;
  height: 300px;
  background: rgba(14, 45, 80, 0.5);
  bottom: -5%;
  right: -5%;
  animation: cf-glow-float 10s ease-in-out infinite 2s;
}

.cf-hero__glow--3 {
  width: 200px;
  height: 200px;
  background: rgba(59, 130, 246, 0.25);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: cf-glow-pulse 6s ease-in-out infinite 1s;
}


@keyframes cf-glow-float {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50% { transform: translate(30px, -20px); opacity: 0.6; }
}

@keyframes cf-glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.35; }
}

.cf-hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 21, 32, 0.5) 0%, transparent 35%, transparent 65%, rgba(10, 21, 32, 0.6) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Partículas flotantes */
.cf-hero__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.cf-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
  animation: cf-particle-float 8s ease-in-out infinite;
}

.cf-particle--1 { width: 6px; height: 6px; left: 10%; top: 15%; animation-delay: 0s; }
.cf-particle--2 { width: 4px; height: 4px; left: 85%; top: 25%; animation-delay: 1s; }
.cf-particle--3 { width: 8px; height: 8px; left: 20%; top: 60%; animation-delay: 2s; }
.cf-particle--4 { width: 5px; height: 5px; left: 75%; top: 45%; animation-delay: 0.5s; }
.cf-particle--5 { width: 3px; height: 3px; left: 50%; top: 20%; animation-delay: 3s; }
.cf-particle--6 { width: 7px; height: 7px; left: 5%; top: 70%; animation-delay: 1.5s; }
.cf-particle--7 { width: 4px; height: 4px; left: 90%; top: 55%; animation-delay: 2.5s; }
.cf-particle--8 { width: 6px; height: 6px; left: 35%; top: 85%; animation-delay: 0.8s; }
.cf-particle--9 { width: 5px; height: 5px; left: 65%; top: 10%; animation-delay: 2.2s; }
.cf-particle--10 { width: 4px; height: 4px; left: 45%; top: 75%; animation-delay: 1.2s; }

@keyframes cf-particle-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  25% { transform: translate(8px, -12px) scale(1.1); opacity: 1; }
  50% { transform: translate(-6px, -8px) scale(0.95); opacity: 0.8; }
  75% { transform: translate(10px, 6px) scale(1.05); opacity: 1; }
}

/* Monedas ETH/USDC flotantes */
.cf-hero__coin {
  position: absolute;
  animation: cf-coin-float 5s ease-in-out infinite;
}

.cf-hero__coin img {
  display: block;
  filter: drop-shadow(0 0 24px rgba(98, 126, 234, 0.4)) drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
  opacity: 0.85;
}

.cf-hero__coin--1 { left: 5%; top: 15%; animation-delay: 0s; }
.cf-hero__coin--2 { right: 8%; top: 18%; animation-delay: 1.2s; }
.cf-hero__coin--3 { left: 3%; bottom: 20%; animation-delay: 2.4s; }
.cf-hero__coin--4 { right: 6%; bottom: 25%; animation-delay: 0.8s; }
.cf-hero__coin--5 { left: 15%; top: 45%; animation-delay: 1.8s; }
.cf-hero__coin--6 { right: 18%; top: 50%; animation-delay: 0.4s; }

.cf-hero__coin--7 { left: 22%; top: 8%; animation-delay: 0.6s; }
.cf-hero__coin--8 { right: 25%; top: 12%; animation-delay: 2s; }
.cf-hero__coin--9 { left: 12%; bottom: 35%; animation-delay: 1.4s; }
.cf-hero__coin--10 { right: 14%; bottom: 40%; animation-delay: 0.3s; }

@keyframes cf-coin-float {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.8; }
  50% { transform: translateY(-28px) rotate(8deg) scale(1.08); opacity: 1; }
}

/* Preview de pasos 1-2-3-4 */
.cf-hero__steps-preview {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 2;
}

.cf-hero__step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: cf-step-pulse 2s ease-in-out infinite;
}

.cf-hero__step-num:nth-child(1) { animation-delay: 0s; }
.cf-hero__step-num:nth-child(3) { animation-delay: 0.2s; }
.cf-hero__step-num:nth-child(5) { animation-delay: 0.4s; }
.cf-hero__step-num:nth-child(7) { animation-delay: 0.6s; }

.cf-hero__step-line {
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  border-radius: 1px;
}

@keyframes cf-step-pulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Card central tipo vidrio */
.cf-hero__glass {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: min(96%, 1100px);
}

.cf-hero__glass--center {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  padding: var(--space-2xl) var(--space-xl);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 100px rgba(98, 126, 234, 0.12);
  animation: cf-glass-glow 4s ease-in-out infinite alternate;
}

@keyframes cf-glass-glow {
  0% { box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 0 100px rgba(98, 126, 234, 0.1); }
  100% { box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 120px rgba(98, 126, 234, 0.18); }
}

.cf-hero__tagline {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #93b8e8;
  margin: 0 0 var(--space-sm);
}

.cf-hero__title {
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 var(--space-md);
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.cf-hero__lead {
  font-size: 1.2rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--space-xl);
}

.cf-hero__cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.cf-hero__cta {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cf-hero__cta--primary {
  background: #fff !important;
  color: #0E2D50 !important;
  border: none !important;
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.25);
}

.cf-hero__cta--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.35);
  background: #f5f7fa !important;
  color: #0a1f3a !important;
}

.cf-hero__cta--outline {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

.cf-hero__cta--outline:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  transform: translateY(-2px);
}

/* Franja ticker entre hero y video – estilo crypto pro */
.cf-ticker {
  position: relative;
  background: #000;
  overflow: hidden;
}

.cf-ticker__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.cf-ticker__track {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem 2rem;
  white-space: nowrap;
  animation: cf-ticker-scroll 30s linear infinite;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
}

.cf-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cf-ticker__item img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cf-ticker__sep {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
}

.cf-ticker__change {
  color: rgba(255, 255, 255, 0.9);
  margin-left: 0.25rem;
}

@media (min-width: 768px) {
  .cf-ticker__track {
    padding: 1.25rem 2rem;
    font-size: 1rem;
  }

  .cf-ticker__item img {
    width: 28px;
    height: 28px;
  }
}

@keyframes cf-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   Video explicativo – título izquierda, video derecha, impactante
   -------------------------------------------------------------------------- */

.cf-video {
  position: relative;
  padding: var(--space-2xl) var(--space-md);
  overflow: visible;
}

.cf-video__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 30%, #f0f2f8 70%, #eef1f9 100%);
  z-index: 0;
}

.cf-video__particles {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(14, 45, 80, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.cf-video__inner {
  position: relative;
  z-index: 1;
  max-width: min(96%, 1200px);
  margin: 0 auto;
}

.cf-video__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 900px) {
  .cf-video__grid {
    grid-template-columns: 1fr 1.15fr;
    gap: var(--space-2xl);
  }
}

.cf-video__text {
  order: 1;
}

@media (min-width: 900px) {
  .cf-video__text {
    order: 0;
  }
}

.cf-video__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(14, 45, 80, 0.5);
  margin: 0 0 var(--space-sm);
}

.cf-video__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: #0E2D50;
  text-align: left;
  margin: 0 0 var(--space-md);
  line-height: 1.35;
}

.cf-video__lead {
  font-size: 1.1rem;
  color: #3d4f5f;
  text-align: left;
  margin: 0 0 var(--space-xl);
  line-height: 1.6;
}

.cf-video__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0E2D50;
  background: rgba(14, 45, 80, 0.08);
  border: 1px solid rgba(14, 45, 80, 0.3);
  border-radius: 12px;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.cf-video__cta:hover {
  background: rgba(14, 45, 80, 0.15);
  border-color: rgba(14, 45, 80, 0.5);
  transform: translateX(4px);
}

.cf-video__media {
  position: relative;
  order: 0;
}

@media (min-width: 900px) {
  .cf-video__media {
    order: 1;
  }
}

.cf-video__frame {
  position: relative;
  border-radius: 20px;
  overflow: visible;
}

.cf-video__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow:
    0 24px 64px rgba(14, 45, 80, 0.15),
    0 0 0 1px rgba(14, 45, 80, 0.08);
  z-index: -2;
  pointer-events: none;
}

.cf-video__frame-inner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.cf-video__glow {
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(98, 126, 234, 0.1), rgba(14, 45, 80, 0.08));
  filter: blur(20px);
  opacity: 0.6;
  z-index: -1;
}

.cf-video__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(14, 45, 80, 0.12);
  pointer-events: none;
  z-index: 1;
}

.cf-video__player {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 20px;
}

/* --------------------------------------------------------------------------
   Pasos – Grid con cards glassmorphism
   -------------------------------------------------------------------------- */

.cf-steps {
  position: relative;
  padding: var(--space-2xl) var(--space-md);
  overflow: hidden;
}

.cf-steps__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #050c14 0%, #0a1520 25%, #0E2D50 55%, #0d1f33 85%, #061018 100%);
  z-index: 0;
}

.cf-steps .container {
  position: relative;
  z-index: 1;
  max-width: min(94%, 1100px);
  margin: 0 auto;
}

.cf-steps__heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0 0 var(--space-2xl);
}

.cf-steps__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .cf-steps__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Step card – glassmorphism */
.cf-step {
  position: relative;
  padding: var(--space-xl);
  border-radius: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cf-step--glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.cf-step:hover,
.cf-step.is-expanded {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.cf-step__num {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.cf-step__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 var(--space-sm);
}

.cf-step__desc {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 var(--space-md);
}

.cf-step__expand {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #93b8e8;
  cursor: pointer;
  padding: 0;
  margin: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cf-step__expand:hover {
  color: #b8d4f0;
}

.cf-step__expand[aria-expanded="true"] {
  text-decoration: none;
}

.cf-step__expand[aria-expanded="true"]::after {
  content: " ↑";
}

.cf-step__detail {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cf-step__detail[hidden] {
  display: none !important;
}

.cf-step__detail p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.cf-step__detail strong {
  color: #fff;
}

/* CTA final de pasos */
.cf-steps__cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-2xl);
}

.cf-steps__cta {
  min-width: 200px;
}

/* Botones en fondo oscuro: primary blanco, outline claro */
.cf-steps .btn--primary {
  background: #fff !important;
  color: #0E2D50 !important;
  border-color: #fff !important;
}

.cf-steps .btn--primary:hover {
  background: #f5f7fa !important;
  color: #0a1f3a !important;
}

.cf-steps .btn--outline {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

.cf-steps .btn--outline:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  color: #fff !important;
}

/* Reveal animation (GSAP o CSS) */
.cf-reveal {
  opacity: 1;
}

@media (max-width: 768px) {
  .cf-hero__badges {
    top: 50px;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xs);
  }

  .cf-hero__badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
  }

  .cf-hero__cta-wrap {
    flex-direction: column;
  }

  .cf-hero__cta {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .cf-ticker__track {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .cf-hero__steps-preview {
    bottom: 8%;
    gap: var(--space-xs);
  }

  .cf-hero__step-num {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .cf-hero__step-line {
    width: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf-particle,
  .cf-hero__coin,
  .cf-hero__glow,
  .cf-hero__mesh,
  .cf-hero__glass--center,
  .cf-hero__step-num,
  .cf-hero__grid,
  .cf-ticker__track {
    animation: none !important;
  }
}
