/* =========================================================
   Hernández Solutions - style.css (Versión Clara UX/UI)
   ========================================================= */

/* 🎨 Paleta oficial (basada en el logo Hernández Solutions) */
:root {
  --brand: #1c4c7a;        /* Azul medio corporativo */
  --brand-hover: #2769a5;  /* Azul brillante */
  --accent: #5aa4dc;       /* Azul celeste metálico */
  --bg: #f4f7fb;           /* Fondo claro */
  --bg-alt: #ffffff;       /* Blanco puro */
  --card: #ffffff;         /* Tarjetas / secciones */
  --border: #d9e2ec;       /* Bordes suaves */
  --text: #1e293b;         /* Gris-azulado oscuro */
  --muted: #64748b;        /* Gris medio */
  --white: #ffffff;
}

/* ========================
   Reset + Base
======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
}

.section h2 {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  color: var(--brand);
}

/* Alternancia de fondos para secciones */
.section:nth-of-type(even) {
  background: #ffffff;
}

.section:nth-of-type(odd) {
  background: #f8fbff;
}

/* ========================
   Navbar
======================== */



.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--brand);
  font-size: 1.2rem;
}

.logo img {
  height: 42px;
  width: 42px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--brand);
}

/* ========================
   Navbar Responsive
======================== */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

/* 🔹 Botón hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Efecto animado al abrir */
.menu-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translateY(7px);
}
.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translateY(-7px);
}

/* 🔹 Menú desktop */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--brand);
}

/* 🔹 Modo móvil */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    height: 100vh;
    background: #ffffff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    box-shadow: -2px 0 20px rgba(28, 76, 122, 0.15);
    transition: right 0.4s ease;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
    color: var(--brand);
  }

  .nav-links .btn-primary {
    margin-top: 1rem;
    width: 70%;
    text-align: center;
  }
}

/* ========================
   Hero
======================== */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  background: radial-gradient(circle at 25% 30%, rgba(90,164,220,0.15), transparent 70%), 
              linear-gradient(135deg, #f8fbff 0%, #eaf2fb 100%);
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--brand);
}

.highlight {
  color: var(--accent);
}

.hero-text p {
  margin-top: 1rem;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image img {
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 25px rgba(28, 76, 122, 0.15);
}

/* ========================
   Nosotros
======================== */
#nosotros .card {
  border-left: 4px solid var(--brand);
}

#nosotros h3 {
  color: var(--brand);
}

/* ========================
   Servicios
======================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--brand);
  box-shadow: 0 8px 30px rgba(28, 76, 122, 0.15);
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  color: var(--brand);
}

.card p {
  color: var(--text);
  font-size: 0.95rem;
}

/* ========================
   LexiScam
======================== */
#lexiscam {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  color: var(--text);
  padding-top: 6rem;
  padding-bottom: 6rem;
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  margin-bottom: 4rem;
}

.lexi-header {
  text-align: center;
  margin-bottom: 3rem;
}

.lexi-header h2 {
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
}

.lexi-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
}

.lexi-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.lexi-text p {
  line-height: 1.7;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.lexi-benefits {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
}

.lexi-benefits li {
  padding-left: 1.6rem;
  position: relative;
  font-size: 0.95rem;
}

.lexi-benefits li::before {
  content: "•";
  color: var(--brand);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.lexi-cta {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

/* ========================
   LexiScam Chat Interactivo
======================== */
.chat-demo {
  background: linear-gradient(145deg, #ffffff, #eef4fa);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: 0 6px 20px rgba(28, 76, 122, 0.12);
}

.chat-bubble {
  opacity: 0;
  transform: translateY(20px);
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 0.9rem;
  animation: fadeInUp 0.7s ease forwards;
}

.chat-bubble.user {
  background: var(--brand);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  animation-delay: 0.2s;
}

.chat-bubble.ai {
  background: #f1f5f9;
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble:nth-child(2) { animation-delay: 1s; }
.chat-bubble:nth-child(3) { animation-delay: 1.8s; }
.chat-bubble:nth-child(4) { animation-delay: 2.6s; }
.chat-bubble:nth-child(5) { animation-delay: 3.4s; }
.chat-bubble:nth-child(6) { animation-delay: 4.2s; }
.chat-bubble:nth-child(7) { animation-delay: 5s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.lexi-quote {
  margin-top: 2rem;
  font-style: italic;
  color: var(--brand);
  font-size: 1rem;
  text-align: center;
}
/* ========================
   LexiScam Responsive Fix
======================== */

#lexiscam {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  color: var(--text);
  padding: 5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lexi-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.lexi-header h2 {
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.3rem;
  margin-bottom: 0.6rem;
}

.lexi-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.lexi-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 3rem;
}

/* ✅ En pantallas pequeñas: apilar contenido */
@media (max-width: 768px) {
  .lexi-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .lexi-text {
    order: 1;
    width: 100%;
    max-width: 600px;
  }

  .lexi-visual {
    order: 2;
    width: 100%;
    max-width: 380px;
  }

  .chat-demo {
    margin: 0 auto;
  }

  .lexi-quote {
    font-size: 0.95rem;
    margin-top: 1.5rem;
  }
}

/* Extra pequeño (menos de 420px) */
@media (max-width: 420px) {
  .lexi-header h2 {
    font-size: 2rem;
  }

  .lexi-subtitle {
    font-size: 1rem;
  }

  .lexi-text p {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}

/* ========================
   Casos / Clientes
======================== */
#casos .card h3 {
  color: var(--brand);
}

/* ========================
   Contacto
======================== */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--brand);
  outline: none;
}

/* ========================
   Botones
======================== */
.btn-primary,
.btn-outline {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 10px rgba(28, 76, 122, 0.15);
}

.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 6px 16px rgba(28, 76, 122, 0.25);
}

.btn-outline {
  border: 1px solid var(--brand);
  color: var(--brand);
  background: transparent;
}

.btn-outline:hover {
  background: var(--brand);
  color: var(--white);
}

/* ========================
   Footer
======================== */
footer {
  background: #f1f5f9;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========================
   Animaciones suaves
======================== */
.card,
.plan,
.hero-text {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================
   Responsive
======================== */
@media (max-width: 768px) {
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 4rem 1rem 3rem;
    min-height: 90vh;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .hero-text h1 {
    font-size: 1.8rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.8rem;
  }

  .hero-text p {
    font-size: 1rem;
    color: var(--muted);
    max-width: 90%;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
  }

  .hero-buttons a {
    width: 85%;
    max-width: 300px;
    font-size: 0.95rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
  }

  .hero-image {
    order: -1; /* Imagen arriba del texto */
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
  }

  .hero-image img {
    width: 85%;
    max-width: 320px;
    border-radius: 16px;
    border: 1px solid rgba(28, 76, 122, 0.1);
    box-shadow: 0 6px 18px rgba(28, 76, 122, 0.12);
  }
  .hero, .hero-text, .hero-image {
  transition: all 0.4s ease-in-out;
}
}

/* Teléfonos muy pequeños */
@media (max-width: 420px) {
  .hero-text h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }
  .hero-buttons a {
    width: 100%;
  }
}

/* ========================
   Toast Notifications (UX)
======================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: var(--brand);
  color: white;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(28, 76, 122, 0.25);
}
.toast.error {
  background: #dc2626;
}
.toast.success {
  background: #16a34a;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ========================
   Planes LexiScam UX/UI
======================== */
#planes-lexi {
  background: #f9fbfd; /* fondo claro */
  color: var(--text);
  position: relative;
  z-index: 2;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

#planes-lexi h2 {
  color: var(--brand);
}
.planes-grupo {
  margin-bottom: 5rem;
}

.planes-subtitle {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 2rem;
  color: var(--brand);
}

.planes-subtitle.muted {
  color: var(--muted);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.plan {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plan:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 25px rgba(28, 76, 122, 0.15);
}

.plan h4 {
  font-size: 1.3rem;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.plan .price {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0.8rem 0 1.2rem;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  color: var(--text);
}

.plan ul li {
  margin-bottom: 0.5rem;
}

.plan.featured {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: white;
}

.plan.featured h4,
.plan.featured .price {
  color: white;
}

.plan.featured ul li {
  color: rgba(255, 255, 255, 0.9);
}

.planes-benefits {
  text-align: center;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}

.planes-benefits h3 {
  color: var(--brand);
  margin-bottom: 1rem;
}

.planes-benefits ul {
  list-style: none;
  color: var(--text);
  line-height: 1.8;
}

/* ========================
   Fade suave de secciones (UX)
======================== */
.fade-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.fade-visible {
  opacity: 1 !important;
  transform: translateY(0);
}

/* ========================
   Planes Tabs Interactivas
======================== */
.planes-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--card);
  color: var(--brand);
  border: 1px solid var(--brand);
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: var(--brand);
  color: var(--white);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: var(--white);
  border: none;
  box-shadow: 0 4px 10px rgba(28, 76, 122, 0.2);
}

/* Ocultar grupos inactivos */
.hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

/* Mostrar con animación */
.planes-grupo.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
/* ========================
   Formulario de Registro LexiScam
======================== */
.registro-form {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: var(--white);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(28, 76, 122, 0.05);
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.registro-form label {
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.registro-form input,
.registro-form select {
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-alt);
}

.registro-form input:focus,
.registro-form select:focus {
  border-color: var(--brand);
  outline: none;
}

.form-group.center {
  text-align: center;
}

.terms {
  font-size: 0.9rem;
}

.terms a {
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ========================
   Modal de Términos
======================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.hidden { display: none; }

.modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#previewImage {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.close-btn {
  align-self: flex-end;
  font-size: 1.8rem;
  cursor: pointer;
  color: #1c4c7a;
  font-weight: bold;
}
.preview-frame {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-top: 1rem;
  object-fit: contain;      /* ajusta sin recortar */
  overflow: auto;
  transform: scale(1);
  transition: transform 0.3s ease;
  cursor: zoom-in;
}
.preview-frame.zoomed {
  transform: scale(1.8);    /* nivel de zoom */
  cursor: zoom-out;
}

/* 🔹 Encabezado */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* 🔹 Sección izquierda (logo + datos usuario) */
.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* 🔹 Logo más grande y proporcional */
header img {
  height: 70px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* 🔹 Texto del usuario */
.user-header {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
  font-size: 0.95rem;
  color: var(--text);
}

.user-header strong {
  color: var(--brand);
}

.plan-text {
  color: var(--muted);
  font-size: 0.9rem;
}

/* 🔹 Botón de cerrar sesión */
#logout {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#logout:hover {
  background: var(--brand-hover);
  box-shadow: 0 4px 10px rgba(28, 76, 122, 0.2);
}

/* 🔹 Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  header img {
    height: 60px;
  }

  #logout {
    align-self: flex-start;
  }
}