/* Modern Login Styles - Enhanced UX/UI */
:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ed8936;
  --card-bg: #ffffff;
  --card-border: rgba(102, 126, 234, 0.1);
  --text: #2d3748;
  --text-light: #718096;
  --text-muted: #a0aec0;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.login-root {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.login-root::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.15"/><circle cx="20" cy="80" r="0.5" fill="white" opacity="0.15"/><circle cx="90" cy="30" r="0.5" fill="white" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.brand-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--bg-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.brand-icon i {
  font-size: 36px;
  color: white;
}

.login-brand img {
  height: 80px;
  width: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-brand h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-brand p {
  color: var(--text-light);
  margin: 0;
  font-size: 16px;
}

.login-form-container {
  width: 100%;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text);
}

.login-form > p {
  color: var(--text-light);
  margin: 0 0 24px 0;
  font-size: 15px;
}

/* Enhanced Floating Labels */
.form-floating {
  position: relative;
  margin-bottom: 4px;
}

.form-floating .form-control {
  background: #fafbfc;
  border: 2px solid #e2e8f0;
  color: var(--text);
  padding: 20px 16px 12px;
  border-radius: var(--border-radius);
  font-size: 16px;
  width: 100%;
  transition: var(--transition);
  outline: none;
}

.form-floating .form-control::placeholder {
  color: transparent;
}

.form-floating .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #ffffff;
}

.form-floating .floating-label {
  position: absolute;
  left: 16px;
  top: 20px;
  pointer-events: none;
  color: var(--text-muted);
  transition: var(--transition);
  background: transparent;
  padding: 0 4px;
  font-size: 16px;
  font-weight: 500;
}

.form-floating input:focus + .floating-label,
.form-floating input:not(:placeholder-shown) + .floating-label,
.form-floating.has-value .floating-label {
  transform: translateY(-24px) scale(0.85);
  color: var(--primary);
  background: var(--card-bg);
  padding: 0 8px;
  font-weight: 600;
}

.form-floating .text-danger {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--danger);
  font-weight: 500;
}

/* Enhanced Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-check-input {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 4px;
  background: #fafbfc;
  transition: var(--transition);
  cursor: pointer;
}

.form-check-input:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.form-check-label {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

/* Enhanced Button */
.btn-login {
  background: var(--bg-gradient);
  border: none;
  padding: 16px 24px;
  border-radius: var(--border-radius);
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.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: left 0.5s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Links */
.forgot-password {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.forgot-password:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Side Illustration - Enhanced */
.login-side-illustration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: 
    linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="circuit" width="100" height="100" patternUnits="userSpaceOnUse"><rect width="100" height="100" fill="%23667eea" opacity="0.1"/><circle cx="20" cy="20" r="2" fill="white" opacity="0.3"/><circle cx="80" cy="20" r="2" fill="white" opacity="0.3"/><circle cx="20" cy="80" r="2" fill="white" opacity="0.3"/><circle cx="80" cy="80" r="2" fill="white" opacity="0.3"/><line x1="20" y1="20" x2="80" y2="20" stroke="white" stroke-width="1" opacity="0.2"/><line x1="20" y1="80" x2="80" y2="80" stroke="white" stroke-width="1" opacity="0.2"/><line x1="20" y1="20" x2="20" y2="80" stroke="white" stroke-width="1" opacity="0.2"/><line x1="80" y1="20" x2="80" y2="80" stroke="white" stroke-width="1" opacity="0.2"/><rect x="35" y="35" width="30" height="30" fill="none" stroke="white" stroke-width="1" opacity="0.15"/></pattern></defs><rect width="1000" height="1000" fill="url(%23circuit)"/></svg>'),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  background-size: cover, 200px 200px, 100% 100%, 100% 100%;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.login-side-illustration::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.3) 0%, transparent 40%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.illustration-card {
  max-width: 480px;
  color: #ffffff;
  text-align: center;
  z-index: 2;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.illustration-card h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.illustration-card p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 32px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.feature-list li::before {
  content: '✓';
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
  color: #ffffff;
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Enhanced Floating Shapes */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.floating-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  filter: blur(1px);
  animation: float 6s ease-in-out infinite;
}

.floating-shapes .s1 {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  left: 10%;
  top: 20%;
  animation-delay: 0s;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.floating-shapes .s2 {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  right: 15%;
  top: 60%;
  animation-delay: 2s;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.08);
}

.floating-shapes .s3 {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  left: 60%;
  top: 10%;
  animation-delay: 4s;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.12);
}

.floating-shapes .s4 {
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  right: 40%;
  bottom: 20%;
  animation-delay: 1s;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.15);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Loading State */
.btn-login.loading {
  pointer-events: none;
}

.btn-login.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Alert Styles */
.alert {
  border-radius: var(--border-radius);
  border: none;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-danger {
  background: rgba(245, 101, 101, 0.1);
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.15);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .login-side-illustration {
    display: none;
  }
  
  .login-root {
    padding: 20px;
  }
  
  .login-card {
    max-width: 400px;
    padding: 40px 32px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    margin: 0 16px;
  }
  
  .login-brand h1 {
    font-size: 24px;
  }
  
  .illustration-card h2 {
    font-size: 28px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #1a202c;
    --text: #f7fafc;
    --text-light: #cbd5e0;
    --text-muted: #a0aec0;
  }
  
  .form-floating .form-control {
    background: #2d3748;
    border-color: #4a5568;
    color: var(--text);
  }
  
  .form-floating .form-control:focus {
    background: #2d3748;
  }
}
