/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cyan: #00f0ff;
  --purple: #7b2ff7;
  --dark-bg: #0a0e1a;
  --card-bg: rgba(15, 20, 40, 0.85);
  --border-color: rgba(0, 240, 255, 0.15);
  --text-primary: #e8ecf4;
  --text-secondary: #8892a4;
  --input-bg: rgba(10, 14, 26, 0.6);
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.3);
  --glow-purple: 0 0 20px rgba(123, 47, 247, 0.3);
  --gradient: linear-gradient(135deg, var(--cyan), var(--purple));
}

html {
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ===== BACKGROUND EFFECTS ===== */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--cyan);
  border-radius: 50%;
  opacity: 0;
  animation: float-particle 8s infinite;
}

@keyframes float-particle {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-scroll 20s linear infinite;
}

@keyframes grid-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(60px); }
}

/* ===== LABORATORY VISUALS ===== */
.lab-visuals {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.lab-icon {
  position: absolute;
  opacity: 0.6;
  animation: lab-float 12s ease-in-out infinite;
}

.lab-icon svg {
  width: 100%;
  height: 100%;
}

.lab-icon-1 {
  width: 120px;
  height: 120px;
  top: 8%;
  left: 5%;
  animation-delay: 0s;
}

.lab-icon-2 {
  width: 100px;
  height: 100px;
  top: 15%;
  right: 8%;
  animation-delay: -2s;
  animation-duration: 14s;
}

.lab-icon-3 {
  width: 110px;
  height: 110px;
  bottom: 15%;
  left: 8%;
  animation-delay: -4s;
  animation-duration: 10s;
}

.lab-icon-4 {
  width: 130px;
  height: 130px;
  bottom: 10%;
  right: 5%;
  animation-delay: -6s;
  animation-duration: 13s;
}

.lab-icon-5 {
  width: 140px;
  height: 140px;
  top: 50%;
  left: 2%;
  transform: translateY(-50%);
  animation-delay: -3s;
  animation-duration: 15s;
}

.lab-icon-6 {
  width: 110px;
  height: 110px;
  top: 55%;
  right: 4%;
  animation-delay: -5s;
  animation-duration: 11s;
}

@keyframes lab-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.5;
  }
  25% {
    transform: translateY(-12px) rotate(2deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-6px) rotate(-1deg);
    opacity: 0.6;
  }
  75% {
    transform: translateY(-15px) rotate(1.5deg);
    opacity: 0.55;
  }
}

/* Responsive: hide some icons on small screens */
@media (max-width: 768px) {
  .lab-icon-5,
  .lab-icon-6 {
    display: none;
  }

  .lab-icon {
    opacity: 0.35;
  }
}

@media (max-width: 480px) {
  .lab-icon-3,
  .lab-icon-4 {
    display: none;
  }
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 80px rgba(0, 240, 255, 0.05);
  animation: card-appear 0.8s ease-out;
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== BRAND ===== */
.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.8)); }
}

.logo svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.brand-name span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* ===== FORM ===== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: color 0.3s;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.input-wrapper input::placeholder {
  color: rgba(136, 146, 164, 0.5);
}

.input-wrapper input:focus {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.input-wrapper input:focus ~ .input-glow {
  opacity: 1;
}

.input-wrapper:has(input:focus) .input-icon {
  color: var(--cyan);
}

.input-glow {
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  background: var(--gradient);
  opacity: 0;
  z-index: -1;
  filter: blur(8px);
  transition: opacity 0.3s;
}

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.toggle-password:hover svg {
  color: var(--cyan);
}

/* ===== FORM OPTIONS ===== */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s;
}

.checkbox-wrapper input:checked + .checkmark {
  background: var(--gradient);
  border-color: var(--cyan);
}

.checkbox-wrapper input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link {
  color: var(--cyan);
  text-decoration: none;
  transition: opacity 0.3s;
}

.forgot-link:hover {
  opacity: 0.7;
}

/* ===== LOGIN BUTTON ===== */
.btn-login {
  position: relative;
  width: 100%;
  padding: 0.95rem;
  margin-top: 0.5rem;
  background: var(--gradient);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 30px rgba(0, 240, 255, 0.3),
    0 5px 15px rgba(123, 47, 247, 0.2);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn-login:hover .btn-glow {
  transform: translateX(100%);
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.btn-login.loading .btn-text {
  display: none;
}

.btn-login.loading .btn-loader {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== FOOTER ===== */
.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.login-footer p {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #00ff88;
  border-radius: 50%;
  display: inline-block;
  animation: blink 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .login-container {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }

  .brand-name {
    font-size: 1.5rem;
  }
}
