/* login.css - Ultra Sophisticated Design */
:root {
  --primary: #4361ee;
  --primary-dark: #3a0ca3;
  --primary-light: #4895ef;
  --secondary: #f72585;
  --accent: #4cc9f0;
  --dark: #212529;
  --light: #f8f9fa;
  --success: #4bb543;
  --error: #ff3333;
  --glass: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Base Styles with Fluid Typography */
body {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--light);
  line-height: 1.6;
  padding: 2rem;
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Particle Background Effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(67, 97, 238, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 80% 70%, rgba(247, 37, 133, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 40% 60%, rgba(76, 201, 240, 0.1) 0%, transparent 20%);
  z-index: -1;
}

/* Main Container with Glass Morphism */
.container {
  max-width: 480px;
  width: 100%;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1;
}

.container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(67, 97, 238, 0.1),
    rgba(247, 37, 133, 0.1),
    rgba(76, 201, 240, 0.1)
  );
  transform: rotate(30deg);
  z-index: -1;
  animation: shine 8s infinite linear;
}

@keyframes shine {
  0% { transform: rotate(30deg) translate(-30%, -30%); }
  100% { transform: rotate(30deg) translate(30%, 30%); }
}

/* Typography with Fluid Scaling */
h2 {
  color: white;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  display: inline-block;
  width: 100%;
}

h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.text-muted {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 2rem;
  display: block;
}

/* Form Elements with Advanced Styling */
.form-label {
  font-weight: 500;
  color: white;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: none;
  margin-bottom: 1.5rem;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
  color: white;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Button with Micro-interactions */
.btn-login {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 12px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: white;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
  margin-top: 1rem;
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(67, 97, 238, 0.5);
}

.btn-login:active {
  transform: translateY(1px);
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.btn-login:hover::before {
  left: 100%;
}

/* Alert with Animation */
.alert {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: none;
  animation: slideIn 0.5s ease-out;
}

.alert-danger {
  background: rgba(255, 51, 51, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border-left: 4px solid var(--error);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating Label Alternative (Uncomment to use) */
/*
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-control {
  padding-top: 1.5rem;
}

.form-label {
  position: absolute;
  top: 0.75rem;
  left: 1.25rem;
  font-size: 0.8rem;
  opacity: 0.7;
  transform-origin: left center;
  transition: all 0.3s ease;
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
  transform: translateY(-0.5rem) scale(0.85);
  opacity: 1;
}
*/

/* Password Toggle Feature */
.password-toggle {
  position: relative;
}

.password-toggle .form-control {
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

.toggle-password:hover {
  color: white;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
  .container {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }
  
  body {
    padding: 1rem;
  }
}

/* Loading Animation for Form Submission */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
  vertical-align: middle;
}

/* Hover Effects for Interactive Elements */
.form-control:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Accessibility Focus Styles */
.form-control:focus-visible,
.btn-login:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Custom Checkbox for "Remember Me" */
.form-check-input {
  width: 1.2em;
  height: 1.2em;
  margin-top: 0.15em;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

/* Forgot Password Link */
.forgot-password {
  display: block;
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: var(--accent);
  text-decoration: none;
}