/*!
 * DINNOVAC - Digital Innovation Core
 * Copyright © 2025 DINNOVAC
 * Todos los derechos reservados.
 * 
 * AVISO LEGAL:
 * Este código es propiedad de DINNOVAC.
 * Queda prohibida su copia, modificación o redistribución
 * sin autorización expresa por escrito.
 * 
 * Contacto: legal@dinnovac.com
 */

:root {
  --primary: #00D1FF;
  --primary-dark: #00a8cc;
  --primary-light: #33DAFF;
  --dark: #0A1F3D;
  --gray: #6C757D;
  --light: #F8F9FA;
  --medium-gray: #E9ECEF;
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 5px 20px rgba(10, 31, 61, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 5px 15px rgba(0, 209, 255, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

.container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 80px 0;
}

/* HEADER */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 31, 61, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  padding: 15px 0;
  transition: var(--transition);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 50px;
  transition: var(--transition);
}

.logo img:hover {
  transform: scale(1.05);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

nav a {
  text-decoration: none;
  color: var(--light);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
  position: relative;
}

nav a:hover {
  color: var(--primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

nav a:hover::after {
  width: 100%;
}

.cta-button {
  background: var(--primary);
  color: var(--light);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.cta-button:hover {
  background: #00b5e0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.cta-button::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 30px;
  padding: 2px;
  background: linear-gradient(45deg, #00D1FF, #00B5E0, #0099CC);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cta-button:hover::after {
  opacity: 1;
}

.cta-button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.cta-button.secondary:hover {
  background: var(--primary-light);
  color: var(--dark);
}

/* HERO SECTION */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(rgba(26, 26, 26, 0.6), rgba(26, 26, 26, 0.3)), 
              url('https://imagedelivery.net/xaKlCos5cTg_1RWzIu_h-A/d0c57b40-dd49-4e8e-ff7d-0fa473e99a00/public') no-repeat center/cover;
  color: var(--light);
  text-align: center;
  padding-top: 80px;
}

.hero-divider {
  width: 80px;
  height: 3px;
  background: var(--shadow-lg);
  margin: 20px auto;
  border-radius: 3px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 20px;
  animation: fadeInDown 1s ease;
  color: #fff;
  text-shadow: 0 0 10px #00aaff, 0 0 20px #00aaff;
}

.hero h2 {
  font-size: clamp(1.2rem, 2.5vw, 2.5rem);
  font-weight: 400;
  max-width: 800px;
  margin: 0 auto 40px;
  animation: fadeInUp 1s ease 0.3s both;
  color: #fff;
  text-shadow: 0 0 10px #00aaff, 0 0 20px #00aaff;
}

.hero-cta {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  font-size: 1.1rem;
  padding: 14px 32px;
}

/* WHY US SECTION */
.why-us {
  /* ❌ ELIMINADO: height: 150vh; */
  align-items: center;
  background: var(--medium-gray);
  text-align: center;
  padding: 60px 0 !important;
}

.why-us h2 {
  font-size: 2.5rem !important;
  margin-bottom: 60px !important;
  text-align: center;
  color: var(--dark);
  font-weight: 700;
}

@media (max-width: 768px) {
  .why-us {
    padding: 80px 0 !important;
  }
  
  .why-us h2 {
    font-size: 2rem !important;
    margin-bottom: 50px !important;
  }
}

.why-us-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.why-card {
  background: #FDFDFD;
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid rgba(10, 31, 61, 0.25);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.why-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 209, 255, 0.1);
}

.why-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.why-card h3 {
  margin-bottom: 15px;
  color: var(--dark);
  font-size: 1.2rem;
}

.why-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gray);
  margin-top: auto;
}
/* SERVICES SECTION */
.services {
  height: 150vh;
  display: flex;
  align-items: center;
  background: linear-gradient(rgba(26, 26, 26, 0.25), rgba(26, 26, 26, 0.35)), 
              url('https://static.vecteezy.com/system/resources/previews/024/109/979/non_2x/business-process-management-background-business-process-workflow-or-automated-business-system-with-icons-and-connected-dots-lines-illustration-vector.jpg') no-repeat center/cover;
  color: var(--dark);
  text-align: center;
  padding-top: 80px;
}

.services h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5rem;
  color: var(--light);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.service-card {
  background: #FDFDFD;
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid rgba(10, 31, 61, 0.25);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 209, 255, 0.1);
}

.service-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.service-card h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.service-card p {
  flex-grow: 1;
  margin-bottom: 20px;
}

.service-card .cta-button {
  margin-top: auto;
  align-self: flex-start;
}

/* ROADMAP SECTION */
.roadmap {
  background: linear-gradient(rgba(10, 31, 61, 0.92), rgba(10, 31, 61, 0.72)), 
              url('https://imagedelivery.net/xaKlCos5cTg_1RWzIu_h-A/bd7c8ce1-7644-4676-383b-30421b750200/public') no-repeat center/cover;
  color: var(--light);
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  background-attachment: fixed;
}

.roadmap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  filter: blur(3px);
  z-index: -1;
}

.roadmap > .container {
  position: relative;
  z-index: 2;
}

.roadmap h2 {
  margin-bottom: 0;
  font-size: 2.5rem;
  text-align: center;
}

.roadmap-subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 800px;
  margin: 15px auto 50px;
  text-align: center;
  line-height: 1.6;
}

.roadmap-path {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.roadmap-path::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255,255,255,0.2) 20%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0.2) 80%,
    transparent
  );
  border-radius: 40px;
  transform: translateX(-50%);
  z-index: 1;
  backdrop-filter: blur(2px);
}

.roadmap-step {
  display: flex;
  align-items: center;
  margin: 60px 0;
  position: relative;
  z-index: 2;
}

.roadmap-step::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  box-shadow: 0 0 0 4px rgba(0, 209, 255, 0.2);
  animation: pulse 2s infinite ease-in-out;
}

.roadmap-step.left {
  justify-content: flex-start;
  text-align: right;
}

.roadmap-step.left .step-content {
  margin-right: 60px;
  max-width: 400px;
}

.roadmap-step.right {
  justify-content: flex-end;
  text-align: left;
}

.roadmap-step.right .step-content {
  margin-left: 60px;
  max-width: 400px;
}

.step-icon {
  width: 70px;
  height: 70px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 20px rgba(0, 209, 255, 0.4);
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.step-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(0, 209, 255, 0.6);
}

.step-icon i {
  font-size: 1.8rem;
  color: var(--dark);
}

.step-content h3 {
  margin-bottom: 12px;
  font-size: 1.3rem;
  color: var(--light);
}

.step-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

/* WHY CHOOSE SECTION */
.why-choose {
  background: rgb(4, 3, 39);
  padding: 100px 0;
}

.why-choose .container {
  max-width: 1400px;
}

.why-choose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.why-choose-left {
  position: relative;
  height: 500px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
}

.why-choose-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
}

.satisfaction-badge {
  position: absolute;
  bottom: -1px;
  right: -1px;
  background: rgba(0, 209, 255, 0.95);
  color: var(--dark);
  padding: 2.5px 5px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 35px rgba(0, 209, 255, 0.3);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  z-index: 2;
}

.satisfaction-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 45px rgba(0, 209, 255, 0.4);
}

.badge-number {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  line-height: 1;
}

.badge-text {
  font-size: .75rem;
  font-weight: 400;
  margin: 8px 0 0;
}

.why-choose-right {
  text-align: left;
}

.why-choose-right h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--light);
}

.section-intro {
  font-size: 1.2rem;
  max-width: 100%;
  margin: 0 0 40px;
  color: var(--light);
  line-height: 1.7;
}

.reasons-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 40px;
}

.reason-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.reason-icon {
  width: 60px;
  height: 60px;
  background: rgba(0, 209, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.6rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.reason-item:hover .reason-icon {
  background: var(--primary);
  color: var(--dark);
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(0, 209, 255, 0.3);
}

.reason-content h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--light);
}

.reason-content p {
  font-size: 0.95rem;
  color: var(--light);
  line-height: 1.6;
}

.cta-section {
  margin-top: 30px;
  text-align: left;
}

.cta-section p {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--light);
}

/* FOOTER */
footer {
  background: var(--dark);
  color: var(--light);
  padding: 40px 0;
  text-align: center;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  display: inline-block;
}

.footer-slogan {
  margin-bottom: 20px;
  font-style: italic;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--light);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.social-icons a {
  color: var(--light);
  font-size: 1.2rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.social-icons a:hover {
  color: var(--primary);
  background: rgba(0, 209, 255, 0.1);
  transform: translateY(-3px);
}

.copyright {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #aaa;
}

/* HAMBURGER BUTTON */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
  position: relative;
}

.hamburger .bar {
  width: 100%;
  height: 3px;
  background: #FFFFFF;
  border-radius: 10px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Animación cuando está activo */
.hamburger.active .bar:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

@media (max-width: 768px) {

  .hamburger {
    display: flex !important;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: var(--dark);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease-in-out;
    z-index: 10000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 30px;
    width: 100%;
    padding: 20px;
    text-align: center;
  }
  
  .nav-menu ul li {
    width: 100%;
  }
  
  .nav-menu a {
    display: block;
    padding: 12px 20px;
    font-size: 1.1rem;
    color: var(--light);
    border-radius: 8px;
    transition: all 0.3s ease;
  }
  
  .nav-menu a:hover {
    background: rgba(0, 209, 255, 0.1);
    color: var(--primary);
    transform: translateX(5px);
  }
  
  /* Ocultar botón CTA en móvil */
  .header-container > .cta-button {
    display: none;
  }
  
  /* Overlay oscuro cuando el menú está abierto */
  .nav-menu.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease;
  }
}

/* Animación de fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none !important;
  }
  
  .nav-menu {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    flex-direction: row;
    box-shadow: none;
  }
  
  .nav-menu ul {
    flex-direction: row;
    gap: 30px;
  }
  
  .nav-menu a {
    padding: 0;
    font-size: 1rem;
  }
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  header {
    padding: 12px 0;
  }
  
  .header-container {
    padding: 0 15px;
  }
  
  .logo img {
    height: 40px;
  }
}

/* MODAL DE CHATBOT */
.modal {
  display: none;
  position: fixed;
  top: 0;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  width: 380px;
  height: 500px;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s ease, opacity 0.4s ease;
  transform: translateY(100px);
  opacity: 0;
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
  background: transparent;
  pointer-events: none;
}

.modal.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background-color: #fcfcfc;
  margin: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 380px;
  height: 600px;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  
}

.modal.active .modal-content {
  transform: translateY(0);
}

#chatbot-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.chat-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--dark) 0%, #142950 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.chat-header h2 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-modal {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-modal:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(248, 249, 250, 0.7);
  width: 100%;
  min-height: 0;
}

.chat-input {
  padding: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  align-items: center;
  box-sizing: border-box;
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  font-size: 0.95rem;
  outline: none;
  background: transparent;
  color: var(--dark);
}

.chat-input button {
  background: var(--primary);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 5px;
}

/* Estilos de burbujas */
.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* === PANTALLA DE RESULTADO DEL TEST === */
#screen-result {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: white;
}

.result-content {
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) 0%,
    var(--primary) var(--final-score, 0%),
    #e9ecef var(--final-score, 0%),
    #e9ecef 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score-circle::before {
  content: '';
  position: absolute;
  width: 140px; /* reducido para no tapar el borde */
  height: 140px;
  background: white;
  border-radius: 50%;
  z-index: 1;
}

#scoreValue {
  position: relative;
  z-index: 2;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Montserrat', sans-serif;
}

.score-message,
.recommendation {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--dark);
}

.recommendation {
  font-style: italic;
  color: var(--primary-dark);
  margin-top: 8px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.bot-bubble {
  align-self: flex-start;
  background: white;
  color: var(--dark);
  border-bottom-left-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.user-bubble {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 5px;
}

/* Botones de opción */
.option-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  padding: 0 5px;
  min-width: 0; 
}

.option-btn {
  background: white;
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 10px 15px;
  border-radius: 50px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  word-wrap: break-word;
  white-space: normal;
  min-height: 40px;
}

.option-btn:hover {
  background: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
  transform: translateX(5px);
}

/* Indicador de escritura */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #777;
  font-size: 0.9rem;
  margin-top: 5px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}


/* ✅ BOTÓN FLOTANTE CON BADGE */
.chat-toggle {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(0, 209, 255, 0.6) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 3px solid white !important;
  animation: float 3s ease-in-out infinite !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
}

.chat-toggle:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 8px 25px rgba(0, 209, 255, 0.6);
}

.chat-toggle i {
  font-size: 1.5rem;
}

/* ✅ Botón de exportar PDF */
.export-btn {
  background: var(--dark);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 15px;
  align-self: center;
  display: none;
}

.export-btn:hover {
  background: #1a3a6b;
}

/* FORMULARIO NO VISIBLE */
#contact-form-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 20px;
  overflow: hidden;
  background: var(--light);
}

#contact-form-panel.active {
  display: flex !important;
}

#contact-form-panel .chat-header {
  background: linear-gradient(135deg, #eeeff0 0%, #f8f9fa 0%) !important;
  color: var(--dark) !important;
  border-bottom: 1px solid #e9ecef;
}

/* ENCABEZADO DEL FORMULARIO */
#contact-form-panel h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  margin: 15px auto 20px auto !important;
  line-height: 1.2;
  padding: 0 15px;
  word-wrap: break-word;
  white-space: nowrap;
  flex-direction: column;
  align-items: cente
}

/* Ícono alineado */
#contact-form-panel h2 i {
  display: block;
  margin: 0 auto 8px auto !important;
  font-size: 1.8rem;
  color: var(--primary);
  line-height: 1;
}

/* Formulario visible y esté bien dimensionado */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 0 !important;
}

/* Mejorar la visualización */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.8);
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 209, 255, 0.1);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-intro {
  text-align: center;
  margin: 0 0 25px;
  color: var(--gray);
  line-height: 1.6;
}

.form-success {
  animation: fadeIn 0.5s ease;
  text-align: center;
  padding: 30px 20px;
}

.form-success i {
  color: #28a745;
  margin-bottom: 15px;
  font-size: 2rem;
}

.form-success h3 {
  color: #28a745;
  margin-bottom: 10px;
}

/* ✅ Validación visual */
.contact-form input:required:invalid,
.contact-form textarea:required:invalid {
  border-color: #dc3545;
}

.contact-form input:required:valid,
.contact-form textarea:required:valid {
  border-color: #28a745;
}

/* ✅ MEJORAS PARA LAS PANTALLAS INTERNAS */
.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 20px;
  overflow-y: auto;
}

.screen.active {
  display: flex !important;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 70vh;
}

/* Mensajes */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.chat-toggle:hover {
  transform: scale(1.15) rotate(15deg) !important;
  box-shadow: 0 12px 35px rgba(0, 209, 255, 0.8) !important;
  background: #00b5e0 !important;
}

.chat-toggle i {
  font-size: 1.5rem !important;
  pointer-events: none !important;
}

/* ✅ Badge de mensajes nuevos */
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4d4d;
  color: white;
  font-size: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: none;
}

/* ✅ RESPONSIVE PARA MÓVILES */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    height: 85vh;
  }
  
  #contact-form-panel {
    padding: 15px;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 12px;
    font-size: 0.95rem;
  }
  
  .form-group textarea {
    min-height: 100px;
  }
  
  .chat-toggle {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  
  .chat-toggle i {
    font-size: 1.2rem !important;
  }
}

/* ✅ RESPONSIVE PARA EL MENÚ */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--dark);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    z-index: 1000;
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-menu ul {
    flex-direction: column;
    gap: 30px;
  }
  
  .header-container .cta-button {
    display: none;
  }
}

/* ESPACIO SUPERIOR ENCABEZADO FORMULARIO */
#contact-form-panel > h2,
#contact-form-panel h2 {
  margin-top: 0 !important;
  padding-top: 5px !important;
  margin-bottom: 20px !important;
  line-height: 1.2 !important;
}

#contact-form-panel h2 i {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  line-height: 1 !important;
  padding: 0 !important;
}

#contact-form-panel {
  padding-top: 0 !important;
}

/* ALINEACIÓN TARJETAS WHY US */
.why-card {
  height: 100% !important;
  min-height: 240px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding-top: 20px !important;
  margin-top: 0 !important;
  box-sizing: border-box !important;
}

.why-card i {
  margin-top: 0 !important;
  margin-bottom: 15px !important;
  align-self: center !important;
}

.why-card h3 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  text-align: center !important;
  line-height: 1.3 !important;
}

.why-card p {
  margin-top: auto !important;
  margin-bottom: 0 !important;
  text-align: center !important;
  padding: 0 10px !important;
}

.why-us .container {
  align-items: start !important;
}

.scroll-indicator {
  display: none !important;
}

.chat-messages {
  min-height: 300px;
  padding: 20px;
}

.option-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.option-btn {
  background: white;
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.option-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateX(5px);
}

/* Estilos para nuevas funcionalidades del chatbot */
.voice-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.voice-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.voice-btn.listening {
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Modo oscuro */
body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-mode .modal-content {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-mode .chat-bubble {
    background-color: #404040;
    color: #ffffff;
}

body.dark-mode .user-bubble {
    background-color: #007bff;
    color: #ffffff;
}

body.dark-mode .option-btn {
    background-color: #404040;
    color: #ffffff;
    border: 1px solid #555;
}

body.dark-mode .option-btn:hover {
    background-color: #505050;
}

body.dark-mode .chat-input input {
    background-color: #404040;
    color: #ffffff;
    border: 1px solid #555;
}

/* Botón de modo oscuro */
.dark-mode-btn {
    background: transparent;
    border: none;
    color: inherit;
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dark-mode-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .voice-btn, .mute-btn, .dark-mode-btn {
        padding: 8px;
        font-size: 14px;
    }
}
/* === BOTÓN DE DESCARGA DE PDF (post-diagnóstico) === */
.btn-download-pdf {
  margin-top: 25px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #00a8cc, #0077b6);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 168, 204, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-download-pdf:hover {
  background: linear-gradient(135deg, #0099b3, #006699);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 168, 204, 0.4);
}

.btn-download-pdf i {
  font-size: 1.2rem;
}

/* === BADGE DE MENSAJES NUEVOS (en botón flotante) === */
.chat-toggle {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(0, 209, 255, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid white;
  animation: float 3s ease-in-out infinite;
}

.chat-toggle .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4d4d;
  color: white;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  display: none; /* se muestra con JS */
}

/* === BOTONES DE OPCIÓN MEJORADOS === */
.option-btn {
  background: white;
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.option-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 209, 255, 0.2);
}

.option-btn.secondary {
  background: #f0f9ff;
  color: var(--primary-dark);
  border-color: var(--primary-light);
}

.option-btn.secondary:hover {
  background: var(--primary-light);
  color: white;
}

/* === INDICADOR DE SCROLL (opcional) === */
.scroll-indicator {
  position: sticky;
  top: 10px;
  background: rgba(0, 209, 255, 0.1);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  text-align: center;
  margin: 0 auto 15px;
  width: fit-content;
  display: none;
  z-index: 10;
  font-weight: 600;
  border: 1px solid var(--primary-light);
}

/* === BOTONES EN CABECERA DEL CHAT === */
.chat-header .dark-mode-btn,
.chat-header .reset-chat-btn,
.chat-header .mute-btn {
  background: transparent;
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-header .dark-mode-btn:hover,
.chat-header .reset-chat-btn:hover,
.chat-header .mute-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-header .mute-btn.muted {
  color: #ff6b6b;
}

/* === RESPONSIVE PARA BOTÓN PDF === */
@media (max-width: 768px) {
  .btn-download-pdf {
    font-size: 1rem;
    padding: 12px 20px;
  }
  
  .chat-toggle {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
  }
  
  .chat-toggle .badge {
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
}

/* TEMPLATE DE PDF */
.pdf-template-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  visibility: hidden !important;
  z-index: -100 !important;
  width: 600px !important;
  background: white !important;
  padding: 20px !important;
  font-family: 'Inter', sans-serif !important;
}

/* ========================================
   1. RESET Y BASE RESPONSIVE
   ======================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   2. HEADER RESPONSIVE COMPLETO
   ======================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 31, 61, 0.98);
  backdrop-filter: blur(10px);
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: relative;
}

.logo {
  z-index: 10002;
  position: relative;
}

.logo img {
  height: 50px;
  width: auto;
}

/* Hamburguesa - visible solo en móvil */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10002;
  position: relative;
}

.hamburger .bar {
  width: 100%;
  height: 3px;
  background: #FFFFFF;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Menú de navegación */
nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  margin: 0;
  padding: 0;
}

nav a {
  text-decoration: none;
  color: var(--light);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--primary);
}

/* ========================================
   3. RESPONSIVE PARA MÓVILES (< 768px)
   ======================================== */

@media (max-width: 768px) {
  /* === HEADER MÓVIL === */
  header {
    padding: 12px 0;
  }

  .header-container {
    padding: 0 15px;
  }

  .logo img {
    height: 40px;
  }

  /* Mostrar hamburguesa */
  .hamburger {
    display: flex !important;
    order: 3;
  }

  /* Menú móvil */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10001;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    padding: 20px;
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 25px;
    width: 100%;
    text-align: center;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: 15px 20px;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  .nav-menu a:hover,
  .nav-menu a.active {
    background: rgba(0, 209, 255, 0.1);
    color: var(--primary);
    transform: translateX(5px);
  }

  /* Ocultar botón CTA del header en móvil */
  .header-container > .cta-button,
  .header-container > #openChatbotBtn {
    display: none !important;
  }

  /* Overlay cuando menú está abierto */
  .nav-menu.active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
    animation: fadeIn 0.3s ease;
  }

  /* === HERO SECTION === */
  .hero {
    min-height: 70vh;
    padding-top: 80px;
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: 15px;
  }

  .hero h2 {
    font-size: 1.1rem;
    margin-bottom: 30px;
  }

  .hero-cta {
    font-size: 1rem;
    padding: 12px 24px;
  }

  /* === WHY US SECTION === */
  .why-us {
    padding: 60px 0;
  }

  .why-us h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .why-us-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .why-card {
    padding: 25px 20px;
    min-height: auto;
  }

  .why-card h3 {
    font-size: 1.1rem;
  }

  .why-card p {
    font-size: 0.9rem;
  }

  /* === SERVICES SECTION === */
  .services {
    height: auto;
    min-height: auto;
    padding: 60px 0;
  }

  .services h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-card {
    padding: 25px 20px;
  }

  .service-card h3 {
    font-size: 1.1rem;
  }

  .service-card p {
    font-size: 0.9rem;
  }

  /* === ROADMAP SECTION === */
  .roadmap {
    padding: 60px 0;
    background-attachment: scroll;
  }

  .roadmap h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }

  .roadmap-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
    padding: 0 15px;
  }

  .roadmap-path {
    padding: 0 10px;
  }

  .roadmap-path::before {
    left: 20px;
    transform: none;
  }

  .roadmap-step {
    flex-direction: column;
    margin: 30px 0;
    padding-left: 60px;
  }

  .roadmap-step.left,
  .roadmap-step.right {
    justify-content: flex-start;
    text-align: left;
  }

  .roadmap-step.left .step-content,
  .roadmap-step.right .step-content {
    margin: 0;
    max-width: 100%;
  }

  .roadmap-step::after {
    left: 20px;
    transform: translateX(0);
  }

  .step-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
  }

  .step-icon i {
    font-size: 1.3rem;
  }

  .step-content h3 {
    font-size: 1.1rem;
  }

  .step-content p {
    font-size: 0.85rem;
  }

  /* === WHY CHOOSE SECTION === */
  .why-choose {
    padding: 60px 0;
  }

  .why-choose-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .why-choose-left {
    height: 300px;
  }

  .why-choose-right h2 {
    font-size: 1.6rem;
    text-align: center;
  }

  .section-intro {
    font-size: 1rem;
    text-align: center;
  }

  .reasons-list {
    gap: 20px;
  }

  .reason-icon {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .reason-content h3 {
    font-size: 1.1rem;
  }

  .reason-content p {
    font-size: 0.9rem;
  }

  .cta-section {
    text-align: center;
  }

  .cta-section p {
    font-size: 1.2rem;
  }

  /* === FOOTER === */
  footer {
    padding: 30px 0;
    background: rgba(10, 31, 61, 0.95);
  }

  .footer-logo {
    font-size: 1.5rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }

  /* === CHATBOT === */
  .chat-toggle {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
  }

  .chat-toggle i {
    font-size: 1.3rem;
  }

  .modal {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
  }

  .modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  #chatbot-container,
  #contact-form-panel,
  #screen-result,
  #screen-detailed-recommendation {
    height: 100%;
  }

  .chat-header {
    padding: 12px 15px;
  }

  .chat-header h2 {
    font-size: 16px;
  }

  .chat-messages {
    padding: 15px;
    gap: 12px;
  }

  .chat-bubble {
    max-width: 85%;
    font-size: 0.9rem;
  }

  .option-btn {
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .score-circle {
    width: 150px;
    height: 150px;
  }

  .score-circle::before {
    width: 110px;
    height: 110px;
  }

  #scoreValue {
    font-size: 2rem;
  }
}

/* TABLETS (768px - 1024px) */

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 95%;
  }

  .services-grid,
  .why-us-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .roadmap-step {
    margin: 40px 0;
  }

  .why-choose-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* DESKTOP GRANDE (> 1400px) */

@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }

  .hero h1 {
    font-size: 5rem;
  }

  .hero h2 {
    font-size: 2.5rem;
  }
}

/*  UTILIDADES RESPONSIVE */

/* Prevenir scroll horizontal */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Asegurar que nada se salga */
section {
  overflow-x: hidden;
  width: 100%;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Touch friendly */
@media (hover: none) and (pointer: coarse) {
  .cta-button,
  .option-btn,
  nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Landscape mode en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding-top: 70px;
  }

  .nav-menu {
    padding-top: 60px;
  }

  .nav-menu ul {
    gap: 15px;
  }

  .nav-menu a {
    padding: 10px 15px;
    font-size: 1rem;
  }
}

/* POPUP LIGERO */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.2);;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.popup-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.close-popup {
  position: absolute;
  top: 15px; right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #1e588a;
}
.popup-content h3 {
  margin: 0 0 15px;
  color: #012e58;
  font-size: 1.4rem;
  font-family: 'Montserrat', sans-serif;
}
.popup-content p {
  line-height: 1.7;
  color: #1a4e7e;
}

/* ==================== MODAL LEGAL CON PESTAÑAS ==================== */
.legal-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10002;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.legal-modal-overlay.active {
  display: flex;
}

.legal-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s ease;
  overflow: hidden;
}

/* HEADER */
.legal-modal-header {
  background: linear-gradient(135deg, var(--dark) 0%, #142950 100%);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--primary);
}

.legal-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.close-legal-modal {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-legal-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* TABS */
.legal-tabs {
  display: flex;
  background: var(--medium-gray);
  border-bottom: 2px solid #e9ecef;
  overflow-x: auto;
}

.legal-tab {
  flex: 1;
  padding: 15px 20px;
  background: transparent;
  border: none;
  color: var(--gray);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.legal-tab:hover {
  background: rgba(0, 209, 255, 0.05);
  color: var(--dark);
}

.legal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: white;
}

/* CONTENT */
.legal-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  line-height: 1.8;
  color: #333;
  background: white;
}

.legal-content-panel {
  display: none;
}

.legal-content-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.legal-content h3 {
  color: var(--dark);
  font-size: 1.4rem;
  margin: 25px 0 15px;
  font-weight: 700;
}

.legal-content h4 {
  color: #142950;
  font-size: 1.1rem;
  margin: 20px 0 10px;
  font-weight: 600;
}

.legal-content p {
  margin-bottom: 15px;
  text-align: justify;
}

.legal-content ul {
  margin: 15px 0 15px 25px;
}

.legal-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.legal-content strong {
  color: var(--dark);
  font-weight: 600;
}

.legal-date {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* FOOTER */
.legal-modal-footer {
  background: var(--medium-gray);
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e9ecef;
  flex-wrap: wrap;
  gap: 15px;
}

.legal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legal-btn-primary {
  background: var(--primary);
  color: white;
}

.legal-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.legal-btn-secondary {
  background: white;
  color: var(--dark);
  border: 2px solid var(--dark);
}

.legal-btn-secondary:hover {
  background: var(--dark);
  color: white;
}

.legal-note {
  font-size: 0.85rem;
  color: var(--gray);
  flex: 1;
  min-width: 200px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .legal-modal {
    max-height: 95vh;
    border-radius: 12px;
  }

  .legal-modal-header h2 {
    font-size: 1.2rem;
  }

  .legal-content {
    padding: 20px;
    font-size: 0.95rem;
  }

  .legal-tabs {
    overflow-x: auto;
  }

  .legal-tab {
    padding: 12px 15px;
    font-size: 0.9rem;
    min-width: 140px;
  }

  .legal-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .legal-actions {
    width: 100%;
  }

  .legal-btn {
    flex: 1;
    justify-content: center;
  }
  
  .legal-note {
    text-align: center;
  }
}

/* SCROLLBAR */
.legal-content::-webkit-scrollbar {
  width: 8px;
}

.legal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.legal-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.legal-content::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.privacy-consent {
  margin: 20px 0;
  padding: 15px;
  background: #f0f9ff;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.privacy-consent label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}

.privacy-consent input[type="checkbox"] {
  margin-top: 3px;
}

.privacy-consent a {
  color: var(--primary);
  font-weight: 600;
}

.privacy-consent small {
  display: block;
  margin-top: 8px;
  color: var(--gray);
  font-size: 0.85rem;
}