/* Login Page Styles - Clean design */

/* Full page background */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  padding: 1.5rem;
}

/* Loading state */
.login-loading {
  text-align: center;
  color: #6b7280;
  font-size: 1.1rem;
}

.login-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #003366;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Brand header - ABOVE card */
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.login-logo {
  width: 32px;
  height: 32px;
}

.login-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #003366;
}

/* Main card */
.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem 2rem;
  width: 100%;
  max-width: 380px;
}

/* Header row - Sign In + Stay signed in toggle */
.login-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.login-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* Line below header */
.login-line {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 1rem 0;
}

/* Toggle switch */
.login-toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: #6b7280;
}

.login-toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.login-toggle-switch input:checked + .toggle-slider {
  background: #5A9FD4;
}

.login-toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

/* Social login button */
.login-social-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  background: white;
  color: #1a1a1a;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.login-social-btn:hover {
  background: #fafafa;
  border-color: #d1d5db;
}

/* Divider */
.login-divider {
  text-align: center;
  color: #9ca3af;
  font-size: 0.6875rem;
  margin: 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Form styles */
.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 0.875rem;
}

.login-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.8125rem;
  color: #374151;
}

.login-field .optional {
  font-weight: 400;
  color: #9ca3af;
}

/* Label row for password + forgot link */
.login-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.login-label-row label {
  margin-bottom: 0;
}

.login-forgot-inline {
  font-size: 0.75rem;
  color: #5A9FD4;
  text-decoration: none;
  font-weight: 500;
}

.login-forgot-inline:hover {
  color: #003366;
  text-decoration: underline;
}

.login-field input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
  background: white;
}

.login-field input:focus {
  outline: none;
  border-color: #5A9FD4;
  box-shadow: 0 0 0 3px rgba(90, 159, 212, 0.15);
}

/* Hidden fields (for signup mode) */
#name-field,
#confirm-password-field,
#invite-code-field {
  display: none;
}

/* Error and success messages */
.login-error,
.login-success {
  display: none;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  margin-bottom: 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

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

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

/* Submit button */
.login-submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  background: #003366;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.login-submit-btn:hover {
  background: #002244;
}

.login-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Toggle link row */
.login-toggle {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
}

.login-toggle a {
  color: #5A9FD4;
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.25rem;
}

.login-toggle a:hover {
  color: #003366;
  text-decoration: underline;
}

/* Forgot password container */
.forgot-container {
  display: none;
}

.forgot-intro {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Demo button */
.login-demo {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.login-demo button {
  background: transparent;
  border: 1.5px solid #e5e7eb;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #6b7280;
  font-family: inherit;
  transition: all 0.15s ease;
  display: none;
}

.login-demo button:hover {
  border-color: #d1d5db;
  background: #fafafa;
}

/* Footer links */
.login-footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
}

.login-footer a {
  color: #5A9FD4;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .login-page {
    padding: 1rem;
  }

  .login-card {
    padding: 1.25rem 1.5rem;
  }

  .login-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .login-toggle-switch {
    align-self: flex-end;
  }
}
