/* ===== LIVING AUTH BACKGROUND ===== */
.auth-page {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #172554 100%);
}

/* Subtle grid overlay */
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

/* Glowing orbs */
.bg-glow {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(80px); z-index: 0;
}
.bg-glow-1 { width: 500px; height: 500px; top: -120px; left: -100px; background: rgba(37,99,235,0.15); animation: glow-drift 12s ease-in-out infinite; }
.bg-glow-2 { width: 400px; height: 400px; bottom: -80px; right: -60px; background: rgba(124,58,237,0.12); animation: glow-drift 15s ease-in-out infinite reverse; }
.bg-glow-3 { width: 300px; height: 300px; top: 50%; left: 60%; background: rgba(13,148,136,0.08); animation: glow-drift 10s ease-in-out infinite 3s; }

@keyframes glow-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ===== FLOATING DOCUMENT CARDS ===== */
.scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.float-doc {
  position: absolute;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px;
  opacity: 0;
  animation: doc-float 20s ease-in-out infinite;
}
.float-doc .fd-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.float-doc .fd-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px; flex-shrink: 0;
}
.float-doc .fd-title {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
}
.float-doc .fd-line {
  height: 3px; border-radius: 3px; margin-bottom: 5px;
  background: rgba(255,255,255,0.06);
}
.float-doc .fd-line.filled {
  animation: line-fill 3s ease-in-out infinite;
}

/* Doc positions & colors */
.float-doc.doc-ncp { width: 180px; top: 8%; left: 5%; animation-delay: 0s; }
.float-doc.doc-ncp .fd-icon { background: rgba(37,99,235,0.2); color: #60a5fa; }
.float-doc.doc-ncp .fd-title { color: #60a5fa; }
.float-doc.doc-ncp .fd-line.filled { background: rgba(37,99,235,0.25); }

.float-doc.doc-care { width: 170px; top: 12%; right: 4%; animation-delay: 4s; }
.float-doc.doc-care .fd-icon { background: rgba(124,58,237,0.2); color: #a78bfa; }
.float-doc.doc-care .fd-title { color: #a78bfa; }
.float-doc.doc-care .fd-line.filled { background: rgba(124,58,237,0.25); }

.float-doc.doc-meds { width: 175px; bottom: 15%; left: 3%; animation-delay: 8s; }
.float-doc.doc-meds .fd-icon { background: rgba(13,148,136,0.2); color: #5eead4; }
.float-doc.doc-meds .fd-title { color: #5eead4; }
.float-doc.doc-meds .fd-line.filled { background: rgba(13,148,136,0.25); }

.float-doc.doc-discharge { width: 165px; bottom: 10%; right: 6%; animation-delay: 12s; }
.float-doc.doc-discharge .fd-icon { background: rgba(234,88,12,0.2); color: #fb923c; }
.float-doc.doc-discharge .fd-title { color: #fb923c; }
.float-doc.doc-discharge .fd-line.filled { background: rgba(234,88,12,0.25); }

.float-doc.doc-ai { width: 190px; top: 45%; left: 2%; animation-delay: 6s; }
.float-doc.doc-ai .fd-icon { background: rgba(99,102,241,0.2); color: #818cf8; }
.float-doc.doc-ai .fd-title { color: #818cf8; }

.float-doc.doc-wac { width: 160px; top: 40%; right: 3%; animation-delay: 10s; }
.float-doc.doc-wac .fd-icon { background: rgba(22,163,74,0.2); color: #4ade80; }
.float-doc.doc-wac .fd-title { color: #4ade80; }

@keyframes doc-float {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  5% { opacity: 0.7; transform: translateY(0) scale(1); }
  8% { opacity: 0.7; }
  40% { opacity: 0.7; transform: translateY(-8px) scale(1); }
  48% { opacity: 0; transform: translateY(-16px) scale(0.97); }
  100% { opacity: 0; }
}

@keyframes line-fill {
  0%, 100% { width: 30%; }
  50% { width: 85%; }
}

/* ===== DATA PARTICLES ===== */
.particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}
.particle.p-blue { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.particle.p-purple { background: #8b5cf6; box-shadow: 0 0 6px #8b5cf6; }
.particle.p-teal { background: #14b8a6; box-shadow: 0 0 6px #14b8a6; }
.particle.p-orange { background: #f97316; box-shadow: 0 0 6px #f97316; }

.particle:nth-child(1) { top: 20%; left: 15%; animation: particle-move 8s ease-in-out infinite 0s; }
.particle:nth-child(2) { top: 60%; left: 10%; animation: particle-move 10s ease-in-out infinite 2s; }
.particle:nth-child(3) { top: 30%; right: 12%; animation: particle-move 9s ease-in-out infinite 4s; }
.particle:nth-child(4) { top: 70%; right: 8%; animation: particle-move 7s ease-in-out infinite 1s; }
.particle:nth-child(5) { top: 15%; right: 20%; animation: particle-move 11s ease-in-out infinite 3s; }
.particle:nth-child(6) { top: 80%; left: 20%; animation: particle-move 9s ease-in-out infinite 5s; }
.particle:nth-child(7) { top: 45%; left: 8%; animation: particle-move 8s ease-in-out infinite 7s; }
.particle:nth-child(8) { top: 50%; right: 15%; animation: particle-move 10s ease-in-out infinite 6s; }

@keyframes particle-move {
  0% { opacity: 0; transform: translate(0, 0) scale(1); }
  10% { opacity: 0.8; }
  50% { opacity: 0.6; transform: translate(60px, -40px) scale(1.5); }
  90% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(120px, -80px) scale(0.5); }
}

/* ===== CONNECTION LINES ===== */
.connection-lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.15;
}
.conn-line {
  stroke-dasharray: 6 8;
  animation: dash-flow 4s linear infinite;
}
.conn-line.cl-1 { stroke: #3b82f6; animation-duration: 5s; }
.conn-line.cl-2 { stroke: #8b5cf6; animation-duration: 7s; animation-delay: 2s; }
.conn-line.cl-3 { stroke: #14b8a6; animation-duration: 6s; animation-delay: 1s; }

@keyframes dash-flow {
  to { stroke-dashoffset: -56; }
}

/* ===== PROCESSING BADGES ===== */
.proc-badge {
  position: absolute;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 9px; font-weight: 600;
  white-space: nowrap;
  z-index: 0; pointer-events: none;
  opacity: 0;
}
.proc-badge .pb-dot {
  width: 5px; height: 5px; border-radius: 50%;
  animation: pb-pulse 1.5s ease-in-out infinite;
}

.proc-badge.pb-extract { top: 28%; left: 7%; color: #60a5fa; animation: badge-appear 16s ease-in-out infinite 2s; }
.proc-badge.pb-extract .pb-dot { background: #3b82f6; }

.proc-badge.pb-validate { bottom: 32%; right: 5%; color: #4ade80; animation: badge-appear 16s ease-in-out infinite 7s; }
.proc-badge.pb-validate .pb-dot { background: #22c55e; }

.proc-badge.pb-generate { top: 65%; left: 5%; color: #a78bfa; animation: badge-appear 16s ease-in-out infinite 12s; }
.proc-badge.pb-generate .pb-dot { background: #8b5cf6; }

@keyframes badge-appear {
  0%, 100% { opacity: 0; transform: translateY(6px); }
  6% { opacity: 0.8; transform: translateY(0); }
  22% { opacity: 0.8; transform: translateY(0); }
  28% { opacity: 0; transform: translateY(-6px); }
}

@keyframes pb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== BACK NAV ===== */
.back-nav {
  position: absolute;
  top: 24px; left: 28px;
  z-index: 2;
  display: flex; align-items: center; gap: 6px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 8px 16px 8px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  transition: all .2s;
}
.back-nav:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.15);
  transform: translateX(-2px);
}
.back-nav svg { flex-shrink: 0; }

/* ===== AUTH CARD ON DARK BG ===== */
.auth-page .auth-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.97);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.3),
    0 0 0 1px rgba(255,255,255,0.1),
    0 0 80px rgba(37,99,235,0.08);
  backdrop-filter: blur(20px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .float-doc, .particle, .proc-badge, .bg-glow, .conn-line, .fd-line.filled {
    animation: none !important;
  }
  .float-doc { opacity: 0.3 !important; }
  .proc-badge { opacity: 0.4 !important; }
}

/* Mobile: simplify */
@media (max-width: 768px) {
  .float-doc { display: none; }
  .connection-lines { display: none; }
  .proc-badge { display: none; }
  .particle:nth-child(n+5) { display: none; }
}
