body.page-login, body.page-signup, body.page-logout, body.page-forgot-password, html {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: 
    radial-gradient(at 40% 20%, hsla(240, 70%, 40%, 0.6) 0px, transparent 50%),
    radial-gradient(at 80% 0%, hsla(280, 60%, 35%, 0.6) 0px, transparent 50%),
    radial-gradient(at 0% 50%, hsla(260, 80%, 45%, 0.5) 0px, transparent 50%),
    radial-gradient(at 80% 50%, hsla(250, 70%, 40%, 0.5) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsla(270, 60%, 35%, 0.6) 0px, transparent 50%),
    radial-gradient(at 80% 100%, hsla(240, 80%, 45%, 0.5) 0px, transparent 50%),
    radial-gradient(at 0% 0%, hsla(260, 70%, 40%, 0.6) 0px, transparent 50%);
  height: 100%;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2px 0px;
}

.nav-logo {
  height: 30px;
}

/* Main Section */
.login-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(59, 130, 246, 0.05);
  min-height: 0; /* Allow shrinking */
  overflow-y: auto; /* Enable scrolling if needed */
}

.login-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1.6rem 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
  margin: auto;
}

.login-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
  font-weight: 600;
}

.login-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.alert {
  padding: 0.75rem;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.alert p {
  margin: 0;
  padding: 0;
}

/* Form Styling */
.form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  background: white;
}

/* Error styling */
.form-group input.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.error-message {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 0.3rem;
  line-height: 1.3;
  display: block;
}

.forgot-link {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  color: #3b82f6;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
  color: #2563eb;
}

.checkbox-group {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  color: #374151;
}

.checkbox-group label {
  font-weight: 400;
  color: #374151;
}

.btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: rgba(255, 255, 255, 0.8);
}

.signup-link {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  color: #64748b;
}

.signup-link a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.signup-link a:hover {
  text-decoration: underline;
  color: #2563eb;
}

/* Footer */
.site-footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  padding: 10px 0px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.site-footer p {
  margin: 0;
  font-size: 12px;
}

/* Responsive Design */
@media (max-height: 700px) {
  .login-section {
    padding: 0.5rem;
  }
  
  .login-box {
    padding: 1.2rem 1.5rem;
  }
  
  .login-title {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
  }
  
  .login-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .alert {
    padding: 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-group input[type="text"],
  .form-group input[type="password"],
  .form-group input[type="email"] {
    padding: 0.6rem 0.8rem;
  }
  
  .btn {
    padding: 0.6rem;
  }
  
  .signup-link {
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 1.2rem 1.5rem;
    margin: 0.5rem;
  }
  
  .alert {
    padding: 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
  }
  
  .nav-container {
    padding: 1px 0px;
  }
  
  .nav-logo {
    height: 25px;
  }
  
  .site-header {
    padding: 0.5rem 1rem;
  }
}

/* Ensure page doesn't break on very small screens */
@media (max-height: 600px) {
  .page-wrapper {
    min-height: 100vh;
    height: auto;
  }
  
  .login-section {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 1rem;
  }
  
  .login-box {
    padding: 1rem 1.5rem;
  }
  
  .alert {
    padding: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
  }
  
  .login-title {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
  }
  
  .login-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  
  .form-group {
    margin-bottom: 0.8rem;
  }
  
  .site-footer {
    padding: 5px 0px;
  }
}