/**
 * 登录页面样式 - 基于礼品商城 login_bg.jpeg 背景设计
 * 配色：蓝色主调 #1E50C5，橙色点缀 #F5A623
 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body.login-page-bg {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/img/login_bg.jpeg') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  position: relative;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  padding: 20px;
  overflow-x: hidden;
}

body.login-page-bg::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 80, 197, 0.12);
  pointer-events: none;
  z-index: 0;
}

.login-page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2),
              0 0 1px rgba(255, 255, 255, 0.5) inset;
  padding: 48px 40px;
}

.login-card-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  display: block;
  height: 52px;
  width: auto;
  margin: 0 auto 16px;
}

.login-title {
  font-size: 26px;
  font-weight: 600;
  color: #1a3a7d;
  margin: 0 0 8px;
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 14px;
  color: #6b7a9e;
  margin: 0;
  font-weight: 400;
}

.login-form .form-group,
.login-form-group {
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
}

/* CakePHP 表单项包裹结构适配 */
.input-wrapper .input {
  margin: 0;
  width: 100%;
}

.input-wrapper .input input {
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a9bb5;
  font-size: 16px;
  z-index: 2;
  pointer-events: none;
  transition: color 0.2s ease;
}

.login-input {
  height: 48px !important;
  border-radius: 10px !important;
  border: 1px solid #e0e6ed !important;
  padding: 0 18px 0 44px !important;
  font-size: 15px !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

.login-input:focus {
  border-color: #1E50C5 !important;
  box-shadow: 0 0 0 3px rgba(30, 80, 197, 0.15) !important;
  outline: none !important;
}

.input-wrapper:focus-within .input-icon {
  color: #1E50C5;
}

.login-form .form-control,
.login-input {
  font-family: inherit;
}

.login-form .form-control::placeholder,
.login-input::placeholder {
  color: #a8b4c4;
}

.login-options {
  margin-bottom: 28px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5a6a8a;
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1E50C5;
  cursor: pointer;
  margin: 0;
}

.btn-login {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #1E50C5 0%, #2a62d4 100%) !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(30, 80, 197, 0.4);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
}

.btn-login:hover {
  background: linear-gradient(135deg, #2a62d4 0%, #356dd9 100%) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 80, 197, 0.5);
}

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

.btn-login .fa {
  transition: transform 0.2s ease;
}

.btn-login:hover .fa {
  transform: translateX(4px);
}

.login-error {
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  min-height: 20px;
}

.login-error:empty {
  display: none !important;
}

.login-error:not(:empty) {
  display: block !important;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ===== 注册链接 ===== */
.register-link-wrap {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: #6b7a9e;
}

.register-link {
  color: #1E50C5;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.register-link:hover {
  color: #2a62d4;
  text-decoration: underline;
}

/* ===== 注册表单相关 ===== */
.btn-register {
  background: linear-gradient(135deg, #1a7a4c 0%, #23996a 100%) !important;
  box-shadow: 0 4px 15px rgba(26, 122, 76, 0.4) !important;
}

.btn-register:hover {
  background: linear-gradient(135deg, #23996a 0%, #2ab87d 100%) !important;
  box-shadow: 0 6px 20px rgba(26, 122, 76, 0.5) !important;
}

.register-notice {
  background: #fffbea;
  border: 1px solid #ffe082;
  color: #8a6400;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.register-notice .fa {
  color: #f5a623;
  font-size: 15px;
  flex-shrink: 0;
}

.register-success-msg {
  margin-bottom: 8px;
}

.register-success-msg:empty,
.register-success-msg > *:empty {
  display: none;
}

.register-success-msg .message {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* 响应式适配 */
@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px;
  }
  .login-title {
    font-size: 22px;
  }
}
