/* ==========================================================================
   NeuralV v6 — SECCIONES DE LA HOME
   ========================================================================== */

/* --- Portada ------------------------------------------------------------- */
.hero { padding: var(--s-8) 0 var(--s-7); text-align: center; }

.hero h1 { margin-bottom: var(--s-3); }
.hero .lead { max-width: 620px; margin: 0 auto var(--s-4); }
.hero-cta { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }

.hero-pie {
    display: flex;
    justify-content: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    margin-top: var(--s-4);
    font-size: var(--t-small);
    color: var(--ink-soft);
}

.hero-pie span { display: inline-flex; align-items: center; gap: 0.4rem; }

.hero-demo { margin-top: var(--s-6); }

/* --- Imagen de portada, con la llamada flotando encima ------------------ */
.hero-visual { position: relative; margin-top: var(--s-5); }

.hero-img {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-img img {
    width: 100%;
    /* height:auto es imprescindible: los atributos width/height del <img> se
       aplican como estilo y bloquearían el aspect-ratio. */
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center 38%;
    display: block;
}

/* En pantalla ancha la tarjeta de la llamada se superpone a la foto:
   da profundidad y demuestra el producto sobre la escena. */
@media (min-width: 1000px) {
    .hero-visual .hero-flotante {
        position: absolute;
        right: -12px;
        bottom: -48px;
        width: 380px;
        margin: 0;
        z-index: 2;
    }
    .hero-visual { margin-bottom: var(--s-6); }
}

/* --- Imagen dentro de un bloque de producto ----------------------------- */
.showcase-img {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.showcase-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease);
}

.showcase-img:hover img { transform: scale(1.04); }

/* Pieza de producto anclada sobre la imagen: deja ver la escena por arriba
   y aporta la prueba de producto por abajo. */
.showcase-img { min-height: 460px; }

.showcase-img .flotante {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.showcase-img .flotante .device-body { padding: var(--s-2); }
.showcase-img .flotante .tabla td { padding: 0.6rem 0.75rem; font-size: var(--t-micro); }

/* --- Banda de imagen a todo el ancho ------------------------------------ */
.banda {
    position: relative;
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    color: #fff;
}

.banda-img { position: absolute; inset: 0; }
.banda-img img { width: 100%; height: 100%; object-fit: cover; }
.banda::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.7)); }
.banda .wrap { position: relative; z-index: 2; }
.banda h2 { color: #fff; }
.banda .lead { color: rgba(255, 255, 255, 0.82); }
.banda .eyebrow { color: rgba(255, 255, 255, 0.6); }

/* Banda "última entrada del blog": mismo componente .banda, con un badge y un
   botón ghost adaptado a fondo oscuro (.section-dark .btn-ghost ya existe en
   base.css pero .banda no lleva esa clase) */
.banda-tag {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: #fff; background: var(--brand); padding: 0.3rem 0.7rem; border-radius: 999px;
    margin-bottom: var(--s-2);
}
.banda .btn-ghost { border-color: var(--line-dark); color: #fff; }
.banda .btn-ghost:hover { background: #fff; color: var(--ink); }

/* --- Recursos gratuitos (LOPD + Interruptómetro) ------------------------ */
.recurso {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.recurso .badge {
    align-self: flex-start;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: var(--t-micro);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--s-2);
}

.badge-alert { background: rgba(215, 38, 61, 0.1); color: var(--alert); }
.badge-warn { background: rgba(180, 120, 10, 0.12); color: var(--warn); }
.recurso p { flex-grow: 1; margin-bottom: var(--s-2); }

/* --- Problemas ----------------------------------------------------------- */
.problema { display: flex; gap: var(--s-2); align-items: flex-start; }
.problema .icon { flex-shrink: 0; margin-top: 3px; color: var(--ink-faint); }
.problema h3 { font-size: var(--t-body); margin-bottom: 0.2rem; }
.problema p { font-size: var(--t-small); color: var(--ink-soft); }

/* --- Bloque de producto: texto + pieza ---------------------------------- */
.showcase {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: var(--s-6);
    align-items: center;
}

.showcase-rev .showcase-txt { order: 2; }
.showcase h2 { margin-bottom: var(--s-2); }
.showcase .lead { margin-bottom: var(--s-3); }

.lista-check { margin-bottom: var(--s-3); }

.lista-check li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: var(--t-body);
}

.lista-check .icon { flex-shrink: 0; margin-top: 4px; color: var(--brand); }

/* --- Cómo funciona: pasos numerados ------------------------------------- */
.paso { position: relative; padding-top: var(--s-3); border-top: 2px solid var(--ink); }
.section-alt .paso { border-color: var(--ink); }

.paso-num {
    font-size: var(--t-micro);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    margin-bottom: var(--s-1);
}

.paso h3 { font-size: var(--t-body-lg); margin-bottom: 0.4rem; }
.paso p { font-size: var(--t-small); color: var(--ink-soft); }

/* --- Sectores ------------------------------------------------------------ */
.sector { display: flex; flex-direction: column; gap: 0.6rem; }
.sector .icon { color: var(--brand); }
.sector h3 { font-size: var(--t-body); }
.sector p { font-size: var(--t-small); color: var(--ink-soft); }

/* --- Grupo NeuralV ------------------------------------------------------- */
.grupo { display: flex; flex-direction: column; height: 100%; }
.grupo-marca { display: flex; align-items: center; gap: 0.7rem; height: 44px; margin-bottom: var(--s-2); }
.grupo-marca img { height: 100%; width: auto; object-fit: contain; }
.grupo-marca span { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.grupo-nc span b { color: #1565c0; }
.grupo-nr span b { color: #00a8b5; }
.grupo p { flex-grow: 1; margin-bottom: var(--s-2); }
.grupo .lista-check li { font-size: var(--t-small); }
.grupo-nc .lista-check .icon { color: #1565c0; }
.grupo-nr .lista-check .icon { color: #00a8b5; }

/* --- Fundador ------------------------------------------------------------ */
.fundador { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--s-6); align-items: center; }
.fundador-cita { font-size: var(--t-body-lg); line-height: 1.5; letter-spacing: -0.01em; }
.fundador-cita p + p { margin-top: var(--s-2); }
.fundador-firma { margin-top: var(--s-3); font-size: var(--t-small); }
.fundador-firma b { display: block; font-size: var(--t-body); }
.fundador-foto { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* --- Formulario final ---------------------------------------------------- */
.demo-box {
    max-width: 640px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
    box-shadow: var(--shadow-lg);
}

.section-dark .demo-box { background: var(--surface-dark-alt); border: 1px solid var(--line-dark); }
.section-dark .demo-box .input,
.section-dark .demo-box .select,
.section-dark .demo-box .textarea {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line-dark);
    color: #fff;
}

/* El desplegable nativo del navegador NO hereda el fondo oscuro del .select
   (dibuja sus <option> con el fondo claro del sistema): sin esto, el texto
   blanco queda ilegible sobre ese fondo claro al abrirlo. */
.section-dark .demo-box .select option {
    color: var(--ink);
    background: var(--surface);
}

.section-dark .demo-box .input::placeholder,
.section-dark .demo-box .textarea::placeholder { color: #86868b; }
.demo-nota { font-size: var(--t-micro); color: var(--ink-faint); text-align: center; margin-top: var(--s-2); }

/* --- Chatbot (mismos ids que script.js) --------------------------------- */
.chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem 0.6rem 0.6rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: var(--t-small);
    transition: transform 0.3s var(--ease);
}

.chat-launcher:hover { transform: translateY(-2px); }
.chat-launcher img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 960;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 48px));
    display: none;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chat-widget.active { display: flex; }

.chat-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: var(--s-2);
    background: var(--ink);
    color: #fff;
}

.chat-head img { width: 34px; height: 34px; border-radius: 50%; }
.chat-head b { font-size: var(--t-small); }
.chat-head small { display: block; font-size: var(--t-micro); opacity: 0.7; }
.chat-close { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.2rem; line-height: 1; }
.chat-body { flex-grow: 1; overflow-y: auto; padding: var(--s-2); display: flex; flex-direction: column; gap: 0.6rem; }
.chat-foot { display: flex; gap: 0.5rem; padding: var(--s-2); border-top: 1px solid var(--line); }
.chat-foot .input { padding: 0.7rem 0.9rem; font-size: var(--t-small); }

.chat-send {
    flex-shrink: 0;
    width: 42px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    cursor: pointer;
}

/* El indicador de escritura vive DENTRO de #chatBody y script.js lo controla
   con la clase "hidden" (script.js:70 y :91). */
.typing { display: flex; gap: 3px; padding: 0.6rem 0.9rem; }
.typing.hidden { display: none; }

/* Burbujas que crea script.js: .message.user-message / .message.ai-message */
.message { max-width: 85%; }
.message p {
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    font-size: var(--t-small);
    line-height: 1.45;
}

.user-message { align-self: flex-end; }
.user-message p { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.ai-message { align-self: flex-start; }
.ai-message p { background: var(--surface-alt); border-bottom-left-radius: 4px; }
.ai-message.error p { background: rgba(215, 38, 61, 0.1); color: var(--alert); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: onda 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }


/* --- Cookies -------------------------------------------------------------
   script.js inyecta el banner Y sus estilos al final del <head>, así que gana
   por orden. Se recupera el control con especificidad (body #id), sin tocar
   el JS de producción. */
body #cookie-banner {
    background: rgba(29, 29, 31, 0.96) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    font-family: var(--font) !important;
    font-size: var(--t-small) !important;
    color: #f5f5f7 !important;
    padding: 1rem 24px !important;
    gap: var(--s-2) !important;
}

body #cookie-banner a { color: #7ab6ff !important; }

body #cookie-accept {
    background: var(--brand) !important;
    border-radius: var(--radius-pill) !important;
    padding: 0.5rem 1.4rem !important;
    font-weight: 500 !important;
    font-family: var(--font) !important;
}

body #cookie-reject {
    border-radius: var(--radius-pill) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    padding: 0.5rem 1.4rem !important;
    font-family: var(--font) !important;
}

/* --- Modal de producto (ids de script.js) ------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 980;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
}

.modal-overlay.active { display: flex; }

.modal {
    position: relative;
    width: min(680px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* La X queda SIEMPRE fuera del scroll: solo el cuerpo se desplaza */
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.modal-head { padding: var(--s-4) var(--s-4) var(--s-2); }
.modal-body { padding: 0 var(--s-4) var(--s-4); overflow-y: auto; }

/* --- Modales de resultado del formulario (validación / envío) ----------- */
.feedback-modal { width: min(420px, 100%); text-align: center; padding: var(--s-4); }

.feedback-ico, .notification-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--s-2);
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 700;
}

/* script.js hace icon.className = 'notification-icon ' + type: SOLO estas
   dos clases sobreviven a esa asignación, así que el color vive aquí. */
.notification-icon.success { background: rgba(26, 143, 76, 0.1); color: var(--ok); }
.notification-icon.error { background: rgba(215, 38, 61, 0.1); color: var(--alert); }
.feedback-ico { background: rgba(215, 38, 61, 0.1); color: var(--alert); }

.feedback-modal h3 { margin-bottom: 0.4rem; }
.feedback-modal > p { color: var(--ink-soft); margin-bottom: var(--s-3); }

.feedback-list {
    text-align: left;
    margin-bottom: var(--s-3);
    max-height: 220px;
    overflow-y: auto;
}

.feedback-list li {
    padding: 0.55rem 0.8rem;
    margin-bottom: 0.4rem;
    border-radius: var(--radius-sm);
    background: rgba(215, 38, 61, 0.06);
    color: var(--ink);
    font-size: var(--t-small);
}

@media (max-width: 900px) {
    .showcase { grid-template-columns: 1fr; gap: var(--s-4); }
    .showcase-rev .showcase-txt { order: 0; }
    .fundador { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .chat-launcher, .chat-widget { right: 12px; bottom: 12px; }
    /* Igual que en producción: en pantallas muy estrechas el lanzador se
       queda solo con el avatar, sin la etiqueta de texto. */
    .chat-launcher span { display: none; }
    .chat-launcher { padding: 0.5rem; }
    .demo-box { padding: var(--s-3); }
    .cookies-inner { justify-content: center; text-align: center; }
}

/* Transición editorial: separación clara entre demo y blog. */
#demo { padding-bottom: var(--s-6); }
.blog-transition {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 20px var(--s-3);
  background:
    radial-gradient(circle at 50% 0, rgba(8,124,240,.12), transparent 46%),
    linear-gradient(180deg, #f9fcff 0%, #edf6ff 100%);
  border-top: 1px solid rgba(8,124,240,.16);
  border-bottom: 1px solid rgba(8,124,240,.24);
  box-shadow: 0 14px 36px rgba(3,16,31,.16);
}
.blog-transition::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  width: 22px;
  height: 22px;
  background: #edf6ff;
  border-right: 1px solid rgba(8,124,240,.24);
  border-bottom: 1px solid rgba(8,124,240,.24);
  transform: translateX(-50%) rotate(45deg);
}
.blog-transition-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(720px, 100%);
}
.blog-transition-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(8,124,240,.55));
}
.blog-transition-line:last-child {
  background: linear-gradient(90deg, rgba(8,124,240,.55), transparent);
}
.blog-transition-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  color: #075aa9;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(8,124,240,.2);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(8,124,240,.12);
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.blog-transition-label .icon { color: #087cf0; }
/* Artículo destacado: texto e imagen separados para preservar la legibilidad. */
.blog-destacado {
  overflow: hidden;
  color: #fff;
  background: #07182b;
}
.blog-destacado-copy { padding: var(--s-6) 0 var(--s-5); }
.blog-destacado-copy .wrap {
  max-width: 920px;
  margin-inline: auto;
  text-align: left;
}
.blog-destacado h2 {
  max-width: 780px;
  margin-top: var(--s-3);
  color: #fff;
}
.blog-destacado .lead {
  max-width: 780px;
  margin-top: var(--s-3);
  color: rgba(255,255,255,.78);
}
.blog-destacado-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-4);
}
.blog-destacado-link {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.blog-destacado-link:hover { color: #5ca9ff; }
.blog-destacado-media {
  display: block;
  width: min(1280px, 100%);
  margin-inline: auto;
  background: #07182b;
}
.blog-destacado-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
@media (max-width: 720px) {
  #demo { padding-bottom: var(--s-5); }
  .blog-transition { min-height: 76px; padding: 16px var(--s-2); }
  .blog-transition-inner { gap: 10px; }
  .blog-transition-label { padding: 9px 14px; letter-spacing: .07em; }
  .blog-destacado-copy { padding: var(--s-5) 0 var(--s-4); }
  .blog-destacado-actions { gap: var(--s-3); }
}