/* ============================================================
   NexCode UI — base.css
   Tokens de diseño + reset + botones + utilidades compartidas.
   Se carga en TODAS las páginas (via templates/nexcode/base.html).
   ============================================================ */

:root {
  /* Colores de marca */
  --nc-blue: #2E6BF6;
  --nc-blue-dark: #1D4ED8;
  --nc-blue-light: #5B8DFF;
  --nc-ink: #0B1226;
  --nc-ink-soft: #4B5A75;
  --nc-muted: #64748B;
  --nc-bg: #F6F8FC;
  --nc-white: #FFFFFF;
  --nc-deep: #070D1F;
  --nc-navy: #0B1B45;
  --nc-navy-2: #0A2468;
  --nc-green: #4ADE80;
  --nc-whatsapp: #25D366;

  /* Tipografía */
  --nc-font-display: 'Sora', sans-serif;
  --nc-font-body: 'IBM Plex Sans', sans-serif;
  --nc-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Sombras */
  --nc-shadow-xl: 0 32px 90px rgba(2, 8, 30, .32);
  --nc-shadow-card: 0 2px 8px rgba(11, 18, 38, .04);
  --nc-shadow-card-hover: 0 22px 44px rgba(30, 64, 175, .14);

  /* Radios */
  --nc-radius-card: 18px;
  --nc-radius-btn: 12px;
  --nc-radius-input: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nc-bg);
  font-family: var(--nc-font-body);
  color: var(--nc-ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--nc-blue); text-decoration: none; }
a:hover { color: var(--nc-blue-dark); }

/* ===== Animaciones compartidas ===== */
@keyframes ncFloat  { 0% { transform: translateY(0); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0); } }
@keyframes ncFloatB { 0% { transform: translateY(0); } 50% { transform: translateY(10px); }  100% { transform: translateY(0); } }
@keyframes ncPulse  { 0% { opacity: .35; } 50% { opacity: .9; } 100% { opacity: .35; } }
@keyframes ncBlink  { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes ncHeroIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ===== Botones ===== */
.nc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--nc-font-display);
  font-weight: 600;
  border: 0;
  border-radius: var(--nc-radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s;
}

/* Primario: gradiente azul */
.nc-btn--primary {
  background: linear-gradient(135deg, var(--nc-blue), var(--nc-blue-dark));
  color: #fff;
  font-size: 16px;
  padding: 16px 32px;
  box-shadow: 0 8px 26px rgba(46, 107, 246, .45);
}
.nc-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(46, 107, 246, .6);
  color: #fff;
}

/* Variante compacta (navbar) */
.nc-btn--sm { font-size: 14px; padding: 11px 22px; border-radius: 10px; box-shadow: 0 4px 14px rgba(46, 107, 246, .35); }
.nc-btn--sm:hover { box-shadow: 0 8px 22px rgba(46, 107, 246, .45); }

/* Fantasma sobre fondo oscuro (hero) */
.nc-btn--ghost {
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  font-size: 16px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, .04);
}
.nc-btn--ghost:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); color: #fff; }

/* Oscuro sólido */
.nc-btn--dark { background: var(--nc-ink); color: #fff; font-size: 14.5px; padding: 13px 26px; border-radius: 10px; }
.nc-btn--dark:hover { background: var(--nc-blue-dark); color: #fff; }

/* Contorno */
.nc-btn--outline { border: 1px solid rgba(11, 18, 38, .15); color: var(--nc-ink); font-size: 14px; padding: 12px 24px; border-radius: 10px; background: transparent; }
.nc-btn--outline:hover { border-color: var(--nc-blue); color: var(--nc-blue); }

/* WhatsApp */
/* ===== WhatsApp flotante con burbuja de invitación (hito 17) ===== */
.nc-wsp {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.nc-wsp__boton {
  position: relative;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--nc-whatsapp); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .45);
  transition: transform .2s, box-shadow .2s;
}
.nc-wsp__boton:hover {
  transform: scale(1.07); color: #fff;
  box-shadow: 0 14px 32px rgba(37, 211, 102, .55);
}
/* Pulso de anillo (hito 17.1): mismo verde, desvanece al expandirse. Bajo el
   icono (z-index -1) y sin capturar el mouse. El botón NO rebota. */
.nc-wsp__boton::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  border-radius: 50%; background: var(--nc-whatsapp);
  opacity: .45; pointer-events: none;
  animation: nc-pulso 2.6s ease-out infinite;
}
@keyframes nc-pulso {
  0%   { transform: scale(1);    opacity: .45; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nc-wsp__boton::before { animation: none; display: none; }
}
.nc-wsp__burbuja {
  position: relative;
  background: #fff; border: 1px solid rgba(11, 18, 38, .08);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(11, 18, 38, .18);
  padding: 12px 36px 12px 16px; max-width: 250px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.nc-wsp__burbuja.is-visible { opacity: 1; transform: none; }
/* flechita de la tarjeta hacia el botón */
.nc-wsp__burbuja::after {
  content: ''; position: absolute; right: 20px; bottom: -7px;
  width: 13px; height: 13px; background: #fff;
  border-right: 1px solid rgba(11, 18, 38, .08);
  border-bottom: 1px solid rgba(11, 18, 38, .08);
  transform: rotate(45deg);
}
.nc-wsp__texto { display: flex; flex-direction: column; gap: 3px; color: var(--nc-ink); }
.nc-wsp__texto strong { font-family: var(--nc-font-display); font-size: 14.5px; }
.nc-wsp__texto span { font-size: 12.5px; color: var(--nc-ink-soft); }
.nc-wsp__cerrar {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: transparent; color: var(--nc-ink-soft); cursor: pointer;
  display: grid; place-items: center;
}
.nc-wsp__cerrar:hover { background: var(--nc-bg); color: var(--nc-ink); }
@media (max-width: 640px) {
  .nc-wsp { right: 14px; bottom: 14px; }
  .nc-wsp__boton { width: 52px; height: 52px; }
  .nc-wsp__burbuja { max-width: 205px; }
}

.nc-btn--whatsapp {
  background: var(--nc-whatsapp);
  color: #062b16;
  font-size: 17px;
  font-weight: 700;
  padding: 18px 38px;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(37, 211, 102, .35);
}
.nc-btn--whatsapp:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(37, 211, 102, .5); color: #062b16; }

/* ===== Encabezados de sección ===== */
.nc-section { padding: 110px 48px; }
.nc-section--alt { background: var(--nc-white); }
.nc-section__inner { max-width: 1240px; margin: 0 auto; }

.nc-eyebrow {
  font-family: var(--nc-font-display);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--nc-blue);
  margin-bottom: 14px;
}
.nc-eyebrow--light { color: #7FA3F7; }

.nc-section__head { text-align: center; max-width: 680px; margin: 0 auto 64px; }
.nc-section__head h2, .nc-h2 {
  font-family: var(--nc-font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 18px;
  text-wrap: balance;
}
.nc-section__head p { font-size: 17.5px; line-height: 1.65; color: var(--nc-ink-soft); margin: 0; text-wrap: pretty; }

/* ===== Reveal on scroll (usado con nexcode/js/home.js) ===== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ===== Toast (compartido con auth) ===== */
.nc-toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--nc-navy);
  box-shadow: 0 18px 40px rgba(2, 8, 30, .32);
  border: 1px solid rgba(91, 141, 255, .22);
  transform: translateY(26px);
  opacity: 0;
  pointer-events: none;
  transition: .28s ease;
  font-size: 14px;
}
.nc-toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 520px) {
  .nc-toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
