* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #eef3ff;
  color: #0d173a;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.login-page {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.login-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.auth-card {
  position: absolute;
  top: 50%;
  right: clamp(34px, 8.6vw, 164px);
  width: clamp(460px, 28.6vw, 548px);
  max-height: calc(100svh - 48px);
  padding: clamp(20px, 2.85vh, 27px) clamp(30px, 2.2vw, 42px) 22px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 54px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 22% 20%, rgba(237, 255, 242, 0.64), transparent 28%),
    radial-gradient(circle at 77% 31%, rgba(238, 244, 255, 0.78), transparent 34%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 54px rgba(105, 122, 190, 0.18);
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  margin: 0 72px;
}

.auth-tab {
  position: relative;
  height: clamp(52px, 6.85vh, 65px);
  border: 0;
  background: transparent;
  color: #6c778b;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.active {
  color: #265bff;
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: #2757ff;
  transform: translateX(-50%);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: clamp(30px, 5.6vh, 53px);
}

.social-card {
  height: clamp(74px, 9.4vh, 89px);
  border: 1px solid rgba(223, 229, 247, 0.95);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 25px rgba(111, 127, 183, 0.12);
  color: #000;
  font-size: 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.social-card:hover {
  border-color: rgba(125, 146, 255, 0.42);
  box-shadow: 0 17px 28px rgba(92, 112, 184, 0.18);
  transform: translateY(-2px);
}

.social-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

.social-icon img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.wechat .social-icon img {
  filter: drop-shadow(0 7px 8px rgba(22, 205, 76, 0.32));
}

.qq .social-icon img {
  filter: drop-shadow(0 8px 9px rgba(36, 123, 242, 0.3));
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 19px;
  margin-top: clamp(26px, 4.2vh, 40px);
  color: #66728a;
  font-size: 14px;
  font-weight: 600;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: #d9deed;
}

.auth-form {
  margin-top: clamp(22px, 3.5vh, 33px);
}

.field {
  width: 100%;
  height: clamp(52px, 6.2vh, 58px);
  padding: 0 24px 0 18px;
  border: 1px solid #e1e6f7;
  border-radius: 17px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 12px rgba(103, 121, 179, 0.08);
}

.field + .field {
  margin-top: 14px;
}

.field:focus-within {
  border-color: #9ca9ff;
  box-shadow: 0 8px 16px rgba(78, 96, 245, 0.12);
}

.field-icon {
  width: 27px;
  height: 27px;
  margin-right: 18px;
  display: grid;
  place-items: center;
  color: #6b7891;
}

.field-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-icon-image img {
  width: 27px;
  height: 27px;
  display: block;
  object-fit: contain;
}

.field-icon-phone img {
  width: 22px;
  height: 30px;
}

.field-icon-code img {
  width: 28px;
  height: 28px;
}

.field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0d173a;
  font-size: 17px;
  font-weight: 500;
}

.field input::placeholder {
  color: #9ba6ba;
}

.code-button {
  width: 105px;
  height: 32px;
  margin-left: 18px;
  border: 0;
  border-left: 1px solid #dfe4f4;
  padding-left: 22px;
  background: transparent;
  color: #2456ff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.code-button[disabled] {
  color: #95a0b5;
  cursor: default;
}

.agreement {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(16px, 2.35vh, 22px);
  color: #66728a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.agreement input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fake-check {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid #dce2f2;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.74);
}

.agreement input:checked + .fake-check {
  border-color: #2b5cff;
  background: #2b5cff;
  box-shadow: inset 0 0 0 4px #fff;
}

.agreement a {
  color: #2456ff;
  text-decoration: none;
}

.submit-button {
  position: relative;
  width: 100%;
  height: clamp(58px, 7vh, 66px);
  margin-top: clamp(22px, 3.3vh, 31px);
  border: 0;
  border-radius: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  background: #6d63f7 url("./assets/login-submit.png") center / 100% 100% no-repeat;
  box-shadow: 0 12px 22px rgba(80, 90, 227, 0.18);
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.submit-button:hover {
  box-shadow: 0 15px 27px rgba(80, 90, 227, 0.24);
  transform: translateY(-2px);
}

.submit-button[disabled] {
  opacity: 0.68;
  cursor: default;
  transform: none;
}

.submit-arrow {
  display: none;
}

.auth-message {
  min-height: 20px;
  margin: 11px 0 0;
  color: #2456ff;
  font-size: 13px;
  text-align: center;
}

.auth-message.error {
  color: #d94242;
}

.auto-register {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #8a96aa;
  font-size: 14px;
  font-weight: 500;
}

.auto-register span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
}

.auto-register img {
  width: 25px;
  height: 25px;
  display: block;
  object-fit: contain;
}

.qr-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: inherit;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-modal[hidden] {
  display: none;
}

.qr-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: inherit;
  background: rgba(32, 40, 76, 0.18);
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.qr-card {
  position: relative;
  z-index: 1;
  width: 336px;
  padding: 25px 30px 28px;
  border: 1px solid rgba(230, 235, 255, 0.92);
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 42px rgba(88, 103, 172, 0.22);
}

.qr-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #7b879c;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.qr-provider-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.qr-card h2 {
  margin: 12px 0 16px;
  color: #12204a;
  font-size: 20px;
  font-weight: 600;
}

.qr-code {
  position: relative;
  width: 188px;
  height: 188px;
  padding: 14px;
  border: 1px solid #e2e7fb;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 8px #f6f8ff;
}

.qr-code img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 10px;
}

.qr-code span,
.qr-code::before,
.qr-code::after {
  content: "";
  position: absolute;
  display: block;
}

.qr-code span {
  inset: 24px;
  background:
    linear-gradient(90deg, #141b3e 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(#141b3e 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(90deg, transparent 10px, #141b3e 10px) 10px 10px / 30px 30px,
    linear-gradient(transparent 10px, #141b3e 10px) 10px 10px / 30px 30px;
  background-position:
    var(--qr-shift, 0) 0,
    0 var(--qr-shift, 0),
    calc(10px + var(--qr-shift, 0)) 10px,
    10px calc(10px + var(--qr-shift, 0));
  opacity: 0.92;
  clip-path: polygon(0 0, 100% 0, 100% 64%, 74% 64%, 74% 100%, 0 100%);
}

.qr-code.alternate span {
  clip-path: polygon(0 0, 100% 0, 100% 74%, 60% 74%, 60% 100%, 0 100%);
}

.qr-code::before,
.qr-code::after {
  width: 42px;
  height: 42px;
  border: 10px solid #141b3e;
  background: #fff;
}

.qr-code::before {
  top: 22px;
  left: 22px;
  box-shadow: 82px 0 0 -10px #fff, 82px 0 0 0 #141b3e, 0 82px 0 -10px #fff, 0 82px 0 0 #141b3e;
}

.qr-code::after {
  right: 31px;
  bottom: 31px;
  width: 30px;
  height: 30px;
  border-width: 8px;
}

.qr-code::before,
.qr-code::after {
  display: none;
}

.qr-card p {
  width: 250px;
  margin: 16px 0 14px;
  color: #7f8aa0;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.qr-refresh {
  display: none;
  min-width: 132px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(100deg, #7292ff 0%, #6a42f5 100%);
  font-size: 15px;
  cursor: pointer;
}

@media (min-aspect-ratio: 2/1) {
  .login-background {
    object-position: left top;
  }

  .auth-card {
    right: 9vw;
  }
}
