/*!
 * Grupo NetBlu — estilos propios
 * Complementa a Tailwind: tokens, foco accesible, componentes y motion.
 * Los valores de color replican los del theme de Tailwind (assets/js/tw-config.js).
 */

:root {
  --nb-bg: #05070A;
  --nb-bg2: #070B14;
  --nb-surface: #0B111C;
  --nb-surface2: #101A28;
  --nb-border: #18232F;
  --nb-border2: #24344A;
  --nb-text: #E6EDF3;
  --nb-muted: #94A3B8;
  --nb-cyan: #22D3EE;
  --nb-cyan-soft: #67E8F9;
  --nb-cyan-deep: #0EA5E9;
  --nb-green: #93D50A;
  --nb-navy: #011689;

  --nb-header-h: 72px;
  color-scheme: dark;
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nb-header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--nb-bg);
  color: var(--nb-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* El navegador no debe pintar blanco al hacer overscroll en móvil. */
html, body { background-color: var(--nb-bg); }

::selection {
  background: rgba(34, 211, 238, 0.28);
  color: #fff;
}

/* -------------------------------------------------------------------------
   Accesibilidad
   ------------------------------------------------------------------------- */

/* Un anillo de foco visible y consistente en todo el sitio. */
:focus-visible {
  outline: 3px solid var(--nb-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}
/* Solo se retira el outline por defecto cuando ya existe :focus-visible. */
:focus:not(:focus-visible) { outline: none; }

.nb-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--nb-cyan);
  color: #04121A;
  font-weight: 600;
  transition: top 0.18s ease-out;
}
.nb-skip:focus { top: 16px; }

.nb-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------
   Superficies y componentes
   ------------------------------------------------------------------------- */

.nb-grid-bg {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 78% 70% at 50% 22%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 78% 70% at 50% 22%, #000 30%, transparent 78%);
}

.nb-card {
  position: relative;
  background:
    linear-gradient(160deg, rgba(34, 211, 238, 0.05) 0%, rgba(11, 17, 28, 0) 55%),
    var(--nb-surface);
  border: 1px solid var(--nb-border);
  border-radius: 14px;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.nb-card:hover {
  border-color: var(--nb-border2);
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -26px rgba(2, 132, 199, 0.5);
}
/* Tarjeta cuyo enlace cubre toda la superficie. */
.nb-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.nb-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--nb-cyan);
  font-size: 1.05rem;
  flex: none;
}
.nb-icon-box--green {
  background: rgba(147, 213, 10, 0.10);
  border-color: rgba(147, 213, 10, 0.26);
  color: var(--nb-green);
}

.nb-eyebrow {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nb-cyan);
}

.nb-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  background: rgba(34, 211, 238, 0.07);
  font-size: 0.8125rem;
  color: #CFFAFE;
}

.nb-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--nb-cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16);
  flex: none;
}

/* Botones ---------------------------------------------------------------- */

.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.nb-btn:active { transform: translateY(1px); }

.nb-btn-primary {
  background: var(--nb-cyan);
  color: #04121A;
  border: 1px solid var(--nb-cyan);
}
.nb-btn-primary:hover { background: var(--nb-cyan-soft); border-color: var(--nb-cyan-soft); }

.nb-btn-ghost {
  background: transparent;
  color: var(--nb-text);
  border: 1px solid var(--nb-border2);
}
.nb-btn-ghost:hover { border-color: var(--nb-cyan); color: var(--nb-cyan-soft); }

.nb-btn-green {
  background: var(--nb-green);
  color: #0B1400;
  border: 1px solid var(--nb-green);
}
.nb-btn-green:hover { background: #B6EE3C; border-color: #B6EE3C; }

.nb-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--nb-cyan);
  font-weight: 600;
  font-size: 0.9375rem;
}
.nb-link-arrow i { transition: transform 0.18s ease; }
.nb-link-arrow:hover i,
.nb-card:hover .nb-link-arrow i { transform: translateX(4px); }

/* Navegación ------------------------------------------------------------- */

.nb-header {
  background: rgba(5, 7, 10, 0.72);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.nb-header[data-scrolled="true"] {
  background: rgba(5, 7, 10, 0.94);
  border-bottom-color: var(--nb-border);
}

.nb-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.15rem;
  font-size: 0.9375rem;
  color: #CBD5E1;
  transition: color 0.18s ease;
}
.nb-nav-link:hover { color: var(--nb-text); }
.nb-nav-link[aria-current="page"] { color: var(--nb-cyan); }
.nb-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--nb-cyan);
}

.nb-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 300px;
  padding: 0.5rem;
  border-radius: 14px;
  background: #080E17;
  border: 1px solid var(--nb-border);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}
.nb-dropdown[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nb-dropdown a {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  transition: background-color 0.16s ease;
}
.nb-dropdown a:hover { background: rgba(34, 211, 238, 0.08); }

.nb-drawer {
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nb-drawer[data-open="true"] { transform: translateX(0); }

/* Formularios ------------------------------------------------------------ */

.nb-field {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: #070C14;
  border: 1px solid var(--nb-border2);
  color: var(--nb-text);
  font-size: 0.9375rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.nb-field::placeholder { color: #5B6B7F; }
.nb-field:hover { border-color: #31445E; }
.nb-field:focus {
  border-color: var(--nb-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
  outline: none;
}
.nb-field[aria-invalid="true"] {
  border-color: #F87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.14);
}
/* La flecha nativa del select se pinta clara para que se vea sobre el fondo. */
select.nb-field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394A3B8'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 20px;
  padding-right: 2.5rem;
}
select.nb-field option { background: #070C14; color: var(--nb-text); }

.nb-error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: #FCA5A5;
}
.nb-error[data-visible="true"] { display: block; }

.nb-alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  font-size: 0.9375rem;
}
.nb-alert-ok    { background: rgba(147, 213, 10, 0.10); border: 1px solid rgba(147, 213, 10, 0.34); color: #D9F99D; }
.nb-alert-error { background: rgba(248, 113, 113, 0.09); border: 1px solid rgba(248, 113, 113, 0.32); color: #FECACA; }

/* Texto largo ------------------------------------------------------------ */

.nb-prose p { margin-bottom: 1.15rem; color: var(--nb-muted); }
.nb-prose p:last-child { margin-bottom: 0; }
.nb-prose strong { color: var(--nb-text); font-weight: 600; }
.nb-prose a { color: var(--nb-cyan); text-decoration: underline; text-underline-offset: 3px; }

/* Línea de tiempo -------------------------------------------------------- */

.nb-timeline { position: relative; }
.nb-timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--nb-cyan) 0%, rgba(34, 211, 238, 0.35) 45%, rgba(147, 213, 10, 0.45) 100%);
}
@media (min-width: 1024px) {
  .nb-timeline::before { left: 50%; transform: translateX(-1px); }
}

/* Mapa del hero ---------------------------------------------------------- */

.nb-map-dot circle.nb-map-ping {
  transform-origin: center;
  animation: nb-ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes nb-ping {
  0%   { transform: scale(0.6); opacity: 0.85; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Barra de desplazamiento ------------------------------------------------ */

@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--nb-bg); }
  ::-webkit-scrollbar-thumb {
    background: #1D2A3A;
    border: 3px solid var(--nb-bg);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-thumb:hover { background: #2B3D53; }
}

/* Carrusel horizontal con desplazamiento táctil --------------------------- */

.nb-scroller {
  scrollbar-width: thin;
  scrollbar-color: #1D2A3A var(--nb-bg);
  scroll-snap-type: x mandatory;
}
.nb-scroller > * { scroll-snap-align: start; }

/* -------------------------------------------------------------------------
   Movimiento reducido
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* AOS deja los elementos ocultos si nunca se anima: se fuerzan visibles. */
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
  .nb-card:hover { transform: none; }
}

/* -------------------------------------------------------------------------
   Impresión
   ------------------------------------------------------------------------- */

@media print {
  .nb-header, .nb-drawer, .nb-skip, footer .nb-social { display: none !important; }
  body { background: #fff; color: #000; }
  .nb-card { border-color: #ccc; }
}
