/* ============================================================================
   styles.css — POLILOCO · Landing "Coming Soon" temática TRON
   ----------------------------------------------------------------------------
   Estilos mobile-first (base = móvil, mejoras por media queries).
   Sistema de temas con CSS custom properties:
     [data-theme="dark"] (por defecto) y [data-theme="light"].
   El selector de tema vive en <html data-theme="..."> y se persiste en
   localStorage desde js/script.js.
   ==========================================================================*/

/* ----------------------------------------------------------------------------
   1. Variables del tema
   -------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  /* Paleta oscura (referencia TRON: cian #00E5FF, magenta #FF2BD6) */
  --bg: #04070d;
  --surface: #0a1220;
  --surface-2: #0d1728;
  --text: #dff6ff;
  --muted: #86a7b8;
  --accent: #00e5ff;
  --accent-2: #ff2bd6;
  --on-accent: #02131a;
  --grid: rgba(0, 229, 255, 0.07);
  --grid-strong: rgba(0, 229, 255, 0.16);
  --border: rgba(0, 229, 255, 0.3);
  --glow: rgba(0, 229, 255, 0.4);
  --glow-soft: rgba(0, 229, 255, 0.14);
  --shadow: 0 0 18px var(--glow-soft);
}

[data-theme="light"] {
  /* Paleta clara (mantiene acentos TRON con contraste AA) */
  --bg: #f2f7fa;
  --surface: #ffffff;
  --surface-2: #f6fbfe;
  --text: #0c1b26;
  --muted: #48697a;
  --accent: #007aac;
  --accent-2: #b3128a;
  --on-accent: #f2fbff;
  --grid: rgba(0, 122, 172, 0.07);
  --grid-strong: rgba(0, 122, 172, 0.16);
  --border: rgba(0, 122, 172, 0.32);
  --glow: rgba(0, 122, 172, 0.28);
  --glow-soft: rgba(0, 122, 172, 0.12);
  --shadow: 0 0 18px var(--glow-soft);
}

/* ----------------------------------------------------------------------------
   2. Reset y base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* Transición suave al cambiar de tema */
body,
.site-header,
.signal,
.form input,
.form textarea,
.form select,
.btn,
.brand-mark {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

body {
  font-family: "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem; /* 17px: base cómoda en móvil */
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  /* Resplandor superior sutil inspirado en el horizonte TRON */
  background-image: radial-gradient(
    ellipse 90% 45% at 50% -8%,
    var(--glow-soft),
    transparent 70%
  );
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* Ocultar campo honeypot (anti-bot) de humanos y de lectores de pantalla */
.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Enlace "saltar al contenido" (accesibilidad) */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ----------------------------------------------------------------------------
   3. Decoración de fondo: rejilla + línea de escaneo
   -------------------------------------------------------------------------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Rejilla TRON: líneas horizontales y verticales con máscara radial */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 10%, black 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 10%, black 25%, transparent 85%);
}

/* Línea de escaneo animada (efecto CRT) */
.scanline {
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  background: linear-gradient(to top, transparent, var(--glow-soft));
  animation: scan 7s linear infinite;
  opacity: 0.6;
}

@keyframes scan {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: 0.6; }
  92%  { opacity: 0.6; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

/* ----------------------------------------------------------------------------
   4. Cabecera
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 5vw, 2.5rem);
  background-color: var(--bg); /* fallback: navegadores sin color-mix() */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--glow));
}

.brand-text {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.18em;
}

/* "LOCO" con acento magenta: firma visual de la marca */
.brand-text span {
  color: var(--accent-2);
}

/* Botón selector de tema */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent-2);
  box-shadow: var(--shadow);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
}

/* En tema oscuro se muestra el sol (para pasar a claro) y viceversa */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }

/* ----------------------------------------------------------------------------
   5. Layout principal
   -------------------------------------------------------------------------- */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1rem, 5vw, 2.5rem) 4rem;
}

/* ----------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  text-align: center;
  padding: clamp(3rem, 9vh, 5.5rem) 0;
}

/* Rejilla del hero con ligera perspectiva en la base */
.hero::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -2rem;
  height: 130px;
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: top center;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black);
  mask-image: linear-gradient(to bottom, transparent, black);
  opacity: 0.55;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1.1rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 10vw, 5.2rem);
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: var(--text);
}

/* Efecto glitch sobre el titular (con data-text como capa de color) */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.glitch::before {
  color: var(--accent);
  transform: translate(-0.09em, 0);
  mix-blend-mode: screen;
  animation: glitch-a 3.2s infinite steps(2, end);
}

.glitch::after {
  color: var(--accent-2);
  transform: translate(0.09em, 0);
  mix-blend-mode: screen;
  animation: glitch-b 2.7s infinite steps(2, end);
}

@keyframes glitch-a {
  0%, 92%   { clip-path: inset(0 0 100% 0); }
  93%       { clip-path: inset(12% 0 55% 0); }
  95%       { clip-path: inset(60% 0 8% 0); }
  97%       { clip-path: inset(30% 0 45% 0); }
  100%      { clip-path: inset(0 0 100% 0); }
}

@keyframes glitch-b {
  0%, 94%   { clip-path: inset(0 0 100% 0); }
  95%       { clip-path: inset(45% 0 25% 0); }
  97%       { clip-path: inset(8% 0 70% 0); }
  100%      { clip-path: inset(0 0 100% 0); }
}

.tagline {
  max-width: 46rem;
  margin: 1.4rem auto 0;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  font-weight: 500;
  color: var(--muted);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
}

/* Punto pulsante de "vida" del sistema */
.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.72); }
}

/* ----------------------------------------------------------------------------
   7. Sección formulario
   -------------------------------------------------------------------------- */
.signal {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  /* Esquinas cortadas: referencia visual de la geometría TRON */
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  box-shadow: var(--shadow);
}

.signal-header {
  padding: 1.8rem 1.6rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.signal-header h2 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--accent);
}

.signal-header p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.form {
  padding: 1.6rem;
  display: grid;
  gap: 1.15rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}

/* Placeholder con el color de texto secundario del tema */
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px var(--glow-soft);
  outline: none;
}

/* Checkbox de Términos y Condiciones */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
}

.terms input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.terms a {
  /* Subrayado sutil para mejor legibilidad sin romper la estética */
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Botón principal (chamfer + neón) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.95rem 1.4rem;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  cursor: pointer;
  box-shadow: 0 0 22px var(--glow-soft);
}

.btn:hover {
  background: var(--accent-2);
  box-shadow: 0 0 26px var(--glow);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Spinner de carga */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mensajes de estado del formulario */
.form-status {
  min-height: 1.4em;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.form-status.ok {
  color: var(--accent);
}

.form-status.error {
  color: var(--accent-2);
}

/* ----------------------------------------------------------------------------
   8. Pie de página
   -------------------------------------------------------------------------- */
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 5vw, 2.5rem) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-nav a {
  text-decoration: none;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--accent);
}

/* ----------------------------------------------------------------------------
   9. Páginas legales (terminos.html / error.html)
   -------------------------------------------------------------------------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 5vw, 2.5rem) 4rem;
}

.legal h1 {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 5vw, 2rem);
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.legal .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.legal h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin: 2rem 0 0.5rem;
}

.legal p,
.legal li {
  color: var(--muted);
}

.legal ol {
  list-style-position: inside;
}

/* ----------------------------------------------------------------------------
   10. Responsive: tablet (>=760px) y escritorio (>=980px)
   -------------------------------------------------------------------------- */

/* ≥ 760px: más aire en el formulario y el banner */
@media (min-width: 760px) {
  .form {
    padding: 2rem;
    gap: 1.3rem;
  }

  .hero {
    padding: clamp(3.5rem, 9vh, 6rem) 0;
  }
}

/* ≥ 980px: dos columnas — hero a la izquierda, formulario a la derecha */
@media (min-width: 980px) {
  .main {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 4.5rem);
  }

  .hero {
    text-align: left;
    padding: 1rem 0;
  }

  .hero::after {
    bottom: -3rem;
    height: 180px;
  }

  .tagline {
    margin-left: 0;
  }

  .signal {
    margin: 0;
  }

  .site-footer {
    padding-top: 2rem;
  }
}

/* ----------------------------------------------------------------------------
   11. Accesibilidad: reducción de movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scanline,
  .pulse-dot {
    animation: none;
  }

  .glitch::before,
  .glitch::after {
    animation: none;
    display: none; /* elimina las capas fantasma del glitch */
  }
}