/* ===== 自定义变量 ===== */
:root {
  --primary-purple: #4a3b9f;
  --primary-orange: #f39346;
  --purple-light: #6a5bc7;
  --purple-dark: #352a7a;
}

/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "PingFang SC", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-purple) 0%, #2d1f6e 100%);
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* ===== 背景装饰 ===== */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 50%,
      rgba(243, 147, 70, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 70% 80%,
      rgba(74, 59, 159, 0.15) 0%,
      transparent 50%
    );
  animation: bgFloat 20s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes bgFloat {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(2%, -2%) rotate(2deg);
  }
}

/* ===== 浮动装饰圆 ===== */
.deco-circle {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(243, 147, 70, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  animation: floatCircle 15s ease-in-out infinite alternate;
}
.deco-circle--1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}
.deco-circle--2 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  left: -80px;
  animation-delay: -5s;
  background: radial-gradient(
    circle,
    rgba(74, 59, 159, 0.12) 0%,
    transparent 70%
  );
}
.deco-circle--3 {
  width: 200px;
  height: 200px;
  top: 40%;
  right: 5%;
  animation-delay: -10s;
  background: radial-gradient(
    circle,
    rgba(243, 147, 70, 0.06) 0%,
    transparent 70%
  );
}

@keyframes floatCircle {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(20px, -30px) scale(1.1);
  }
}

/* ===== 主卡片容器 ===== */
.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* ===== 登录卡片 ===== */
.login-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  padding: 48px 40px 44px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.35),
    0 10px 30px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease;
}

.login-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.4),
    0 15px 35px rgba(0, 0, 0, 0.2);
}

/* ===== Logo / 品牌区 ===== */
.brand {
  text-align: center;
  margin-bottom: 36px;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: #fff;
  font-size: 32px;
  box-shadow: 0 12px 28px rgba(74, 59, 159, 0.35);
  margin-bottom: 16px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.brand-icon:hover {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: 0 16px 36px rgba(74, 59, 159, 0.45);
}

.brand h1 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.brand p {
  color: #6b7280;
  font-size: 15px;
  font-weight: 400;
  margin: 0;
}

.brand .highlight {
  color: var(--primary-orange);
  font-weight: 600;
}

/* ===== 表单元素 ===== */
.form-group {
  margin-bottom: 22px;
  position: relative;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: block;
  letter-spacing: 0.3px;
}

.form-group .input-group {
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.form-group .input-group:focus-within {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 4px rgba(74, 59, 159, 0.12);
  background: #ffffff;
}

.form-group .input-group-text {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 18px;
  padding: 0 0 0 18px;
  transition: color 0.3s ease;
}

.form-group .input-group:focus-within .input-group-text {
  color: var(--primary-purple);
}

.form-group .form-control {
  border: none;
  background: transparent;
  padding: 14px 18px 14px 12px;
  font-size: 15px;
  color: #1a1a2e;
  box-shadow: none !important;
  height: auto;
}

.form-group .form-control::placeholder {
  color: #b0b8c4;
  font-weight: 400;
  font-size: 14px;
}

.form-group .form-control:focus {
  background: transparent;
  box-shadow: none !important;
}

/* ===== 额外选项 ===== */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 26px;
  flex-wrap: wrap;
  gap: 8px;
}

.form-options .custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #4b5563;
  user-select: none;
}

.form-options .custom-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-purple);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.form-options a {
  color: var(--primary-purple);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-options a:hover {
  color: var(--primary-orange);
  text-decoration: underline;
}

/* ===== 登录按钮 ===== */
.btn-login {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--primary-purple),
    var(--purple-light)
  );
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(74, 59, 159, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 36px rgba(74, 59, 159, 0.4);
  background: linear-gradient(
    135deg,
    var(--purple-dark),
    var(--primary-purple)
  );
}

.btn-login:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 16px rgba(74, 59, 159, 0.25);
}

.btn-login i {
  margin-right: 10px;
}

/* ===== 分割线 ===== */
.divider {
  display: flex;
  align-items: center;
  margin: 30px 0 24px;
  gap: 16px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #d1d5db, transparent);
}

.divider span {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===== 社交登录 ===== */
.social-login {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.social-login .btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 10px;
  border-radius: 14px;
  border: 2px solid #e5e7eb;
  background: #fafbfc;
  color: #4b5563;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.social-login .btn-social i {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.social-login .btn-social:hover {
  border-color: var(--primary-purple);
  background: #f5f3ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 59, 159, 0.1);
}

.social-login .btn-social:hover i {
  transform: scale(1.1);
}

.social-login .btn-social--google:hover {
  border-color: #ea4335;
  background: #fef0ee;
}
.social-login .btn-social--github:hover {
  border-color: #24292e;
  background: #f6f8fa;
}
.social-login .btn-social--microsoft:hover {
  border-color: #00a4ef;
  background: #eef7fe;
}

/* ===== 注册引导 ===== */
.signup-link {
  text-align: center;
  margin-top: 28px;
  font-size: 15px;
  color: #6b7280;
}

.signup-link a {
  color: var(--primary-purple);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
  border-bottom: 2px solid transparent;
}

.signup-link a:hover {
  color: var(--primary-orange);
  border-bottom-color: var(--primary-orange);
}

/* ===== 动画延迟辅助 ===== */
.delay-1 {
  animation-delay: 0.05s;
}
.delay-2 {
  animation-delay: 0.15s;
}
.delay-3 {
  animation-delay: 0.25s;
}
.delay-4 {
  animation-delay: 0.35s;
}
.delay-5 {
  animation-delay: 0.45s;
}

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 30px;
    border-radius: 24px;
  }

  .brand h1 {
    font-size: 22px;
  }
  .brand-icon {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .form-group .form-control {
    padding: 12px 14px 12px 10px;
    font-size: 14px;
  }
  .form-group .input-group-text {
    padding-left: 14px;
    font-size: 16px;
  }

  .btn-login {
    padding: 14px;
    font-size: 16px;
  }

  .social-login .btn-social {
    font-size: 13px;
    padding: 11px 8px;
  }
  .social-login .btn-social i {
    font-size: 17px;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .deco-circle--1,
  .deco-circle--2,
  .deco-circle--3 {
    display: none;
  }
}

@media (max-width: 380px) {
  .login-card {
    padding: 24px 16px 24px;
  }
  .social-login {
    flex-direction: column;
  }
}

/* ===== 输入框自动填充样式 ===== */
.form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
  -webkit-text-fill-color: #1a1a2e !important;
}
.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
}
