/* ==========================================================================
 * login.css —— 登录页
 * ========================================================================== */

.login-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 0;
  overflow: hidden;
}

/* 窗口太矮时允许纵向滚动，别把卡片裁掉 */
body.login-page {
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- 背景装饰：网格 + 扫描线 ---------- */

.bg-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(63, 224, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 224, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(56deg);
  transform-origin: center 30%;
  animation: gridMove 18s linear infinite;
  opacity: .8;
  pointer-events: none;
}

@keyframes gridMove {
  from { background-position: 0 0; }
  to   { background-position: 0 560px; }
}

.bg-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1200px;
  height: 1200px;
  margin: -600px 0 0 -600px;
  background: radial-gradient(circle, rgba(47, 123, 255, .28), rgba(47, 123, 255, .06) 45%, transparent 64%);
  filter: blur(10px);
  pointer-events: none;
}

/* ---------- 登录卡片 ---------- */

.login-card {
  position: relative;
  z-index: 2;
  width: 448px;
  padding: 50px 44px 36px;
  background: linear-gradient(180deg, rgba(10, 34, 70, .92), rgba(5, 18, 40, .96));
  border: 1px solid rgba(63, 224, 255, .28);
  box-shadow:
    0 0 0 1px rgba(6, 22, 46, .9) inset,
    0 24px 70px rgba(0, 0, 0, .65),
    0 0 60px rgba(47, 123, 255, .18);
  backdrop-filter: blur(6px);
  animation: cardIn .5s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* 四角装饰 */
.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--cyan);
  opacity: .85;
}
.login-card::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.login-card::after  { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

/* 顶部扫光 */
.login-card .sheen {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: sheen 3.4s ease-in-out infinite;
  opacity: .8;
}
@keyframes sheen {
  0%, 100% { opacity: .15; transform: scaleX(.35); }
  50%      { opacity: .9;  transform: scaleX(1); }
}

/* ---------- 头部 ---------- */

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border: 1px solid rgba(63, 224, 255, .45);
  background: radial-gradient(circle at 50% 40%, rgba(63, 224, 255, .22), transparent 70%);
  transform: rotate(45deg);
}
.brand-mark svg { transform: rotate(-45deg); }

.login-brand h1 {
  margin: 0 0 9px;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 3.4px;
  color: #fff;
  text-shadow: 0 0 18px rgba(63, 224, 255, .55);
}

.login-brand p {
  margin: 0;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--txt-3);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- 表单 ---------- */

.field {
  position: relative;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--txt-2);
}

.field-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 12px;
  background: rgba(3, 14, 32, .75);
  border: 1px solid rgba(70, 170, 255, .28);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.field-box:focus-within {
  border-color: var(--cyan);
  background: rgba(3, 20, 44, .9);
  box-shadow: 0 0 0 3px rgba(63, 224, 255, .10), 0 0 22px rgba(63, 224, 255, .12);
}

.field-box .ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  color: var(--cyan);
  opacity: .8;
}

.field-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--txt);
  font-size: 14px;
  letter-spacing: .6px;
  caret-color: var(--cyan);
}

.field-box input::placeholder { color: #45698c; }

/* Chrome 自动填充的丑陋白底，强行压掉 */
.field-box input:-webkit-autofill,
.field-box input:-webkit-autofill:hover,
.field-box input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--txt);
  -webkit-box-shadow: 0 0 0 1000px rgba(3, 14, 32, .9) inset;
  transition: background-color 9999s ease-out;
}

/* 密码显隐 */
.eye-btn {
  flex: 0 0 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--txt-3);
  transition: color .2s;
}
.eye-btn:hover { color: var(--cyan); }

/* 记住账号 */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 22px;
  font-size: 12px;
  color: var(--txt-2);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}
.checkbox input { display: none; }
.checkbox i {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(70, 170, 255, .5);
  display: inline-block;
  position: relative;
  transition: all .15s;
}
.checkbox input:checked + i {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(63, 224, 255, .6);
}
.checkbox input:checked + i::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 4px;
  height: 7px;
  border: solid #04203a;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* 提交按钮 */
.btn-submit {
  position: relative;
  width: 100%;
  height: 48px;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 6px;
  color: #02182e;
  background: linear-gradient(90deg, #2f7bff, #3fe0ff 55%, #8ef4ff);
  box-shadow: 0 8px 26px rgba(47, 123, 255, .38);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-submit:hover { filter: brightness(1.08); box-shadow: 0 10px 32px rgba(63, 224, 255, .48); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit[disabled] { cursor: not-allowed; filter: grayscale(.5) brightness(.8); }

.btn-submit .ripple {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: btnSheen 2.6s ease-in-out infinite;
}
@keyframes btnSheen {
  0%        { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* 错误提示 */
.msg {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 0;
  margin: 0;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--danger);
  opacity: 0;
  transition: height .22s, opacity .22s, margin .22s;
}
.msg.show {
  height: 20px;
  margin: 0 0 12px;
  opacity: 1;
}
.msg.ok { color: var(--ok); }

.shake { animation: shake .38s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* 底部 */
.login-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(70, 170, 255, .14);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--txt-3);
}
.login-foot code {
  padding: 1px 6px;
  background: rgba(63, 224, 255, .10);
  border: 1px solid rgba(63, 224, 255, .22);
  color: var(--cyan);
  font-size: 11.5px;
  letter-spacing: .5px;
}

/* 页面底部版权 */
.page-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(95, 134, 168, .65);
  pointer-events: none;
}

@media (max-width: 520px) {
  .login-card { width: calc(100% - 32px); padding: 34px 24px 26px; }
  .login-brand h1 { font-size: 18px; letter-spacing: 2px; }
}
