/* NeuroPOS Landing Page - All required styles (no external dependencies) */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(160deg, #0c1929 0%, #0f172a 25%, #1e3a5f 50%, #0f172a 75%, #0c1929 100%);
  min-height: 100vh;
  color: #e2e8f0;
  position: relative;
}

/* Futuristic 3D-style background (reference: NeuroPOS SaaS Landing, blue) */
.landing-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  perspective: 1200px;
}
.landing-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0c1929 0%, #0f172a 25%, #1e3a5f 50%, #0f172a 75%, #0c1929 100%);
}
.landing-bg-dots-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
  transform-style: preserve-3d;
}
/* Connectors: draw-in / draw-out (stroke-dashoffset) */
.landing-connectors .connector {
  fill: none;
  stroke: url(#blue-grad);
  stroke-opacity: 0.5;
  stroke-width: 1.2;
  stroke-dasharray: 350;
  stroke-dashoffset: 350;
  animation: connectorDraw 8s ease-in-out infinite;
}
.landing-connectors .connector:nth-child(odd) { animation-delay: 0s; }
.landing-connectors .connector:nth-child(3n) { animation-delay: -2s; }
.landing-connectors .connector:nth-child(5n) { animation-delay: -4s; }
.landing-connectors .connector:nth-child(7n) { animation-delay: -1s; }
.landing-connectors .connector:nth-child(11n) { animation-delay: -3s; }
@keyframes connectorDraw {
  0% { stroke-dashoffset: 350; }
  25% { stroke-dashoffset: 0; }
  75% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -350; }
}
/* Dots: filled (blue) + rings, pulse */
.landing-dot-layer .dot-filled {
  fill: #60a5fa;
  fill-opacity: 0.7;
  animation: dotPulse 4s ease-in-out infinite;
}
.landing-dot-layer .dot-ring {
  fill: none;
  stroke: #3b82f6;
  stroke-opacity: 0.5;
  stroke-width: 1.5;
  animation: dotPulse 5s ease-in-out infinite;
}
.landing-dot-layer .dot:nth-child(odd) { animation-delay: -0.5s; }
.landing-dot-layer .dot:nth-child(3n) { animation-delay: -1.5s; }
.landing-dot-layer .dot:nth-child(5n) { animation-delay: -2.5s; }
.landing-dot-layer .dot { transform-box: fill-box; transform-origin: center; }
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}
/* Grid overlay */
.landing-bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  pointer-events: none;
}
.landing-bg-grid svg { width: 100%; height: 100%; display: block; }
/* Floating particles (created by JS) */
.landing-bg-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.landing-bg-particles .particle {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.9);
  animation: particleFloat 12s linear infinite;
  opacity: 0;
}
.landing-bg-particles .particle.particle-glow {
  width: 8px;
  height: 8px;
  margin-left: -2px;
  margin-bottom: -2px;
  background: rgba(147, 197, 253, 0.6);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
  animation-duration: 14s;
}
@keyframes particleFloat {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 0.8; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh); opacity: 0; }
}
/* Vertical stream lines (blue) */
.landing-bg-streams {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.landing-bg-streams .stream-line {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 60vh;
  background: linear-gradient(to top, transparent, rgba(59, 130, 246, 0.5), rgba(96, 165, 250, 0.8), transparent);
  animation: streamRise 6s linear infinite;
}
.landing-bg-streams .stream-line:nth-child(1) { left: 12%; animation-delay: 0s; }
.landing-bg-streams .stream-line:nth-child(2) { left: 28%; animation-delay: 1s; }
.landing-bg-streams .stream-line:nth-child(3) { left: 50%; animation-delay: 2s; }
.landing-bg-streams .stream-line:nth-child(4) { left: 68%; animation-delay: 3s; }
.landing-bg-streams .stream-line:nth-child(5) { left: 82%; animation-delay: 4s; }
.landing-bg-streams .stream-line:nth-child(6) { left: 94%; animation-delay: 5s; }
@keyframes streamRise {
  0% { transform: translateY(0); opacity: 0; }
  5% { opacity: 1; }
  93% { opacity: 0.95; }
  100% { transform: translateY(-100vh); opacity: 0; }
}
/* Horizontal scan line (blue) */
.landing-bg-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.7), #60a5fa, rgba(96, 165, 250, 0.7), transparent);
  animation: scanlineMove 5s linear infinite;
  pointer-events: none;
}
@keyframes scanlineMove {
  0% { top: -2px; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
/* Vignette */
.landing-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

.landing-header,
.landing-hero,
#loginOverlay { position: relative; z-index: 1; }

/* Header */
.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(71, 85, 105, 0.5);
  z-index: 1000;
}
.landing-brand { font-size: 20px; font-weight: 700; color: #fff; }
.landing-tagline { font-size: 14px; color: #94a3b8; margin-left: 8px; }
.landing-nav { display: flex; align-items: center; gap: 24px; }
.landing-nav a { color: #94a3b8; text-decoration: none; font-size: 14px; }
.landing-nav a:hover { color: #fff; }
.landing-admin-nav { color: #94a3b8; text-decoration: none; font-size: 14px; }
.landing-admin-nav:hover { color: #fff; }
.landing-btn-ghost { background: transparent; border: none; color: #cbd5e1; font-size: 14px; cursor: pointer; padding: 6px 12px; }
.landing-btn-ghost:hover { color: #fff; }
.landing-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.landing-btn-primary:hover { opacity: 0.95; transform: translateY(-1px); }

/* Hero */
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  text-align: center;
}
.landing-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; color: #fff; margin-bottom: 16px; line-height: 1.2; }
.landing-hero p { font-size: 1.125rem; color: #94a3b8; max-width: 36rem; margin-bottom: 8px; }
.landing-hero .env-badge { font-size: 14px; color: #f59e0b; margin-bottom: 24px; }
.landing-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }
.landing-hero-actions .landing-btn-primary { padding: 12px 24px; font-size: 16px; }
.landing-hero-actions .landing-btn-outline {
  background: transparent; color: #cbd5e1; border: 1px solid #475569; padding: 12px 24px; border-radius: 8px; font-size: 16px; cursor: pointer;
}
.landing-hero-actions .landing-btn-outline:hover { background: rgba(71, 85, 105, 0.5); color: #fff; }
.landing-admin-link { margin-top: 48px; font-size: 14px; color: #64748b; }
.landing-admin-link a { color: #a78bfa; text-decoration: none; }
.landing-admin-link a:hover { text-decoration: underline; }

/* Login modal overlay */
#loginOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#loginOverlay.show { display: flex; }
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  overflow: hidden;
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.modal-close:hover { background: #dc2626; }
.modal-body { padding: 40px 30px; color: #1e293b; }
.modal-title { font-size: 24px; font-weight: 700; color: #1e293b; margin-bottom: 8px; text-align: center; }
.modal-desc { font-size: 16px; color: #64748b; text-align: center; margin-bottom: 24px; }
.modal-form .field { margin-bottom: 20px; }
.modal-form label { display: block; font-weight: 600; color: #334155; margin-bottom: 8px; font-size: 14px; }
.modal-form input[type="text"],
.modal-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
}
.modal-form input:focus { outline: none; border-color: #667eea; }
.tenant-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tenant-quick button {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #334155;
  font-size: 14px;
  cursor: pointer;
}
.tenant-quick button.active { background: #667eea; color: #fff; border-color: #667eea; }
.tenant-ok { margin-top: 8px; padding: 8px 12px; background: #dcfce7; color: #166534; border-radius: 8px; font-size: 14px; display: none; }
.tenant-err { margin-top: 8px; padding: 8px 12px; background: #fee2e2; color: #b91c1c; border-radius: 8px; font-size: 14px; display: none; }
.modal-form .submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.modal-form .submit-btn:hover { opacity: 0.95; }
.modal-form .submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.modal-admin-link { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.modal-admin-link a { color: #667eea; text-decoration: none; font-size: 14px; font-weight: 500; }
.modal-admin-link a:hover { text-decoration: underline; }
#loginMessage {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
#loginMessage.error { background: #fee2e2; color: #b91c1c; display: block; }
#loginMessage.success { background: #dcfce7; color: #166534; display: block; }
#loginMessage.info { background: #dbeafe; color: #1d4ed8; display: block; }
