body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
}

.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  padding: 40px 20px 0px;
  animation: fadeIn 0.6s ease-out;
}

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

.login-box {
  margin-top: 132px;
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .login-box {
    margin-top: 32px;
    padding: 32px 24px;
    border-radius: 20px;
  }
  
  .login-header h1 {
    font-size: 1.8rem;
  }
}

/* --- Shared Footer Styles (Mirroring index) --- */
.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 40px 0 24px;
  margin-top: auto;
  width: 100%;
  font-size: 0.8rem;
  color: #94a3b8;
}

.footer-credit {
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.footer-credit a {
  color: #a78bfa;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.footer-credit a:hover {
  color: #fff;
  transform: scale(1.1);
}

.contact-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
  opacity: 0.6;
  margin-right: -4px;
  letter-spacing: 0.02em;
}

.footer-divider {
  opacity: 0.3;
  user-select: none;
}

.discord-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.2);
  color: #5865f2;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.discord-link:hover {
  background: #5865f2;
  color: #fff;
  transform: scale(1.18) rotate(8deg);
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.4);
  border-color: #5865f2;
}

.discord-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Tooltip */
#app-tooltip {
  position: fixed;
  background: rgba(15, 12, 28, 0.98);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 350px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 999999 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.01em;
}

#app-tooltip.visible {
  opacity: 1;
}

.login-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.5), transparent);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, 
    #fff 0%, 
    #a78bfa 40%, 
    rgba(255, 255, 255, 0.9) 50%, 
    #a78bfa 60%, 
    #fff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-shine-sweep 12s linear infinite;
}

.login-header p {
  color: #94a3b8;
  margin: 12px auto 0;
  font-size: 0.90rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 300px;
}

.void-msg {
  text-justify: inter-word;
  text-wrap-style: pretty;
}

.access-cta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-weight: 600;
  color: #cbd5e1;
}

.input-block {
  margin-bottom: 8px;
  position: relative;
}

.input-block.has-error .login-input {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.field-error {
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  min-height: 16px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.field-error.visible {
  opacity: 1;
  transform: translateY(0);
}

.error-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  margin-bottom: 0px;
}

.error-wrapper:has(.error-banner.visible) {
  grid-template-rows: 1fr;
  margin-bottom: 24px;
}

.error-banner {
  min-height: 0;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 0 16px;
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  visibility: hidden;
  pointer-events: none;
}

.error-banner::before {
  content: '⚠️';
  font-size: 1rem;
}

.error-banner.visible {
  opacity: 1;
  padding: 12px 16px;
  visibility: visible;
  pointer-events: auto;
}

/* Session expired / warning variant — amber, no shake */
.error-banner.warning {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.error-banner.warning::before {
  content: '🔒';
}

#login-form {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-label {
  display: block;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

/* Inheriting from global design system inputs */
.login-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.login-input:focus {
  outline: none;
  border-color: #a855f7;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2), 0 12px 32px rgba(0, 0, 0, 0.4);
}

.btn-full {
  width: 100%;
  margin-top: 12px;
}

.error-shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.6;
}

.login-footer p {
  max-width: 320px;
  margin: 0 auto;
  text-align: center; /* Center is safer for UX on short text, but I'll make it feel tight */
}

.login-footer .highlight {
  color: #a78bfa;
  font-weight: 700;
}

.login-footer .version {
  display: block;
  margin-top: 8px;
  opacity: 0.5;
  font-size: 0.75rem;
}
