:root {
  --login-bg: #eef2f8;
  --line: rgba(255, 255, 255, 0.45);
  --text: #0f172a;
  --muted: #4b5563;
  --primary: #84a2d4;
  --primary-hover: #738fc0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--login-bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.login-page {
  min-height: 100vh;
}

.login-main {
  position: relative;
  width: min(100vw, var(--login-max, 1280px));
  height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.login-bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: var(--login-grid-gap, 2px);
  background: var(--line);
}

.login-tile {
  position: relative;
  overflow: hidden;
  background: #dce4f4;
}

.login-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px) saturate(0.86) brightness(0.92);
  transform-origin: center center;
  animation-name: var(--anim, loginBreathA);
  animation-duration: var(--dur, 10s);
  animation-delay: var(--delay, 0s);
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  will-change: transform, filter;
}

.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(243, 246, 252, 0.38);
  backdrop-filter: blur(2px);
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(420px, calc(100% - 40px));
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28), 0 10px 28px rgba(15, 23, 42, 0.14);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--text);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  height: 42px;
  border: 1px solid #c8d2e2;
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 16px;
}

.login-form input:focus {
  outline: none;
  border-color: #9db4d5;
  box-shadow: 0 0 0 3px rgba(157, 180, 213, 0.22);
}

.login-btn {
  margin-top: 4px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.login-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 24px rgba(115, 143, 192, 0.45);
}

.login-btn:active {
  transform: translateY(1px) scale(0.995);
}

.error {
  margin: 2px 0 0;
  color: #c23c3c;
  font-size: 14px;
  min-height: 20px;
}

@keyframes loginBreathA {
  0% {
    transform: scale(1.02) translate3d(0, 0, 0);
    filter: blur(6px) saturate(0.84) brightness(0.9);
  }
  50% {
    transform: scale(var(--max-scale, 1.1)) translate3d(0, calc(var(--drift, 4px) * -1), 0);
    filter: blur(5px) saturate(0.96) brightness(0.98);
  }
  100% {
    transform: scale(1.02) translate3d(0, 0, 0);
    filter: blur(6px) saturate(0.84) brightness(0.9);
  }
}

@keyframes loginBreathB {
  0% {
    transform: scale(1.03) translate3d(0, 0, 0);
    filter: blur(6px) saturate(0.82) brightness(0.9);
  }
  50% {
    transform: scale(var(--max-scale, 1.09)) translate3d(0, var(--drift, 4px), 0);
    filter: blur(5px) saturate(0.95) brightness(0.99);
  }
  100% {
    transform: scale(1.03) translate3d(0, 0, 0);
    filter: blur(6px) saturate(0.82) brightness(0.9);
  }
}

@media (max-width: 900px) {
  .login-main {
    width: 100vw;
  }

  .login-backdrop {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
  }
}
