/* 基础重置与全局样式 */
* {
  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 {
  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;
  }
}

/* 左侧品牌展示区（简化版） */
.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;
}

/* 装饰性基础元素（保留简洁感） */
.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;
}

/* 响应式布局：桌面端左侧占比45% */
@media (min-width: 768px) {
  .login-brand {
    width: 45%;
  }
}

/* 品牌Logo（确保图标居中） */
.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;
  /* 强制图标居中，避免字体差异导致偏移 */
  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;
}

/* 右侧登录表单区 */
.login-form-wrapper {
  width: 100%;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
}

/* 响应式布局：桌面端右侧占比55% */
@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-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;
  /* 确保提示框内图标居中 */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 表单组件样式（核心修复：图标居中） */
.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;
  /* 确保输入框内容不与图标重叠 */
  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;
}

/* 输入框内图标（修复错位核心样式） */
.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  /* 精确垂直居中，避免受父元素影响 */
  transform: translateY(-50%);
  color: #86909C;
  font-size: 16px;
  transition: color 0.2s ease;
  /* 强制图标自身居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.form-control:focus + .input-icon {
  color: #165DFF;
}

/* 密码显示/隐藏按钮（确保与输入框图标对齐） */
.toggle-password {
  position: absolute;
  right: 42px;
  top: 50%;
  /* 与输入框图标保持同一垂直高度 */
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #86909C;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s ease;
  /* 按钮内图标居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
}

.toggle-password:hover {
  color: #165DFF;
}

/* 表单操作区（记住我与忘记密码） */
.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 {
  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;
  /* 复选框内图标强制居中 */
  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 {
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards 0.7s;
}

/* 按钮样式（确保加载图标与文字居中） */
.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);
}

/* 按钮悬停波纹效果 */
.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;
}

/* 错误提示样式 */
.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;
  /* 错误提示图标居中 */
  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;
}

/* 底部信息区 */
.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;
  /* 安全标识图标居中 */
  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;
}

/* 加载动画（确保在按钮中居中） */
.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;
  /* 加载动画居中 */
  display: none;
  align-items: center;
  justify-content: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-loading .loader {
  display: flex;
}

.btn-loading .text {
  display: none;
}

/* 响应式调整：移动端优化 */
@media (max-width: 767px) {
  .login-container {
    max-width: 500px;
  }

  .login-brand, .login-form-wrapper {
    padding: 40px 30px;
  }
}