/* =========================================
   GRILLA Y ESTRUCTURA BASE
   ========================================= */
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 1.5rem;
  align-items: center;
  font-family: 'Poppins', sans-serif !important; /* <--- CAMBIADO A POPPINS */
}

.content-panel,
.visual-panel {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 2.5rem;
}

.content-panel {
  background: linear-gradient(180deg, rgba(12, 19, 31, 0.4), rgba(6, 10, 18, 0.3));
}

.visual-panel {
  min-height: 580px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(12, 19, 31, 1) 0%, rgba(6, 10, 18, 1) 100%);
}

/* Luces de fondo */
.content-panel::before,
.visual-panel::before {
  content: "";
  position: absolute;
  inset: auto auto -35% -15%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(48, 213, 255, 0.2), transparent 70%);
  pointer-events: none;
}

/* =========================================
   TEXTOS PANEL IZQUIERDO
   ========================================= */
.panel-intro h2 {
  font-family: 'Poppins', sans-serif !important; /* <--- CAMBIADO A POPPINS */
  font-size: 1.5rem;
  color: #ecf4ff;
  margin-bottom: 1rem;
}

.icon-list { margin-top: 1.5rem; display: grid; gap: 1rem; }

.icon-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-box {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(89, 124, 255, 0.2), rgba(48, 213, 255, 0.1));
  display: grid; place-items: center;
}

.icon-copy { color: #a4b1c8; font-size: 0.95rem; line-height: 1.6; }

/* =========================================
   1. GRILLA Y ESTRUCTURA BASE (Regcheq Premium)
   ========================================= */
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 1.5rem;
  align-items: center;
  font-family: "IBM Plex Sans", sans-serif;
}

/* Efecto Glassmorphism Unificado */
.content-panel,
.visual-panel {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 2.5rem;
  background: linear-gradient(180deg, rgba(12, 19, 31, 0.4), rgba(6, 10, 18, 0.3));
}

/* Destello de luz IA de fondo */
.content-panel::before,
.visual-panel::before {
  content: "";
  position: absolute;
  inset: auto auto -35% -15%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(48, 213, 255, 0.15), transparent 70%);
  pointer-events: none;
}

/* =========================================
   2. TEXTOS PANEL IZQUIERDO (Desde HubSpot)
   ========================================= */
.panel-intro h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  color: #ecf4ff;
  margin-bottom: 1rem;
}

.icon-list { margin-top: 1.5rem; display: grid; gap: 1rem; }

.icon-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-box {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(89, 124, 255, 0.15), rgba(48, 213, 255, 0.08));
  display: grid; place-items: center;
}

.icon-copy { color: #a4b1c8; font-size: 0.95rem; line-height: 1.6; }


/* =========================================
   3. ANIMACIÓN CARPETA TRIBUTARIA
   ========================================= */
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(600px, 1.05fr); /* Un poco más de ancho */
  gap: 1.5rem;
  align-items: stretch; /* FORZA ALTO IGUAL EN AMBAS TARJETAS */
}

/* Aplicamos flex a las tarjetas para que el contenido respire */
.content-panel,
.visual-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem !important; /* Más aire en los bordes */
}

/* Solo se anima cuando el contenedor tiene la clase .reveal */
.visual-panel.reveal .ai-static-sequence {
  opacity: 1;
  width: 100%;
  max-width: 100%; /* RECTÁNGULOS MÁS LARGOS */
  margin: 0 auto;
}

/* --- 1. DOCUMENTO --- */
.viz-document-fly {
  position: absolute; width: 80px; left: 40%; top: -30px; z-index: 10; opacity: 0;
}
.visual-panel.reveal .viz-document-fly {
  animation: docFlyOnce 1.5s ease-in forwards;
}
@keyframes docFlyOnce {
  0% { top: -40px; opacity: 0; }
  20% { opacity: 1; }
  100% { top: 60px; opacity: 0; transform: scale(0.2); }
}

/* =========================================
   CSS DEL BOTÓN SINCRONIZADO CON LA ÚLTIMA FILA
   ========================================= */

.upload-btn-dynamic {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  height: 60px;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  transition: all 0.5s ease;
}

.btn-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  opacity: 0;
}

/* --- PUNTO AZUL --- */
.viz-thinking-dot.mini {
  width: 10px;
  height: 10px;
  background: #30d5ff;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px rgba(48, 213, 255, 0.8);
  animation: pulseMini 1s infinite ease-in-out;
}

@keyframes pulseMini {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* --- LOGICA DE TIEMPOS (Sincronizada con Step 5) --- */

/* 1. Desaparece "Subir" (al iniciar el vuelo del doc) */
.visual-panel.reveal .state-upload { 
  animation: fadeOut 0.3s forwards; 
  animation-delay: 1.5s; 
  opacity: 1; 
}

/* 2. "Analizando" vive mientras aparecen las primeras 4 filas */
.visual-panel.reveal .state-analyzing { 
  animation: fadeInOutBtn 5.5s forwards; 
  animation-delay: 1.5s; 
}

/* 3. "Listo" aparece justo con la fila 5 (alrededor de los 7s) */
.visual-panel.reveal .state-ready { 
  animation: fadeInReady 0.5s forwards, titileoFuerte 1.5s infinite ease-in-out; 
  animation-delay: 7s, 7.5s; 
}

/* --- CAMBIO DE COLOR ESTRUCTURAL --- */
.visual-panel.reveal .upload-btn-dynamic { 
  animation: colorTimeline 6.8s forwards; /* Duración total hasta el verde */
  animation-delay: 1.5s; 
}

@keyframes colorTimeline {
  0% { 
    background: rgba(255, 255, 255, 0.05); 
    border-color: rgba(255, 255, 255, 0.1); 
  }
  /* Se mantiene AZUL durante casi toda la animación de las filas */
  5%, 85% { 
    background: rgba(48, 213, 255, 0.15); 
    border-color: rgba(48, 213, 255, 0.4); 
    box-shadow: 0 0 20px rgba(48, 213, 255, 0.1);
  }
  /* Cambia a VERDE al llegar al 100% (segundo 7 de la animación) */
  100% { 
    background: rgba(41, 216, 143, 0.25); 
    border-color: rgba(41, 216, 143, 0.6); 
    box-shadow: 0 0 30px rgba(41, 216, 143, 0.4); 
  }
}

/* Keyframes de apoyo */
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeInOutBtn { 0% { opacity: 0; } 10%, 95% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fadeInReady { to { opacity: 1; } }

@keyframes titileoFuerte {
  0%, 100% { transform: scale(1); filter: brightness(1.2); }
  50% { transform: scale(1.03); filter: brightness(1.5); box-shadow: 0 0 40px rgba(41, 216, 143, 0.6); }
}

/* --- 3. FILAS Y CASCADA --- */
.viz-row {
  width: 100% !important;
  min-width: 0; /* <--- Esto asegura que nunca sean más cortos que esto */
  background: rgba(255, 255, 255, 0.04); 
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; 
  padding: 1rem 2rem; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 12px;
  opacity: 0; 
  transform: translateY(10px);
}

.viz-label { font-size: 1.05rem; } /* Texto de observación más grande */

.visual-panel.reveal .viz-row { animation: rowInStatic 0.5s forwards; }

@keyframes rowInStatic { to { opacity: 1; transform: translateY(0); } }

/* Delays de aparición de filas */
.step-1 { animation-delay: 2.0s !important; }
.step-2 { animation-delay: 3.0s !important; }
.step-3 { animation-delay: 4.0s !important; }
.step-4 { animation-delay: 5.0s !important; }
.step-5 { animation-delay: 6.0s !important; }

/* --- 4. ICONOS (Thinking -> Check) --- */
.status-slot { width: 30px; height: 30px; position: relative; display: flex; align-items: center; justify-content: center; } /* Más grande */
.viz-thinking-dot { width: 12px; height: 12px; background: #30d5ff; border-radius: 50%; position: absolute; animation: pulse 0.8s infinite; }
.viz-icon { width: 26px; height: 26px; opacity: 0; position: absolute; } /* Iconos más grandes */

/* Animación de cambio de punto a icono */
.visual-panel.reveal .viz-thinking-dot { animation: pulse 0.8s infinite, fadeOut 0.3s forwards; }
.visual-panel.reveal .viz-icon { animation: fadeInStatic 0.3s forwards; }

@keyframes fadeInStatic { to { opacity: 1; } }

/* Delays para los iconos */
.step-1 .viz-thinking-dot, .step-1 .viz-icon { animation-delay: 2.0s, 2.8s; }
.step-2 .viz-thinking-dot, .step-2 .viz-icon { animation-delay: 3.0s, 3.8s; }
.step-3 .viz-thinking-dot, .step-3 .viz-icon { animation-delay: 4.0s, 4.8s; }
.step-4 .viz-thinking-dot, .step-4 .viz-icon { animation-delay: 5.0s, 5.8s; }
.step-5 .viz-thinking-dot, .step-5 .viz-icon { animation-delay: 6.0s, 6.8s; }

@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.4); opacity: 1; } }

/* Estilo advertencia */
.warning-active { background: rgba(255, 184, 0, 0.08) !important; border-color: rgba(255, 184, 0, 0.3) !important; }
.warning-active .viz-thinking-dot { background: #ffb800; }

/* =========================================
   4. RESPONSIVO
   ========================================= */
@media (max-width: 991px) {
  .split-section {
    grid-template-columns: 1fr !important; /* Pone una columna debajo de la otra */
    gap: 2rem;
  }
  
  .content-panel,
  .visual-panel {
    padding: 2rem !important; /* Reduce el relleno para ganar espacio */
    overflow-wrap: break-word; /* ¡AQUÍ ESTÁ LA MAGIA! Evita que las palabras largas se salgan de la caja */
    word-break: break-word;
  }

  .viz-row {
    padding: 1rem 1.2rem !important; 
  }

 /* --- NUEVO: Iconos arriba del texto en móviles FORZADO --- */
  .icon-item {
    display: flex !important;
    flex-direction: column !important; /* Obliga a apilar: arriba y abajo */
    align-items: flex-start !important; 
    gap: 8px !important;
  }

  .icon-copy {
    width: 100% !important; /* Le da al texto todo el espacio horizontal disponible */
    overflow-wrap: break-word !important; /* Corta las palabras que se salgan */
    word-wrap: break-word !important;
  }