/* Variables CSS para colores y estilos */
:root {
  --primary-color: #5870a8;
  --secondary-color: #3a4a6b;
  --accent-color: #ffc107;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --text-color: #333;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-color);
  padding: 0;
  margin: 0;
}

/* Contenedor principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 3rem 0;
  text-align: center;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSgzMCkiPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idXJsKCNwYXR0ZXJuKSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIvPjwvc3ZnPg==');
  opacity: 0.3;
}

header .container {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

header p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.9;
}

/* Sección de acceso */
.access-section {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
  position: relative;
  overflow: hidden;
}

.access-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSgzMCkiPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idXJsKCNwYXR0ZXJuKSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIvPjwvc3ZnPg==');
  opacity: 0.3;
}

.access-section .container {
  position: relative;
  z-index: 1;
}

.access-section h2 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.access-section p {
  margin-bottom: 1rem;
  opacity: 0.9;
  font-size: 0.95rem;
}

.access-section a {
  color: var(--accent-color);
  font-weight: 500;
}

/* Formulario de contraseña integrado */
.password-form {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-top: 1.5rem;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.password-form h3 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.password-input-group {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}

.password-input {
  flex: 1;
  padding: 12px 15px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.password-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
}

.btn-submit {
  background-color: var(--accent-color);
  color: var(--dark-color);
  border: none;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn-submit:hover {
  background-color: #e0a800;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.error-message {
  color: #ff6b6b;
  margin-top: 10px;
  font-size: 0.9rem;
  display: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 4px;
}

/* Secciones */
section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--primary-color);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background-color: var(--accent-color);
  margin: 10px auto;
}

/* --- ESTILOS DE LA NUEVA SECCIÓN TEASER --- */
.teaser-section {
    padding: 3rem 0;
    background-color: var(--light-color);
    text-align: center;
}

.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.teaser-item {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
}

.teaser-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.teaser-item h4 {
    color: var(--secondary-color);
    margin-top: 10px;
    font-size: 1.1rem;
}

.teaser-item p {
    font-size: 0.9rem;
    color: #666;
}

.teaser-item .icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}
/* ------------------------------------------- */
/* OCULTAR TEASER-COMPARATIVA: ELIMINADO PARA SIEMPRE VISIBLE */
/* .teaser-section, .comparison-section { display: none; } */
/* body.access-granted .teaser-section, body.access-granted .comparison-section { display: block; } */

.iframe-box {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  padding: 1rem;
}

/* CONTENEDOR PRINCIPAL CON COMPARACIÓN Y VIDEO */
.comparison-video-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* SOLUCIÓN CORREGIDA - IMÁGENES SOLAPADAS */
.image-comparison {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--border-radius);
  margin: 0 auto;
}

.image-container {
  position: relative;
  width: 100%;
  height: 0; /* Se establece dinámicamente por JS */
  overflow: hidden;
}

/* Ambas imágenes en la misma posición y tamaño */
.comparison-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* AJUSTE CLAVE */
  transition: opacity 0.8s ease-in-out;
}

.image-before {
  z-index: 2;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); /* Mostrar solo la mitad izquierda */
}

.image-after {
  z-index: 1;
}

.slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background-color: var(--accent-color);
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 10;
}

.slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background-color: var(--accent-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  color: white;
  font-weight: bold;
  transform: translate(-50%, -50%);
}

.label {
  position: absolute;
  bottom: 20px;
  padding: 8px 16px;
  background-color: rgba(0,0,0,0.7);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
  z-index: 5;
  transition: opacity 0.8s ease-in-out;
}

.label-before {
  left: 20px;
}

.label-after {
  right: 20px;
}

/* Indicador del carrusel */
.carousel-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.3s ease;
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--accent-color);
}

/* RECUADRO DEL VIDEO ANIMADO */
.video-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  text-align: center;
  border: 2px solid var(--primary-color);
}

.video-container h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  transition: opacity 0.8s ease-in-out;
}

.video-wrapper {
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

/* Contenedor extra para forzar una relación de aspecto (16:9) */
.video-ratio-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px; 
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    overflow: hidden;
}

.animated-gif, #mainGif {
  display: block;
  max-width: 100%;
  height: auto !important;
  min-height: 100px;
  background: #fff8f8;
  border: 2px solid red !important;
}

.video-ratio-wrapper, .video-wrapper {
  width: 100%;
  min-height: 140px !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Controles de video/gif */
.video-controls {
    margin-top: 15px;
}

.btn-video-toggle {
    background-color: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-video-toggle:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
}

.video-description {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.4;
  transition: opacity 0.8s ease-in-out;
}

/* Elementos del carrusel con transición */
.carousel-element {
  transition: opacity 0.8s ease-in-out;
}

/* Footer */
footer {
  background-color: var(--dark-color);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }
  section {
    padding: 2.5rem 0;
  }
  .teaser-grid {
      grid-template-columns: 1fr;
  }
  .label {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  .comparison-video-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .video-container {
    order: -1; /* El video va arriba en móvil */
  }
  .access-section {
    padding: 1.5rem;
    margin: 1rem auto;
  }
  .password-input-group {
    flex-direction: column;
  }
  .btn-submit {
    width: 100%;
  }
  .carousel-indicator {
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
  }
}