/* ==========================================================================
   Az InnovationX - Portal de Pagos Corporativo 3D (2026)
   Estilos dedicados: Partículas Three.js, Cards con 3D Tilt y Glare,
   Sello de Seguridad Fintech, FAQ Accordion y Notificación Flotante
   ========================================================================== */

:root {
  --pay-bg: #05050a;
  --pay-surface: #0b0c16;
  --pay-card-bg: rgba(13, 14, 28, 0.55);
  --pay-text-main: #f1f5f9;
  --pay-text-muted: #94a3b8;
  --pay-text-dim: rgba(255, 255, 255, 0.45);
  --pay-accent-purple: #6366f1;
  --pay-accent-cyan: #06b6d4;
  --pay-accent-gradient: linear-gradient(135deg, var(--pay-accent-purple), var(--pay-accent-cyan));
  --pay-border: rgba(255, 255, 255, 0.08);
  --pay-border-active: rgba(6, 182, 212, 0.5);
  --pay-hover-glow: 0 0 32px rgba(6, 182, 212, 0.28);
  --pay-neon-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
  --pay-trans: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Blindaje contra transforms residuales y desbordamiento horizontal */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  transform: none !important;
  animation: none !important;
}

main {
  overflow-x: clip;
  width: 100%;
}

/* ==========================================
   1. FONDO INMERSIVO 3D Y EFECTOS AMBIENTALES
   ========================================== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.bg-grid-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  pointer-events: none;
  opacity: 0.8;
}

.ambient-glow {
  position: absolute;
  width: 440px;
  height: 440px;
  max-width: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  filter: blur(85px);
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* ==========================================
   2. HERO SECTION DEL PORTAL DE PAGOS
   ========================================== */
.pay-hero {
  position: relative;
  padding: 5.5rem 0 3rem;
  text-align: center;
  overflow: hidden;
}

.hero-logo-container {
  max-width: 180px;
  margin: 0 auto 26px auto;
  position: relative;
  transform-style: preserve-3d;
  perspective: 800px;
}

.hero-logo-img {
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 12, 22, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55), 0 0 30px rgba(99, 102, 241, 0.25);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s, box-shadow 0.3s;
  transform: rotateX(10deg);
}

.hero-logo-container:hover .hero-logo-img {
  transform: translateY(-8px) rotateX(0deg) rotateY(5deg) scale(1.05);
  border-color: var(--pay-accent-cyan);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), var(--pay-hover-glow);
}

.cyber-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 22px;
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.25);
  animation: payPulseGlow 2.5s infinite alternate;
}

.cyber-badge span.blink {
  width: 7px;
  height: 7px;
  background-color: var(--pay-accent-cyan);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--pay-accent-cyan);
  animation: payBlinker 1s linear infinite;
}

@keyframes payPulseGlow {
  0% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.2), inset 0 0 8px rgba(99, 102, 241, 0.15); }
  100% { box-shadow: 0 0 24px rgba(99, 102, 241, 0.45), inset 0 0 14px rgba(99, 102, 241, 0.3); }
}

@keyframes payBlinker {
  50% { opacity: 0.3; }
}

h1.pay-hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: -1px;
  line-height: 1.15;
  background: var(--pay-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

.pay-hero-subtitle {
  font-size: 1.15rem;
  color: var(--pay-text-muted);
  max-width: 760px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.75;
}

/* Trust Badges en Hero */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 32px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 8px 18px;
  border-radius: 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--pay-trans);
  font-size: 0.88rem;
  color: var(--pay-text-main);
}

.trust-badge:hover {
  border-color: rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.18);
}

.trust-badge i {
  color: var(--pay-accent-cyan);
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.55));
}

/* ==========================================
   3. PAYMENT CARDS GRID (3D TILT & GLARE)
   ========================================== */
.payment-main-section {
  padding: 40px 0 60px;
  position: relative;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px;
  perspective: 1000px;
  margin-bottom: 70px;
  align-items: stretch;
}

.payment-card-container {
  display: block;
  transform-origin: center;
}

.payment-card {
  background: var(--pay-card-bg);
  border: 1px solid var(--pay-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: 24px;
  padding: 46px 36px;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-depth-1 { transform: translateZ(20px); }
.card-depth-2 { transform: translateZ(40px); }
.card-depth-3 { transform: translateZ(55px); }

.payment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background 0.3s ease;
}

.payment-card.primary::before {
  background: linear-gradient(135deg, var(--pay-accent-purple), var(--pay-accent-cyan));
}

.payment-card.secondary::before {
  background: linear-gradient(135deg, var(--pay-accent-cyan), #d8315b);
}

.payment-card:hover {
  border-color: var(--pay-border-active);
  box-shadow: var(--pay-hover-glow);
}

.glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  border-radius: 24px;
  transition: background 0.1s;
}

.payment-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.payment-icon-wrapper {
  width: 60px;
  height: 60px;
  background: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.payment-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--pay-text-main);
  letter-spacing: -0.01em;
}

.payment-description {
  color: var(--pay-text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 26px;
  font-weight: 300;
}

.payment-description strong {
  color: #ffffff;
  font-weight: 600;
}

.payment-brands-img {
  width: 100%;
  max-width: 330px;
  margin: 20px auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--pay-border);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
}

/* ============================================================
   BOTONES DE PAGO — Anclas nativas <a> para apertura infalible
   ============================================================ */
.pay-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 17px;
  border-radius: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

.pay-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}

.pay-btn:hover::after {
  left: 140%;
}

.pay-btn-primary {
  background: var(--pay-accent-gradient);
  color: #05050a !important;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.pay-btn-primary:hover {
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.65);
  transform: translateY(-3px) scale(1.02);
  color: #000000 !important;
}

.pay-btn-accent {
  background: linear-gradient(135deg, var(--pay-accent-cyan), #d8315b);
  color: #ffffff !important;
  box-shadow: 0 8px 25px rgba(216, 49, 91, 0.35);
}

.pay-btn-accent:hover {
  box-shadow: 0 12px 32px rgba(216, 49, 91, 0.65);
  transform: translateY(-3px) scale(1.02);
  color: #ffffff !important;
}

.btn-slogan {
  text-align: center;
  margin-top: 15px;
  color: var(--pay-accent-cyan);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-slogan i {
  font-size: 1.05rem;
}

/* ==========================================
   4. SECCIÓN DE SEGURIDAD Y CONFIANZA
   ========================================== */
.security-section {
  padding: 60px 0;
  border-top: 1px solid var(--pay-border);
}

.section-header {
  text-align: center;
  margin-bottom: 45px;
}

.section-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.35rem;
  font-weight: 700;
  color: var(--pay-text-main);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-header h2 span {
  background: var(--pay-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.trust-card {
  background: rgba(11, 12, 22, 0.45);
  border: 1px solid var(--pay-border);
  border-radius: 20px;
  padding: 35px 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  transition: var(--pay-trans);
}

.trust-card:hover {
  transform: translateY(-8px);
  border-color: var(--pay-border-active);
  box-shadow: var(--pay-hover-glow);
}

.trust-card-icon {
  font-size: 2.7rem;
  margin-bottom: 18px;
  background: var(--pay-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.45));
}

.trust-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  color: var(--pay-text-main);
  margin-bottom: 10px;
  font-weight: 600;
}

.trust-card p {
  color: var(--pay-text-muted);
  font-size: 0.94rem;
  line-height: 1.65;
  font-weight: 300;
}

/* ==========================================
   5. SECCIÓN DE PREGUNTAS FRECUENTES (FAQ)
   ========================================== */
.faq-section {
  padding: 60px 0 80px;
  border-top: 1px solid var(--pay-border);
}

.faq-grid {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.faq-item {
  background: rgba(11, 12, 22, 0.38);
  border: 1px solid var(--pay-border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--pay-trans);
}

.faq-question {
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.faq-question h3 {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--pay-text-main);
  transition: color 0.3s;
  margin: 0;
}

.faq-item:hover .faq-question h3 {
  color: var(--pay-accent-cyan);
}

.faq-toggle-icon {
  font-size: 1.15rem;
  color: var(--pay-text-muted);
  transition: transform 0.3s ease, color 0.3s;
}

.faq-item.active {
  border-color: var(--pay-border-active);
  background: rgba(11, 12, 22, 0.65);
}

.faq-item.active .faq-toggle-icon {
  transform: rotate(45deg);
  color: var(--pay-accent-cyan);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}

.faq-answer p {
  padding: 0 28px 22px 28px;
  color: var(--pay-text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
  font-weight: 300;
  margin: 0;
}

/* ==========================================
   6. NOTIFICACIÓN TOAST FLOTANTE
   ========================================== */
.pay-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(11, 12, 22, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--pay-text-main);
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  border-left: 4px solid var(--pay-accent-cyan);
  transform: translateX(130%);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 10000;
  max-width: 340px;
}

.pay-notification.show {
  transform: translateX(0);
}

.notification-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--pay-accent-cyan);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--pay-text-muted);
  transition: color 0.3s;
}

.notification-close:hover {
  color: #ffffff;
}

/* ==========================================
   7. RESPONSIVE Y PROTECCIÓN MÓVIL
   ========================================== */
@media (max-width: 992px) {
  .payment-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  h1.pay-hero-title {
    font-size: 2.6rem;
  }
}

@media (max-width: 768px) {
  .ambient-glow {
    width: 220px;
    height: 220px;
    filter: blur(55px);
    max-width: 85vw;
  }

  .pay-hero {
    padding: 4.8rem 1rem 2.2rem;
  }

  .hero-logo-container {
    max-width: 140px;
    margin-bottom: 20px;
  }

  h1.pay-hero-title {
    font-size: clamp(1.8rem, 6.8vw, 2.3rem);
    line-height: 1.25;
    margin-bottom: 0.85rem;
  }

  .pay-hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 100%;
  }

  .trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin: 20px auto 0;
  }

  .trust-badge {
    padding: 8px 10px;
    font-size: 0.78rem;
    justify-content: center;
    white-space: nowrap;
  }

  .payment-main-section {
    padding: 20px 0 50px;
  }

  /* Blindaje total contra bloqueos táctiles en móvil */
  .payment-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    perspective: none !important;
  }

  .payment-card-container {
    transform: none !important;
  }

  .payment-card { 
    transform: none !important; 
    transform-style: flat !important;
    perspective: none !important;
    padding: 26px 18px;
    border-radius: 20px;
  }

  .card-depth-1, .card-depth-2, .card-depth-3 { 
    transform: none !important; 
    transform-style: flat !important;
  }

  .glare {
    display: none !important;
  }

  .icon-box {
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .payment-title {
    font-size: 1.35rem;
    margin-bottom: 10px;
  }

  .payment-description {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .payment-brands-img {
    max-width: 250px;
    width: 100%;
    height: auto;
    margin: 16px auto;
  }

  .pay-btn {
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    min-height: 50px;
    font-size: 1rem;
    padding: 14px 18px;
    border-radius: 14px;
    justify-content: center;
    width: 100%;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .trust-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .faq-accordion {
    gap: 10px;
  }

  .faq-item {
    border-radius: 16px;
  }

  .faq-question {
    padding: 16px 14px;
    font-size: 0.95rem;
  }

  .faq-answer p {
    padding: 0 14px 16px;
    font-size: 0.9rem;
  }

  .pay-notification {
    bottom: max(20px, env(safe-area-inset-bottom));
    right: 18px;
    left: 18px;
    max-width: none;
    width: calc(100% - 36px);
  }
}
