* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --accent-blue: #007aff;
  --accent-purple: #5856d6;
  --accent-pink: #ff2d55;
  --accent-cyan: #00d4ff;
  --error-color: #ff3b30;
  --success-color: #30d158;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Background Effects */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  animation-delay: -7s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-pink) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(-30px, -20px) scale(1.02);
  }
}

/* Login Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.logo-ring {
  width: 64px;
  height: 64px;
  border: 3px solid transparent;
  border-radius: 50%;
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary))
      padding-box,
    linear-gradient(
        135deg,
        var(--accent-cyan),
        var(--accent-purple),
        var(--accent-pink)
      )
      border-box;
  position: relative;
  animation: ringPulse 3s ease-in-out infinite;
}

.logo-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent-cyan),
    var(--accent-purple),
    var(--accent-pink)
  );
  opacity: 0.3;
  filter: blur(12px);
  z-index: -1;
}

@keyframes ringPulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(88, 86, 214, 0.5);
  }
}

.logo-text {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 16px;
  letter-spacing: -0.5px;
  background: linear-gradient(
    135deg,
    var(--text-primary),
    var(--text-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section Labels */
.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center;
}

/* User Selection */
.user-select-section {
  margin-bottom: 32px;
}

.user-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.user-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.user-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.user-btn span,
.user-btn {
  position: relative;
  z-index: 1;
}

.user-btn:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 212, 255, 0.2);
}

.user-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.user-btn.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3),
    0 0 0 4px rgba(0, 212, 255, 0.1);
  animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3),
      0 0 0 4px rgba(0, 212, 255, 0.1);
  }
  50% {
    box-shadow: 0 8px 32px rgba(88, 86, 214, 0.4),
      0 0 0 8px rgba(88, 86, 214, 0.1);
  }
}

/* PIN Section */
.pin-section {
  margin-bottom: 32px;
}

.pin-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pin-digit {
  width: 44px;
  height: 56px;
  border-radius: 12px;
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  caret-color: var(--accent-cyan);
}

.pin-digit:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1),
    0 4px 12px rgba(0, 212, 255, 0.2);
  transform: translateY(-2px);
}

.pin-digit.filled {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-cyan);
}

.pin-digit.error {
  border-color: var(--error-color);
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

/* Login Button */
.login-btn {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4);
}

.login-btn:not(:disabled):hover::before {
  opacity: 1;
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-text {
  position: relative;
  z-index: 1;
}

.btn-loader {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.login-btn.loading .btn-text {
  opacity: 0;
}

.login-btn.loading .btn-loader {
  display: block;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Error Message */
.error-message {
  text-align: center;
  color: var(--error-color);
  font-size: 14px;
  margin-top: 16px;
  min-height: 20px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}

.error-message.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Page transition overlay */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}


.page-transition.active {
  opacity: 1;
  pointer-events: all;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .glass-card {
    padding: 32px 20px;
  }
  
  .user-btn {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }
  
  .pin-inputs {
    gap: 6px;
  }
  
  .pin-digit {
    width: 38px;
    height: 48px;
    font-size: 20px;
    border-radius: 8px;
  }
}
