/* ============================================================
   LDAS - Login Page Styles
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green: #0a3d0a;
  --green-light: #0f5f0f;
  --green-glow: #14a514;
  --black: #111;
  --dark: #0a0a0a;
  --white: #ffffff;
  --gray: #888;
  --red: #ef4444;
  --success: #22c55e;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--dark);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Canvas */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Container */
.login-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
}

/* Logo */
.login-logo {
  text-align: center;
}

.logo-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 30px rgba(10, 61, 10, 0.5), 0 0 60px rgba(10, 61, 10, 0.2);
  animation: logoPulse 3s ease-in-out infinite;
}

.logo-icon i {
  font-size: 32px;
  color: var(--white);
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(10, 61, 10, 0.5), 0 0 60px rgba(10, 61, 10, 0.2); }
  50% { box-shadow: 0 0 40px rgba(20, 165, 20, 0.5), 0 0 80px rgba(20, 165, 20, 0.25); }
}

.logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.logo-text span {
  color: var(--green-glow);
  font-weight: 300;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Login Card */
.login-card {
  width: 100%;
  background: rgba(17, 17, 17, 0.85);
  border: 1px solid rgba(10, 61, 10, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Tabs */
.login-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.login-tab {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  color: var(--gray);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.login-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--green-glow);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.login-tab.active {
  color: var(--white);
}

.login-tab.active::after {
  transform: scaleX(1);
}

.login-tab:hover {
  color: #ccc;
  background: rgba(255, 255, 255, 0.02);
}

.login-tab i {
  font-size: 16px;
}

/* Panels */
.login-panel {
  display: none;
  padding: 32px 28px;
  animation: fadeIn 0.3s ease;
}

.login-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-label {
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 24px;
}

/* PIN Dots */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(10, 61, 10, 0.5);
  background: transparent;
  transition: all 0.2s ease;
}

.dot.filled {
  background: var(--green-glow);
  border-color: var(--green-glow);
  box-shadow: 0 0 12px rgba(20, 165, 20, 0.5);
}

.dot.success {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.dot.error {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* PIN Error */
.pin-error {
  text-align: center;
  font-size: 12px;
  min-height: 20px;
  margin: 8px 0 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pin-error.show {
  opacity: 1;
}

/* PIN Keypad */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-key {
  aspect-ratio: 1.4;
  border: 1px solid rgba(10, 61, 10, 0.25);
  border-radius: 14px;
  background: rgba(10, 61, 10, 0.08);
  color: var(--white);
  font-family: inherit;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-key:hover {
  background: rgba(10, 61, 10, 0.2);
  border-color: rgba(10, 61, 10, 0.5);
}

.pin-key:active,
.pin-key.pressed {
  background: rgba(20, 165, 20, 0.25);
  border-color: var(--green-glow);
  transform: scale(0.95);
  box-shadow: 0 0 15px rgba(20, 165, 20, 0.2);
}

.pin-key.fn-key {
  font-size: 16px;
  color: var(--gray);
}

.pin-key.fn-key:hover {
  color: var(--white);
}

/* Fingerprint Scanner */
.fingerprint-scanner {
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(10, 61, 10, 0.2);
}

.scanner-ring.ring-2 {
  inset: 15px;
  border-style: dashed;
  animation: rotateSlow 12s linear infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fingerprint-scanner i {
  font-size: 64px;
  color: rgba(10, 61, 10, 0.6);
  transition: all 0.5s ease;
  z-index: 2;
}

.fingerprint-scanner i.scanning {
  color: var(--green-glow);
  animation: scanPulse 0.8s ease-in-out infinite;
}

.fingerprint-scanner i.success {
  color: var(--success);
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

@keyframes scanPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

.scan-line {
  position: absolute;
  left: 30px;
  right: 30px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green-glow), transparent);
  opacity: 0;
  z-index: 3;
}

.fingerprint-scanner i.scanning ~ .scan-line {
  opacity: 1;
  animation: scanLine 1.5s ease-in-out infinite;
}

@keyframes scanLine {
  0% { top: 30px; }
  50% { top: 130px; }
  100% { top: 30px; }
}

.bio-status {
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

.bio-status.scanning {
  color: var(--green-glow);
}

.bio-status.success {
  color: var(--success);
}

.scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  padding: 14px 24px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(10, 61, 10, 0.3), rgba(10, 61, 10, 0.1));
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.scan-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(10, 61, 10, 0.5), rgba(10, 61, 10, 0.2));
  box-shadow: 0 0 20px rgba(10, 61, 10, 0.3);
}

.scan-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer */
.login-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
}

.login-footer .location {
  margin-top: 2px;
  font-size: 10px;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  .login-container {
    gap: 16px;
    padding: 16px;
  }

  .logo-icon {
    width: 56px;
    height: 56px;
  }

  .logo-icon i {
    font-size: 24px;
  }

  .logo-text {
    font-size: 22px;
  }

  .login-panel {
    padding: 24px 20px;
  }

  .pin-keypad {
    max-width: 240px;
    gap: 8px;
  }

  .pin-key {
    font-size: 20px;
    border-radius: 12px;
  }

  .fingerprint-scanner {
    width: 130px;
    height: 130px;
  }

  .fingerprint-scanner i {
    font-size: 50px;
  }
}

@media (min-width: 768px) {
  .login-card {
    max-width: 400px;
  }
}
