/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f3f6fb;
    color: #111827;
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

/* Links */
a {
    color: #1D71B8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== TOPBAR ========== */
.topbar {
    background: #0f4478;
    color: #e5f2ff;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo {
    width: 60px;
    height: auto;
}

.topbar-brand {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: .02em;
}

.topbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
}

.topbar-nav a {
    color: #e5f2ff;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 999px;
}

.topbar-nav a:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ========== HERO ========== */
.hero {
    background: radial-gradient(circle at top left, #36A9E1 0, #1D71B8 45%, #0f4478 100%);
    color: #f9fbff;
    padding: 40px 16px 32px;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
}

.hero-text h1 {
    margin: 8px 0 10px;
    font-size: 2.1rem;
    font-weight: 800;
}

.hero-subtitle {
    margin: 0 0 14px;
    max-width: 620px;
    color: #e6f3ff;
}

.kicker {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: .14em;
    font-weight: 600;
    color: #F9B233;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 10px;
}

.hero-bullets {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: #d9ebff;
}

.hero-bullets li+li {
    margin-top: 4px;
}

.hero-media {
    display: flex;
    justify-content: center;
}

.hero-img-wrap {
    background: radial-gradient(circle at center, #ffffff 0, #dbeafe 55%, #1D71B8 100%);
    padding: 14px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.hero-img-wrap img {
    border-radius: 18px;
}

/* ========== BOTONES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.icon-img {
    width: 20px;
    height: 20px;
}

/* WhatsApp principal */
.btn-wa {
    background: #25D366;
    color: #ffffff;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    position: relative;
    overflow: visible;
    animation: waPulse 2.4s ease-in-out infinite, waBounce 3.2s ease-in-out infinite;
}

.btn-wa:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
}

/* Halo de WhatsApp */
@keyframes waPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Saltito */
@keyframes waBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.04); }
}

.btn-ghost {
    background: #009FE3;
    color: #fff;
    border: 1px solid #36A9E1
}

.btn-ghost:hover {
    background: #1D71B8;
    color: #F39200;
}

/* Botón de descarga */
.btn-download {
    background: #1D71B8;
    color: #ffffff;
    box-shadow: 0 0 0 0 rgba(29, 113, 184, 0.4);
    position: relative;
    overflow: visible;
    animation: dlPulse 2.4s ease-in-out infinite, dlBounce 3.4s ease-in-out infinite;
}

.btn-download:hover {
    transform: translateY(-1px) scale(1.02);
}

/* Halo descarga */
@keyframes dlPulse {
    0% { box-shadow: 0 0 0 0 rgba(29, 113, 184, 0.5); }
    70% { box-shadow: 0 0 0 18px rgba(29, 113, 184, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 113, 184, 0); }
}

@keyframes dlBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.03); }
}

.btn-wa-full {
    width: 100%;
    justify-content: center;
}

/* ========== LAYOUT GENERAL ========== */
.main {
    padding: 28px 16px 40px;
}

.layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 20px 18px;
    box-shadow: 0 12px 25px rgba(15, 37, 73, 0.09);
    margin-bottom: 18px;
}

.card h2 {
    margin: 0 0 10px;
    font-size: 1.4rem;
    color: #0f4478;
}

.card-intro {
    margin-top: 0;
    margin-bottom: 12px;
    color: #4b5563;
    font-size: 0.95rem;
}

/* Beneficios */
.benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.benefit h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: #1D71B8;
}

.benefit p {
    margin: 0;
    font-size: 0.93rem;
    color: #4b5563;
}

/* Incluye */
.includes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.include h3 {
    margin: 8px 0 4px;
    font-size: 1rem;
    color: #1D71B8;
}

.include p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.img-box {
    background: #f3f7fe;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-box img {
    max-height: 180px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.img-box img:hover {
    transform: scale(1.05);
}

/* Reseña */
.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr);
    gap: 18px;
    align-items: center;
}

.review-img {
    border-radius: 16px;
}

blockquote {
    margin: 0;
    font-size: 0.98rem;
    color: #374151;
}

.review-author {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    color: #1D71B8;
}

/* Galería envíos */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.media-box {
    text-align: center;
}

.media-box video,
.media-box img {
    border-radius: 14px;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.media-box p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Centro de aprendizaje */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(15, 37, 73, 0.15);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-box p {
    margin: 6px 0 0;
    font-size: 0.92rem;
    color: #374151;
}

.download-wrap {
    margin-top: 10px;
}

/* Blog */
.blog {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.blog article h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #1D71B8;
}

.blog article p {
    margin: 0;
    font-size: 0.93rem;
    color: #4b5563;
}

/* FAQ */
.faq details {
    background: #f4f7fc;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: #1D71B8;
    font-size: 0.95rem;
}

.faq p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Aside */
.sticky-card {
    position: sticky;
    top: 80px;
}

.checklist {
    list-style: none;
    padding-left: 0;
    margin: 12px 0 0;
    font-size: 0.9rem;
    color: #374151;
}

.checklist li+li {
    margin-top: 4px;
}

.asistente-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ========== FOOTER ========== */
.footer {
    background: #0f172a;
    color: #e5e7eb;
    padding-top: 18px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 60px;
    border-radius: 14px;
}

.footer-title {
    margin: 0 0 2px;
    font-weight: 600;
}

.footer-text {
    margin: 0;
    font-size: 0.86rem;
    color: #9ca3af;
}

.footer-links {
    display: flex;
    gap: 10px;
}

.footer-links img {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.7));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.footer-links a:hover img {
    transform: scale(1.1) translateY(-1px);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 1));
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    text-align: center;
    padding: 8px 16px 10px;
    font-size: 0.78rem;
    color: #9ca3af;
}

/* ========== BOTÓN FLOTANTE WHATSAPP ========== */
.floating-wa {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #25D366;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    animation: waPulse 2.4s ease-in-out infinite, waBounce 3.2s ease-in-out infinite;
}

.floating-wa img {
    width: 20px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .hero-content { grid-template-columns: minmax(0, 1fr); }
    .hero { padding-top: 26px; }
    .hero-text h1 { font-size: 1.7rem; }
    .layout { grid-template-columns: minmax(0, 1fr); }
    .sticky-card { position: static; }
}

@media (max-width: 640px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .topbar-nav { justify-content: flex-start; }
    .hero-cta { flex-direction: column; align-items: flex-start; }

    .btn, .btn-wa, .btn-download {
        width: 100%;
        justify-content: center;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .floating-wa {
        right: 10px;
        left: 10px;
        justify-content: center;
    }

    .review-layout { grid-template-columns: minmax(0, 1fr); }
    .media-box video, .media-box img { height: 190px; }
}

/* ====== ✅ CORRECCIÓN FINAL — CENTRADO DEL BOTÓN DEL ASISTENTE JL Ai ====== */
#asistente {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

#asistente .btn-chat-open {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    margin: 1rem auto 0 auto;
    background: #36A9E1;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(29, 113, 184, 0.4);
    transition: all 0.25s ease-in-out;
    animation: aiPulse 3s ease-in-out infinite;
}

#asistente .btn-chat-open:hover {
    background: #F9B233;
    box-shadow: 0 0 15px rgba(249, 178, 51, 0.6);
    transform: scale(1.06);
}

@keyframes aiPulse {
    0% { box-shadow: 0 0 0 0 rgba(54, 169, 225, 0.6); }
    70% { box-shadow: 0 0 0 12px rgba(54, 169, 225, 0); }
    100% { box-shadow: 0 0 0 0 rgba(54, 169, 225, 0); }
}

/* =========================================================
   ✅ JL AI CHAT (CORREGIDO, SIN DUPLICADOS, MOBILE OK)
   ========================================================= */

/* Overlay */
.chat-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  z-index: 9999;
  padding: 16px;
}
.chat-overlay.chat-open{
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

/* Ventana */
.chat-window{
  width: min(420px, 100%);
  height: min(640px, 85vh);
  background: #ffffff;
  color: #111827;
  border-radius: 18px;
  overflow: hidden;                 /* ✅ recorta TODO (la esquina) */
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

/* Header */
.chat-header{
  padding: 14px 14px;
  background: linear-gradient(90deg, #1D71B8, #36A9E1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title{
  font-weight: 800;
  font-size: 18px;
  margin: 0;
  line-height: 1.1;
  color: #ffffff;
}
.chat-subtitle{
  margin: 4px 0 0;
  font-size: 13px;
  opacity: .92;
  color: #ffffff;
}

.chat-close{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
}

/* Mensajes */
.chat-window #jlai-messages{
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #f3f6fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-window .msg{ display: flex; }
.chat-window .msg.bot{ justify-content: flex-start; }
.chat-window .msg.user{ justify-content: flex-end; }

.chat-window .bubble{
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  border: 1px solid #e5e7eb;
}

.chat-window .msg.user .bubble{
  background: #dcfce7;
  border-color: #86efac;
}

/* Form (parte inferior) */
.chat-window #jlai-form{
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  margin: 0;                        /* ✅ evita “cuadros” raros */
}

/* Input */
.chat-window #jlai-text{
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  outline: none;
  font-size: 16px;                  /* ✅ clave móvil (evita zoom iOS) */
}
.chat-window #jlai-text::placeholder{
  color: #6b7280;
}

/* Botón enviar */
.chat-window #jlai-form button{
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  background: #22c55e;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  font-size: 16px;                  /* ✅ consistente en móvil */
}

/* Responsive específico del chat */
@media (max-width: 640px){
  .chat-overlay{
    padding: 10px;
    justify-content: center;         /* ✅ en celular centrado */
  }
  .chat-window{
    width: 100%;
    height: min(560px, 80vh);        /* ✅ no se rompe */
    border-radius: 16px;
  }
}


/* ===== JL AI AUTH (código cliente) ===== */
.chat-window .jlai-auth{
  padding: 12px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}
.chat-window .jlai-auth-row{
  display: flex;
  gap: 8px;
}
.chat-window #jlai-code{
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 16px; /* evita zoom en móvil */
}
.chat-window #jlai-code-btn{
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  background: #1D71B8;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-size: 16px;
}
.chat-window .jlai-auth-msg{
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
}

