/* Basic reset and global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background 0.5s ease;
}
/* Login container styles */
.login-container {
  width: 100%;
  max-width: 900px;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  transform: translateY(0);
  opacity: 1;
  animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Left brand display area (simplified version) */
.login-brand {
  width: 100%;
  background: linear-gradient(135deg, #165DFF 0%, #0F48C9 100%);
  color: #fff;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* Decorative base elements (keep simplicity) */
.login-brand::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}
.brand-content {
  position: relative;
  z-index: 1;
}
/* Responsive layout: Left side takes 45% on desktop */
@media (min-width: 768px) {
  .login-brand {
    width: 45%;
  }
}
/* Brand Logo (ensure icon is centered) */
.brand-logo {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}
.brand-logo:hover {
  transform: scale(1.05);
}
.brand-logo i {
  font-size: 28px;
  /* Force icon to center, avoid offset due to font differences */
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.brand-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}
.brand-desc {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 32px;
}
/* Right login form area */
.login-form-wrapper {
  width: 100%;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
}
/* Responsive layout: Right side takes 55% on desktop */
@media (min-width: 768px) {
  .login-form-wrapper {
    width: 55%;
  }
}
.form-header {
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.3s;
}
.form-title {
  font-size: 22px;
  font-weight: 600;
  color: #1D2129;
  margin-bottom: 8px;
}
.form-subtitle {
  font-size: 14px;
  color: #86909C;
}
/* Target application prompt box (if there is a redirect address) */
.target-app-info {
  background-color: #F8FAFC;
  border-left: 3px solid #165DFF;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 30px;
  font-size: 13px;
  color: #334155;
  display: flex;
  align-items: center;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.4s;
}
.target-app-info i {
  margin-right: 8px;
  color: #165DFF;
  /* Ensure icon in prompt box is centered */
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Form component styles (core fix: icon centering) */
.form-group {
  margin-bottom: 24px;
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards;
}
.form-group:nth-child(1) { animation-delay: 0.4s; }
.form-group:nth-child(2) { animation-delay: 0.5s; }
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #4E5969;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #DCE1E8;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #1D2129;
  transition: all 0.2s ease;
  background-color: #fff;
  /* Ensure input content does not overlap with icon */
  padding-right: 50px;
}
.form-control:focus {
  outline: none;
  border-color: #165DFF;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}
.form-control::placeholder {
  color: #86909C;
}
/* Icons inside input box (core styles for fixing misalignment) */
.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  /* Precise vertical centering, avoid influence from parent */
  transform: translateY(-50%);
  color: #86909C;
  font-size: 16px;
  transition: color 0.2s ease;
  /* Force icon itself to center */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.form-control:focus + .input-icon {
  color: #165DFF;
}
/* Password show/hide button (ensure alignment with input icon) */
.toggle-password {
  position: absolute;
  right: 42px;
  top: 50%;
  /* Maintain same vertical height as input icon */
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #86909C;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s ease;
  /* Icon in button centered */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
}
.toggle-password:hover {
  color: #165DFF;
}
/* Form action area (remember me and forgot password) */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards 0.6s;
}
.remember-me {
  display: flex;
  align-items: center;
  cursor: pointer;
}
/* Custom checkbox (ensure check icon is centered) */
.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #DCE1E8;
  border-radius: 4px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.custom-checkbox.checked {
  background-color: #165DFF;
  border-color: #165DFF;
}
.custom-checkbox i {
  color: #fff;
  font-size: 10px;
  display: none;
  /* Checkbox inner icon forced centering */
  display: none;
  align-items: center;
  justify-content: center;
}
.custom-checkbox.checked i {
  display: flex;
}
.remember-text {
  font-size: 13px;
  color: #4E5969;
}
.forgot-password {
  font-size: 13px;
  color: #165DFF;
  text-decoration: none;
  transition: color 0.2s ease;
}
.forgot-password:hover {
  color: #0F48C9;
  text-decoration: underline;
}
/* Login button group */
.login-button-group {
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards 0.7s;
}
/* Button styles (ensure loading icon and text are centered) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, #165DFF 0%, #0F48C9 100%);
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0F48C9 0%, #0A3BAF 100%);
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.2);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.2);
}
/* Button hover ripple effect */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.btn-primary:hover::after {
  width: 300px;
  height: 300px;
}
/* Error prompt styles */
.alert-error {
  background-color: #FFF2F0;
  border-left: 4px solid #F53F3F;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  transform: translateX(0);
  animation: shake 0.5s ease, fadeIn 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.alert-icon {
  color: #F53F3F;
  font-size: 18px;
  margin-right: 12px;
  margin-top: 1px;
  /* Error prompt icon centering */
  display: flex;
  align-items: center;
  justify-content: center;
}
.alert-content {
  flex: 1;
}
.alert-title {
  font-size: 14px;
  font-weight: 600;
  color: #F53F3F;
  margin-bottom: 4px;
}
.alert-message {
  font-size: 13px;
  color: #772120;
}
/* Bottom information area */
.login-footer {
  margin-top: auto;
}
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #86909C;
  margin-bottom: 15px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.8s;
}
.security-badge i {
  margin-right: 6px;
  color: #10B981;
  /* Security badge icon centering */
  display: flex;
  align-items: center;
  justify-content: center;
}
.copyright {
  font-size: 12px;
  color: #86909C;
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid #F1F5F9;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 0.9s;
}
.copyright a {
  color: #86909C;
  text-decoration: none;
  margin: 0 5px;
}
.copyright a:hover {
  color: #165DFF;
  text-decoration: underline;
}
/* Loading animation (ensure centering in button) */
.loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  /* Loading animation centering */
  display: none;
  align-items: center;
  justify-content: center;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.btn-loading .loader {
  display: flex;
}
.btn-loading .text {
  display: none;
}
/* Responsive adjustments: Mobile optimization */
@media (max-width: 767px) {
  .login-container {
    max-width: 500px;
  }
  .login-brand, .login-form-wrapper {
    padding: 40px 30px;
  }
}