:root {
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hw-charcoal: #1e1e1e;
  --hw-graphite: #656f77;
  --hw-light-gray: #f5f5f7;
  --color-accent: #a41034;
  --color-accent-hover: #8a0d2b;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
}

.login-key-body {
  font-family: var(--font-body);
  background-image: url('../images/keyloginbackground.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-key-header {
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  padding: 31px 24px;
  text-align: center;
}

.login-key-header .header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #333;
  font-size: 1.0rem;
}

.login-key-header .header-icon {
  width: 24px;
  height: 24px;
  color: #666;
}

.login-key-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-key-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 400px;
  padding: 40px 48px;
}

.card-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.logo-cemi {
  color: var(--hw-charcoal);
  font-family: var(--font-heading);
}

.logo-key {
  color: #6e7881;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.card-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 20px 0 28px;
}

.login-key-form {
  display: flex;
  flex-direction: column;
}

.form-title {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--hw-charcoal);
  margin-bottom: 20px;
  text-align: left;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hw-charcoal);
  margin-bottom: 8px;
  text-align: left;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: #93a1adf2;
  box-shadow: 0 0 0 3px rgba(127, 146, 151, 0.1);
}

.submit-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: #fff;
  background: #717171;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}

.submit-btn:hover {
  background: #93a1adf2
}

.submit-btn:active {
  transform: scale(0.98);
}

.form-links {
  margin-top: 16px;
  text-align: left;
}

.form-link {
  color: #000;
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-base);
}

.form-link:hover {
  color: #93a1adf2
}

.link-icon {
  width: 12px;
  height: 12px;
}

.login-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  text-align: center;
}

.login-message.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.login-message.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.login-key-footer {
  padding: 16px 24px;
  text-align: right;
}

.footer-link {
  color: #2b2b2b;
  font-size: 0.8rem;
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-link:hover {
  text-decoration: underline;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loader-spinner {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.spinner-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hw-charcoal);
  animation: bounce 1.4s infinite ease-in-out;
}

.spinner-circle:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-circle:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.loader-text {
  font-size: 0.95rem;
  color: #4a5568;
  font-weight: 500;
}

@media (max-width: 480px) {
  .login-key-card {
    padding: 32px 24px;
    margin: 0 16px;
  }

  .logo-text {
    font-size: 1.3rem;
  }

  .form-title {
    font-size: 1.1rem;
  }
}
