:root {
  --primary-dark: #232323;
  --secondary-dark: #333;
  --accent-gold: #ffb300;
  --accent-gold-light: #ffc233;
  --text-light: #ffffff;
  --text-gray: #dddddd;
  --input-bg: #444;
  --card-bg: rgba(51, 51, 51, 0.9);
  --border-light: rgba(255, 255, 255, 0.1);
}

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  color: var(--text-light);
  background-color: var(--primary-dark);
  overflow-x: hidden; /* CORREGIDO: Evita scroll horizontal */
}

html {
  overflow-x: hidden; /* CORREGIDO: Evita scroll horizontal en html también */
}

h2, p {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Clase que activará la animación */
h2.visible, p.visible{
  animation: slideUp 0.8s ease forwards;
}

/* ================= HEADER ================= */
header {
  background-color: var(--primary-dark);
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
}

header .container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-light);
}

header a {
  font-size: 1rem;
  color: var(--text-light);
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.3s;
}

header a:hover {
  color: var(--accent-gold);
}

.logo {
  height: 50px;
  object-fit: contain;
}

/* Navegación */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-gold);
}

.btn-ingresa {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-ingresa:hover {
  background-color: var(--accent-gold-light);
  transform: scale(1.05);
}

/* ================= HERO ================= */
.hero {
  background-color: var(--accent-gold);
  padding: 4rem 2rem;
  text-align: center;
  color: var(--primary-dark);
}

.hero-container h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero-container p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.hero-container button {
  background-color: var(--primary-dark);
  color: var(--text-light);
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s;
  animation: color-change 6s infinite, idle-move 4s infinite;
}

.hero-container button:hover {
  background-color: var(--secondary-dark);
  transform: scale(1.05);
}

/* ================= SECCIÓN 1 ================= */
.parte-1 {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.info-item {
  flex: 1;
  padding: 0 6vw;
  max-width: 1000px;
}

.info-item h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent-gold);
}

.info-item p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-gray);
}

/* Animación PC */
.pc-container {
  position: relative;
  width: 55vw;
  aspect-ratio: 16 / 9;
  opacity: 0;
  transform: translateX(-150px);
  transition: all 1s ease-out;
}

.pc-container.visible {
  opacity: 1;
  transform: translateX(0);
}

.pc-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pc-video {
  position: absolute;
  top: 2%;
  left: 18.4%;
  height: 67%;
  width: 63%;
  object-fit: fill;
  border-radius: 4px;
  z-index: 2;
  transform: rotateY(-8deg);
  transition: transform 0.6s ease-out;
}

.pc-container.visible .pc-video {
  transform: rotateY(0);
}

/* ================= SECCIÓN 2 ================= */
.parte-2 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  background: var(--accent-gold);
  color: var(--primary-dark);
  padding: 0 6vw;
}

.cta-container {
  flex: 1;
  max-width: 45%;
}

.cta-container h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.cta-container p {
  font-size: 1.1rem;
  color: var(--secondary-dark);
  margin-bottom: 2rem;
}

.cta-container button {
  background: var(--primary-dark);
  color: var(--text-light);
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
  animation: color-change 6s infinite, idle-move 4s infinite;
}

.cta-container button:hover {
  background: var(--secondary-dark);
  transform: scale(1.05);
}

/* Animación Celular */
.espacio-animacion2 {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cel-container {
  position: relative;
  width: 40vw;
  aspect-ratio: 9 / 19.5;
  opacity: 0;
  transform: translateX(150px);
  transition: all 1s ease-out;
}

.cel-container.visible {
  opacity: 1;
  transform: translateX(0);
}

.cel-video {
  position: absolute;
  top: 27.1%;
  left: 27%;
  height: 45.9%;
  width: 45.6%;
  object-fit: cover;
  border-radius: 11.7%;
  z-index: 1;
}

.cel-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
}

/* ================= SECCIÓN 3 ================= */
.parte-3 {
  color: white; 
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  background: var(--primary-dark);
  padding: 0;
}

.parte-3 h2, 
.parte-3 p {
  color: white; 
}
.parte-3 .cta-container {
  max-width: 30%;
  z-index: 1;
}

.espacio-animacion3 {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* ================= SECCIÓN 4 ================= */
.parte-4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  background: var(--accent-gold);
  padding: 0 6vw;
  overflow: hidden; /* CORREGIDO: Mantiene overflow hidden */
  position: relative;
  perspective: 1000px;
}

/* Contenedores de texto */
.parte-4 .cta-container {
  max-width: 400px;
  z-index: 2;
  color: #1a1a1a;
}

.parte-4 .left-text {
  text-align: left;
}

.parte-4 .right-text {
  text-align: right;
}

/* Contenedor central de animación */
.espacio-animacion4 {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 450px;
  overflow: visible; /* CORREGIDO: Cambiado a visible para desktop */
  z-index: 1; /* CORREGIDO: Z-index bajo para que texto quede encima */
}

.espacio-animacion4 .tarjeta {
  position: absolute;
  max-width: 45%; /* CORREGIDO: Reducido de 50% a 45% */
  width: 100%;
  will-change: transform;
  pointer-events: none; /* CORREGIDO: Evita que bloqueen clicks */
}

/* ================= FOOTER ================= */
.main-footer {
  background-color: var(--secondary-dark);
  color: var(--text-gray);
  padding: 3rem 6vw 2rem;
  font-size: 0.95rem;
  position: relative;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-section h3 {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-section ul li {
  margin: 0;
}

.footer-section ul li a {
  color: var(--text-gray);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.footer-section ul li a:hover {
  color: var(--accent-gold);
}

.footer-section p {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.vigilance-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
}

.vigilance-label {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
}

.vigilance-entity {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
}

.social-links-placeholder {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-dark);
  color: var(--text-light);
  border: 2px solid var(--border-light);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  border-color: var(--accent-gold);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-placeholder-footer {
  font-weight: 700;
  color: var(--accent-gold);
}

/* ================= BOTÓN AYUDA ================= */
.help-button-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  z-index: 999;
  border: none;
  font-size: 1.5rem;
}

.help-button-float:hover {
  transform: scale(1.1);
  background-color: var(--accent-gold-light);
}

/* ================= CHAT PANEL ================= */
.chat-panel {
  position: fixed;
  bottom: 95px;
  right: 30px;
  width: 350px;
  height: 500px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.chat-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-panel.minimized {
  height: auto;
}

.chat-panel.minimized .chat-body,
.chat-panel.minimized .chat-footer {
  display: none;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--secondary-dark);
  border-radius: 12px 12px 0 0;
}

.chat-header h3 {
  margin: 0;
  color: var(--accent-gold);
  font-size: 1.1rem;
}

.chat-header div {
  display: flex;
  gap: 0.5rem;
}

.minimize-chat-btn,
.close-chat-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.minimize-chat-btn:hover,
.close-chat-btn:hover {
  color: var(--accent-gold);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  display: flex;
  margin-bottom: 0.5rem;
}

.message.bot-message {
  justify-content: flex-start;
}

.message.user-message {
  justify-content: flex-end;
}

.message p {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 80%;
  word-wrap: break-word;
  opacity: 1;
  transform: none;
}

.message.bot-message p {
  background-color: var(--secondary-dark);
  color: var(--text-light);
}

.message.user-message p {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
}

.chat-footer {
  display: flex;
  padding: 1rem;
  gap: 0.5rem;
  border-top: 1px solid var(--border-light);
  background-color: var(--secondary-dark);
  border-radius: 0 0 12px 12px;
}

#chatInput {
  flex: 1;
  padding: 0.75rem;
  background-color: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-light);
  font-family: "Roboto", sans-serif;
}

#chatInput::placeholder {
  color: var(--text-gray);
}

#chatInput:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.send-chat-btn {
  padding: 0.75rem 1rem;
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-weight: 600;
}

.send-chat-btn:hover {
  background-color: var(--accent-gold-light);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    text-align: center;
  }

  .nav-links a {
    display: none;
  }

  .nav-links .btn-ingresa {
    display: inline-block;
  }

  .parte-1 {
    flex-direction: column;
    padding: 4rem 1rem;
    text-align: center;
    height: auto;
  }
      .pc-video {
  position: absolute;
  top: 4%;
  left: 1%;
  height: 64%;
  width: 98%;
  object-fit: fill;
  border-radius: 4px;
  z-index: 2;
  transform: rotateY(-8deg);
  transition: transform 0.6s ease-out;
}
  .parte-2 {
    flex-direction: column;
    text-align: center;
    padding: 4rem 1.5rem;
  }

  .espacio-animacion2 {
    order: 2;
    width: 80%;
  }

  .cta-container {
    order: 1;
    max-width: 90%;
  }

  /* --- SECCIONES 3 y 4: texto → animación → texto --- */
  .parte-3,
  .parte-4 {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4rem 1.5rem;
    gap: 2rem;
  }

  .parte-3 .cta-container,
  .parte-4 .cta-container {
    order: 1;
    z-index: auto;
  }

  .espacio-animacion3,
  .espacio-animacion4 {
    order: 2;
    z-index: 0;
    width: 80vw;
  }

  .cta-container:last-of-type {
    order: 3;
  }

  .cta-container h2 {
    font-size: 1.8rem;
  }

  .cta-container p {
    font-size: 1rem;
  }

  .cta-container button {
    font-size: 0.95rem;
    padding: 0.8rem 1.8rem;
  }

  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .footer-bottom {
    text-align: center;
    flex-direction: column;
  }
  
  .espacio-animacion4 .tarjeta {
    position: absolute;
    max-width: 100%; 
    width: 100%;
  }

  /* Chat panel en móviles */
  .chat-panel {
    width: 90vw;
    max-width: 350px;
    height: 60vh;
    bottom: 100px;
    right: 5vw;
  }

  .help-button-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}

/* ======== SECCIÓN 2 ======== */
.parte-2 {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 40px;
  padding: 60px 10%;
}

/* Contenedor del texto */
.parte-2 .cta-container {
  flex: 1;
  text-align: left;
}

/* Contenedor de la animación/celular */
.parte-2 .espacio-animacion2 {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.parte-2 .cel-container {
  position: relative;
  width: 350px;        
  aspect-ratio: 9 / 19.5; 
}

.parte-2 .cel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; 
}

.parte-2 .cel-video {
  position: absolute;
  top: 1%;
  left: 0;
  width: 100%;
  height: 98%;
  object-fit: cover; 
}

/* ======== RESPONSIVE (Celular arriba del texto) ======== */
@media (max-width: 768px) {
  .parte-2 {
    flex-direction: column-reverse;
    text-align: center;
    gap: 20px;
  }

  .parte-2 .cel-container {
    width: 81%;
    max-width: 400px;
  }

  .parte-2 .cta-container {
    width: 90%;
  }
}

/* ================= ANIMACIONES ================= */
@keyframes idle-move {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

@keyframes color-change {
  0%, 100% { background-color: var(--primary-dark); }
  25% { color: var(--primary-dark); }
  50% { background-color: var(--text-light); }
  75% { color: var(--text-light); }
}

/* Animación de aparición hacia arriba */
@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(20px); 
  }
  100% {
    opacity: 1;
    transform: translateY(0); 
  }
}