/* ============================================================
   LOGIN PAGE STYLING
   Professional, high-tier authentication page.
   Crisp white background, centered modern card, clean inputs.
   ============================================================ */

body.login-body {
  background: radial-gradient(circle at 50% 30%, rgba(37, 99, 235, 0.04) 0%, rgba(255, 255, 255, 1) 70%), #FFFFFF;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
}

.login-nav {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--accent-primary);
}

.login-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.auth-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.1);
  text-align: center;
  position: relative;
  transition: transform var(--transition-normal);
}

.auth-logo-wrap {
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border: none;
  overflow: visible;
}

.auth-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  box-shadow: none;
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-primary);
  min-height: 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1rem;
  background-color: var(--accent-primary);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.auth-form {
  text-align: left;
}

.form-group {
  margin-bottom: 22px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

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

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.auth-input:focus {
  background: #FFFFFF;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.auth-input::placeholder {
  font-family: var(--font-sans);
  color: var(--text-muted);
}

.combo-arrow-btn {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.combo-arrow-btn:hover {
  color: var(--text-primary);
}

/* Recent Keys Dropdown */
.recent-keys-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.recent-keys-dropdown.active {
  display: block;
}

.recent-key-item {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recent-key-item:last-child {
  border-bottom: none;
}

.recent-key-item:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.client-hardware-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 8px 12px;
  background: var(--bg-canvas);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
}

.auth-submit-btn {
  width: 100%;
  height: 50px;
  font-size: 1rem;
}

.auth-status-alert {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

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

.alert-error {
  display: block;
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-success {
  display: block;
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.alert-info {
  display: block;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.login-footer-info {
  text-align: center;
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-footer-info a {
  color: var(--accent-primary);
  font-weight: 600;
}

.site-bottom-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 20px;
}

/* ============================================================
   LOGIN SUCCESS POPUP (FADES IN 1 SEC)
   ============================================================ */
.login-success-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(16, 185, 129, 0.96);
  color: #FFFFFF;
  padding: 16px 30px;
  border-radius: 9999px;
  box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 99999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  animation: loginPopupAnim 1s ease forwards;
}

.login-success-popup svg {
  width: 22px;
  height: 22px;
  stroke: #FFFFFF;
  stroke-width: 3;
}

@keyframes loginPopupAnim {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.85);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -55%) scale(0.95);
  }
}

