/* Login Page - Custom Styling */

:root {
  --primary-blue: #2563eb;
  --primary-blue-dark: #1d4ed8;
  --primary-blue-light: #dbeafe;
  --success-green: #10b981;
  --success-green-dark: #059669;
  --neutral-50: #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-400: #9ca3af;
  --neutral-600: #4b5563;
  --neutral-900: #111827;
  --error-red: #ef4444;
  --error-red-light: #fee2e2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Hero/Background Section */
.login-hero {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 50%, #fef3c7 100%);
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

/* Decorative background elements */
.login-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: float 6s ease-in-out infinite;
}

.login-hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: float 8s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

.login-container {
  max-width: 420px;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* Logo/Icon Section */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
  animation: slide-up 0.6s ease-out;
}

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

.login-header h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.login-header .role-badge {
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: inline-block;
  opacity: 0;
  animation: slide-up 0.6s ease-out 0.1s forwards;
}

.login-header .subtitle {
  color: var(--neutral-600);
  font-size: 0.95rem;
  margin: 0;
}

/* Form Card */
.login-form-card {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: slide-up 0.6s ease-out 0.2s forwards;
  opacity: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 600;
  color: var(--neutral-900);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 2px solid var(--neutral-200);
  border-radius: 0.75rem;
  font-size: 0.95rem;
  color: var(--neutral-900);
  background: white;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input::placeholder {
  color: var(--neutral-400);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: linear-gradient(to bottom, white, rgba(37, 99, 235, 0.02));
}

.form-input:hover:not(:focus) {
  border-color: var(--neutral-300);
}

.form-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--neutral-400);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-input:focus ~ .form-icon {
  color: var(--primary-blue);
}

/* Password toggle button */
.password-toggle {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--neutral-400);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
  font-size: 0.95rem;
}

.password-toggle:hover {
  color: var(--neutral-600);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-blue);
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--neutral-600);
  cursor: pointer;
  user-select: none;
}

/* Forgot Password Link */
.forgot-password-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.forgot-password-link:hover {
  color: var(--primary-blue-dark);
  text-decoration: underline;
}

/* Submit Button */
.submit-button {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 4px 15px -3px rgba(37, 99, 235, 0.4);
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(37, 99, 235, 0.5);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Demo Button */
.demo-button {
  padding: 0.75rem 1.5rem;
  background: var(--neutral-100);
  color: var(--neutral-900);
  border: 2px solid var(--neutral-200);
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.demo-button:hover {
  background: white;
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Divider */
.form-divider {
  position: relative;
  text-align: center;
  margin: 0.5rem 0;
}

.form-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--neutral-200);
}

.form-divider-text {
  position: relative;
  background: white;
  padding: 0 1rem;
  color: var(--neutral-500);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Links Section */
.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--neutral-200);
}

.login-footer p {
  color: var(--neutral-600);
  font-size: 0.875rem;
}

.signup-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.signup-link:hover {
  color: var(--primary-blue-dark);
}

/* Trust Indicators */
.trust-indicators {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--neutral-200);
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.trust-badge i {
  color: var(--success-green);
  font-size: 1rem;
}

/* Message Container */
.message-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
}

@media (max-width: 640px) {
  .message-container {
    left: 1rem;
    right: 1rem;
  }
}

.message {
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slide-down 0.3s ease-out;
  backdrop-filter: blur(10px);
}

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

.message.success {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
  border: 1px solid var(--success-green-dark);
  color: var(--success-green-dark);
}

.message.error {
  background: linear-gradient(135deg, var(--error-red-light) 0%, white 100%);
  border: 1px solid var(--error-red);
  color: var(--error-red);
}

.message-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  font-size: 1.25rem;
  padding: 0;
}

.message-close:hover {
  opacity: 1;
}

/* Loading Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

  .login-container {
    max-width: 100%;
  }

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

  .login-header h1 {
    font-size: 1.5rem;
  }

  .trust-indicators {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .login-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #3d2a1f 100%);
  }

  .login-form-card {
    background: #2d2d2d;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .login-header h1 {
    color: #f9fafb;
  }

  .login-header .subtitle {
    color: #d1d5db;
  }

  .form-label {
    color: #f9fafb;
  }

  .form-input {
    background: #3d3d3d;
    border-color: #4d4d4d;
    color: #f9fafb;
  }

  .form-input::placeholder {
    color: #9ca3af;
  }

  .form-input:focus {
    background: linear-gradient(to bottom, #3d3d3d, rgba(37, 99, 235, 0.1));
  }

  .form-divider-text {
    background: #2d2d2d;
  }

  .login-footer,
  .trust-indicators {
    border-top-color: #4d4d4d;
  }

  .login-footer p,
  .trust-badge {
    color: #d1d5db;
  }
}
