:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #4f46e5;
  --primary-dark: #3730a3;
  --accent-color: #10b981;
  --danger-color: #dc2626;

  --white: #ffffff;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;

  --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.12);
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--primary-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Login Section */
.login-section {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 15px;
  z-index: 10;
  position: relative;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
  animation: cardSlideIn 0.6s ease-out;
}

@keyframes cardSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Login Form Section */
.login-form {
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
}

.login-form h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 25px;
  text-align: center;
  letter-spacing: -0.02em;
}

/* Alert Styles */
.alert {
  padding: 10px 14px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-left: 3px solid var(--danger-color);
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left: 3px solid var(--accent-color);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
  font-size: 13px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  font-family: inherit;
}

.form-control::placeholder {
  color: var(--gray-400);
  font-size: 13px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.form-control:valid:not(:placeholder-shown) {
  border-color: var(--accent-color);
}

.input-group {
  display: flex;
  position: relative;
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  flex: 1;
}

.password-toggle {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-left: none;
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-500);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
}

.password-toggle:hover {
  background: var(--gray-100);
  color: var(--primary-color);
}

.input-group:focus-within .password-toggle {
  border-color: var(--primary-color);
}

/* Button Styles */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Register Link */
.register-link {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-600);
}

.register-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.register-link a:hover {
  color: var(--primary-dark);
}

/* Login Image Section */
.login-image {
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 25px;
}

.login-text {
  text-align: center;
  position: relative;
}

.login-text h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.login-text p {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto 20px;
}

.feature-list {
  list-style: none;
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

.feature-list li {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.9;
  font-size: 13px;
}

.feature-list li i {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  width: 16px;
}

/* Loading State */
.loading .btn-primary {
  background: var(--gray-400);
  cursor: not-allowed;
}

.loading .btn-primary::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 968px) {
  .login-card {
    grid-template-columns: 1fr;
  }

  .login-image {
    order: -1;
    min-height: 180px;
    padding: 20px;
  }

  .login-text h2 {
    font-size: 20px;
  }

  .login-text p {
    font-size: 13px;
  }

  .feature-list {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-section {
    padding: 10px;
  }

  .login-form {
    padding: 20px 18px;
  }

  .login-form h3 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .login-image {
    min-height: 140px;
    padding: 15px;
  }

  .login-text h2 {
    font-size: 18px;
  }

  .form-group {
    margin-bottom: 12px;
  }
}

/* Security Badge */
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 15px;
  padding: 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--border-radius);
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 500;
}

/* Focus Enhancement */
.form-control:focus,
.btn-primary:focus,
.register-link a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
}
