/* =========================================================
   Neura Cloud — components.css
   Header, tarjetas, listas, sliders, acordeón, modal, mockup
   ========================================================= */

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(247, 250, 251, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -18px rgba(13, 42, 51, 0.25);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  /* 700 como en el portal: la marca va en font-bold tanto en la barra lateral
     como en la cabecera móvil (components/layout/shell.js). Estaba en 500. */
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  /* Tinta, no verde: 'Cloud' es quien lleva el color de marca. En el pie,
     .footer-brand .brand vuelve a ponerlo en blanco sobre fondo oscuro. */
  color: var(--ink);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav > a {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.site-nav > a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--ink);
}

/* El corte estaba en 990px, que ya iba justo con cinco enlaces. Al añadir
   "Contacto" (53px más) la barra dejaba de caber: medido a 991px, los botones
   se salían 32px del contenedor y la marca se comprimía de 153 a 117px, con
   "Iniciar sesión" cortado. La cabecera necesita un contenedor de 1000px para
   respirar, que equivale a ~1063px de ventana; se sube a 1080 con margen.
   Por debajo de eso entra el menú hamburguesa, que ahí ya es lo razonable. */
@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 24px 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav > a {
    padding: 12px 4px;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .nav-actions {
    margin: 16px 0 0;
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Tarjetas ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.25s ease;
}

.card:hover {
  border-color: #cfe0e6;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card--panel {
  background: var(--panel);
  border-color: var(--panel);
  color: var(--on-panel);
}

.card--panel:hover {
  border-color: var(--panel);
}

.card--panel h3 {
  color: var(--on-panel);
}

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand-deep);
  margin-bottom: 20px;
}

.chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---------- Listas con iconos ---------- */

.check-list li,
.cross-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-block: 14px;
}

.check-list li + li,
.cross-list li + li {
  border-top: 1px solid var(--line);
}

.card--panel .check-list li + li {
  border-top-color: var(--on-panel-line);
}

.check-list .li-icon,
.cross-list .li-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-top: 1px;
}

/* El glifo se dimensiona aquí, no en el atributo del SVG: así los tres
   iconos de la lista mantienen la misma proporción respecto al círculo
   sin depender de lo que traiga cada marca en el HTML. */
.check-list .li-icon svg,
.cross-list .li-icon svg {
  width: 18px;
  height: 18px;
}

.check-list .li-icon {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

.card--panel .check-list .li-icon {
  background: var(--brand-tint);
  color: var(--brand);
}

.cross-list .li-icon {
  background: #eef2f4;
  color: var(--ink-faint);
}

.li-title {
  font-weight: 600;
  font-size: 0.97rem;
}

.li-text {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.card--panel .li-text {
  color: var(--on-panel-muted);
}

/* ---------- Sliders (calculadora) ---------- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(13, 42, 51, 0.3);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(13, 42, 51, 0.3);
}

/* ---------- Acordeón FAQ ---------- */

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary svg {
  flex-shrink: 0;
  color: var(--ink-faint);
  transition: transform 0.25s ease;
}

.faq-item[open] summary svg {
  transform: rotate(45deg);
  color: var(--brand);
}

.faq-item p {
  padding: 0 4px 24px;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* Salida al final del FAQ: es donde el visitante ya buscó su respuesta y no
   la encontró, así que es el mejor momento para ofrecerle el contacto. */
.faq-more {
  margin: 32px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.faq-more a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-more a:hover {
  color: var(--brand-deep);
}

/* ---------- Mockup de navegador ---------- */

.mockup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mockup-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.mockup-bar > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.mockup-url {
  margin-left: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.mockup-body {
  position: relative;
}

/* La captura se muestra ENTERA. Forzarle una caja 16/10 con object-fit:
   cover recortaba los lados de una imagen de ratio 2.09 y la dejaba
   ampliada y falsamente vertical: se veían dos tarjetas gigantes en vez
   del panel. Un marco de navegador que recorta la página deja de leerse
   como un navegador. */
.mockup-body img {
  display: block;
  width: 100%;
  height: auto;
}

.mockup-play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(14, 40, 48, 0.88);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mockup:hover .mockup-play {
  background: var(--brand);
  transform: translateY(-2px);
}

/* ---------- Modal de video ---------- */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 40, 48, 0.8);
  backdrop-filter: blur(4px);
}

.video-modal-box {
  position: relative;
  width: min(960px, 100%);
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-lg);
}

.video-modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
}

.video-frame {
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-md) - 8px);
  overflow: hidden;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Popup de salida ---------- */

.exit-popup {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.exit-popup.is-open {
  opacity: 1;
  pointer-events: auto;
}

.exit-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 40, 48, 0.6);
  backdrop-filter: blur(4px);
}

.exit-popup-box {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 34px 32px 24px;
  text-align: left;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.exit-popup.is-open .exit-popup-box {
  transform: none;
}

.exit-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-faint);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.exit-popup-close:hover {
  color: var(--ink);
  background: var(--paper);
}

.exit-popup-eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.exit-popup-box h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.16;
  text-wrap: balance;
}

.exit-popup-lead {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Las dos cifras que el propio visitante acaba de calcular. Son el argumento
   del dialogo, asi que ocupan el lugar que antes tenia un icono decorativo. */
.exit-popup-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.exit-figure {
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.exit-figure strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}

.exit-figure span {
  display: block;
  margin-top: 7px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.exit-popup-note {
  margin-top: 12px;
  font-size: 0.74rem;
  color: var(--ink-faint);
  text-align: center;
}

.exit-popup-box p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.exit-popup-box strong {
  color: var(--brand-deep);
  font-weight: 700;
}

.exit-popup-box .btn {
  width: 100%;
  margin-top: 22px;
}

.exit-popup-dismiss {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--ink-faint);
  transition: color 0.2s ease;
}

.exit-popup-dismiss:hover {
  color: var(--ink-soft);
  text-decoration: underline;
}

/* Logotipo bicolor: 'Neura' toma el color del contenedor (blanco sobre
   fondo oscuro, tinta sobre fondo claro) y 'Cloud' va siempre en el verde
   de marca. Clase propia a proposito: Tailwind aqui es estatico y una
   utilidad nueva obligaria a recompilar. */
.nc-cloud { color: #008791; }
