/* Login — industrial 3D scene */

.login-scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-bottom: 3rem;
  overflow: hidden;
}

.login-scene-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-perspective {
  position: absolute;
  inset: 0;
  perspective: 1100px;
  perspective-origin: 50% 40%;
}

/* 3D grid floor */
.login-grid-floor {
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: -45%;
  height: 90%;
  transform-style: preserve-3d;
  transform: rotateX(68deg) translateZ(-80px);
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.22) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 100%, black 20%, transparent 75%);
  opacity: 0.45;
  animation: login-grid-drift 24s linear infinite;
}

@keyframes login-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 56px, 56px 0; }
}

/* Ambient orbs */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: login-orb-float 14s ease-in-out infinite;
}
.login-orb-1 {
  width: 280px;
  height: 280px;
  top: 8%;
  left: 12%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.35) 0%, transparent 70%);
}
.login-orb-2 {
  width: 220px;
  height: 220px;
  bottom: 18%;
  right: 10%;
  background: radial-gradient(circle, rgba(100, 116, 139, 0.3) 0%, transparent 70%);
  animation-delay: -5s;
}

@keyframes login-orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(12px, -18px, 0) scale(1.06); }
}

/* CSS 3D wireframe cubes */
.login-iso-cube {
  position: absolute;
  transform-style: preserve-3d;
  animation: login-cube-orbit 18s ease-in-out infinite;
}
.login-iso-cube-1 {
  top: 14%;
  right: 14%;
  width: 72px;
  height: 72px;
}
.login-iso-cube-2 {
  bottom: 22%;
  left: 8%;
  width: 48px;
  height: 48px;
  animation-duration: 22s;
  animation-delay: -8s;
}

.login-cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: login-cube-spin 16s linear infinite;
}
.login-cube-sm {
  animation-duration: 20s;
  animation-direction: reverse;
}

.login-cube span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.04);
  box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.06);
}
.login-cube span:nth-child(1) { transform: translateZ(36px); }
.login-cube span:nth-child(2) { transform: rotateY(180deg) translateZ(36px); }
.login-cube span:nth-child(3) { transform: rotateY(90deg) translateZ(36px); }
.login-cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(36px); }
.login-cube span:nth-child(5) { transform: rotateX(90deg) translateZ(36px); }
.login-cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(36px); }

.login-cube-sm span:nth-child(1) { transform: translateZ(24px); }
.login-cube-sm span:nth-child(2) { transform: rotateY(180deg) translateZ(24px); }
.login-cube-sm span:nth-child(3) { transform: rotateY(90deg) translateZ(24px); }
.login-cube-sm span:nth-child(4) { transform: rotateY(-90deg) translateZ(24px); }
.login-cube-sm span:nth-child(5) { transform: rotateX(90deg) translateZ(24px); }
.login-cube-sm span:nth-child(6) { transform: rotateX(-90deg) translateZ(24px); }

@keyframes login-cube-spin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg); }
}

@keyframes login-cube-orbit {
  0%, 100% { transform: translate3d(0, 0, 40px) rotateX(12deg); }
  50% { transform: translate3d(-8px, 14px, 60px) rotateX(18deg); }
}

/* Pipeline accent lines */
.login-pipeline {
  position: absolute;
  left: 6%;
  top: 42%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 0.35;
  transform: perspective(600px) rotateY(28deg);
}
.login-pipeline span {
  display: block;
  width: 120px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #0ea5e9, transparent);
  animation: login-pulse-line 3s ease-in-out infinite;
}
.login-pipeline span:nth-child(2) { width: 80px; animation-delay: 0.6s; }
.login-pipeline span:nth-child(3) { width: 100px; animation-delay: 1.2s; }

@keyframes login-pulse-line {
  0%, 100% { opacity: 0.3; transform: scaleX(0.85); }
  50% { opacity: 1; transform: scaleX(1); }
}

.login-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.4;
  pointer-events: none;
}

.login-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 40%, rgba(15, 18, 24, 0.85) 100%);
}

/* Layout */
.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 56rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .login-layout {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.login-brand-panel {
  display: none;
  animation: login-fade-up 0.9s ease-out both;
}

@media (min-width: 1024px) {
  .login-brand-panel {
    display: block;
    padding-left: 1rem;
  }
}

.login-brand-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #0ea5e9;
  margin-bottom: 1rem;
}

.login-brand-headline {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.login-brand-stats {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
}
.login-brand-stats li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: #94a3b8;
}
.login-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  flex-shrink: 0;
}

/* 3D card stage */
.login-card-stage {
  perspective: 1400px;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  animation: login-fade-up 0.85s ease-out 0.1s both;
}

.login-card {
  position: relative;
  padding: 2rem 1.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(61, 70, 84, 0.65);
  background: linear-gradient(145deg, rgba(26, 31, 39, 0.92) 0%, rgba(18, 22, 30, 0.88) 100%);
  backdrop-filter: blur(20px);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}

.login-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), transparent 45%, rgba(99, 102, 241, 0.08));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.login-card-stage:hover .login-card-glow,
.login-card-stage.is-tilting .login-card-glow {
  opacity: 1;
}

/* Industrial corner brackets */
.login-card-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(14, 165, 233, 0.5);
  border-style: solid;
  pointer-events: none;
}
.login-card-bracket-tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.login-card-bracket-tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.login-card-bracket-bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.login-card-bracket-br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

.login-card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo-wrap {
  display: inline-flex;
  margin-bottom: 0.75rem;
  animation: login-logo-float 5s ease-in-out infinite;
  transform-style: preserve-3d;
  filter: drop-shadow(0 8px 24px rgba(14, 165, 233, 0.2));
}

.login-logo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
}

@keyframes login-logo-float {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  50% { transform: translateY(-6px) rotateX(6deg); }
}

.login-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.login-status-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: login-led-pulse 2s ease-in-out infinite;
}

@keyframes login-led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.login-error {
  font-size: 0.8125rem;
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
}

.login-field label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 0.375rem;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s ease;
}

.login-input-wrap input {
  width: 100%;
  padding: 0.6875rem 0.75rem 0.6875rem 2.5rem;
  min-height: 2.75rem;
  border-radius: 0.5625rem;
  border: 1px solid rgba(61, 70, 84, 0.8);
  background: rgba(15, 18, 24, 0.65);
  color: #f1f5f9;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input-wrap input::placeholder {
  color: #475569;
}

.login-input-wrap input:focus {
  border-color: rgba(14, 165, 233, 0.55);
  background: rgba(15, 18, 24, 0.9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 4px 16px rgba(14, 165, 233, 0.08);
}

.login-input-wrap:focus-within .login-input-icon {
  color: #38bdf8;
}

.login-submit {
  width: 100%;
  justify-content: center;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease;
}

.login-submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transition: left 0.5s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.35);
}

.login-submit:hover::before {
  left: 140%;
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit-arrow {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform 0.2s ease;
}

.login-submit:hover .login-submit-arrow {
  transform: translateX(3px);
}

.login-footer-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.625rem;
  color: #475569;
  letter-spacing: 0.04em;
}

.login-page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0.875rem 1.5rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.08em;
  background: linear-gradient(0deg, rgba(15, 18, 24, 0.92) 0%, transparent 100%);
  pointer-events: none;
}

@keyframes login-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .login-grid-floor,
  .login-orb,
  .login-cube,
  .login-iso-cube,
  .login-pipeline span,
  .login-logo-wrap,
  .login-status-led {
    animation: none !important;
  }

  .login-card {
    transition: none;
  }

  .login-card-stage,
  .login-brand-panel {
    animation: none;
  }
}
