/* Login and enterprise WeChat callback pages */
.signin-page {
  --signin-ink: #1c2039;
  --signin-muted: #70718a;
  --signin-accent: #6351e5;
  --signin-accent-hover: #5140c8;
  --signin-line: #e5e2f1;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  margin: 0;
  display: grid;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(ellipse at 13% 4%, #e5e1fa 0%, transparent 54%),
    radial-gradient(ellipse at 92% 96%, #ece9f7 0%, transparent 52%),
    #f5f4fa;
  color: var(--signin-ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.signin-page.hidden { display: none; }

.signin-surface,
.signin-error-card {
  box-sizing: border-box;
  width: min(100%, 1024px);
  margin: auto;
  border: 1px solid #e0dced;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 64px #29214b1c, 0 2px 6px #29214b0b;
}

.signin-surface {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1fr);
  min-height: 510px;
}

.signin-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  border-radius: 23px 0 0 23px;
  background:
    radial-gradient(circle at 12% 0, rgba(100, 91, 225, .24), transparent 38%),
    radial-gradient(ellipse at 52% 48%, rgba(108, 88, 206, .23), transparent 66%),
    linear-gradient(180deg, #12192d, #0f1729 72%);
}

.signin-visual::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(#b5a8f214 1px, transparent 1px),
    linear-gradient(90deg, #b5a8f214 1px, transparent 1px);
  background-position: center;
  background-size: 35px 35px;
  mask-image: radial-gradient(ellipse, #000, #0009 54%, transparent 88%);
  content: "";
}

.signin-visual::after {
  position: absolute;
  inset: 22px;
  border: 1px solid #b4a6ed24;
  border-radius: 14px;
  pointer-events: none;
  content: "";
}

.signin-art {
  position: relative;
  display: grid;
  width: min(82%, 360px);
  aspect-ratio: 1;
  place-items: center;
  perspective: 650px;
}

.signin-orbit {
  position: absolute;
  inset: 3%;
  border: 1px solid #b1a3e838;
  border-radius: 50%;
  box-shadow: inset 0 0 45px #9985eb14;
}

.signin-orbit::before,
.signin-orbit::after {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d3c7ff;
  box-shadow: 0 0 0 5px #aa91ec22, 0 0 20px #b29aeda0;
  content: "";
}

.signin-orbit::before { top: 19%; right: 10%; }
.signin-orbit::after { bottom: 14%; left: 13%; }

.signin-plate {
  position: absolute;
  display: grid;
  width: 59%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #b29aec80;
  border-radius: 18px;
  background: linear-gradient(145deg, #8b70ce47, #201c3dcc);
  box-shadow: 3px 4px 0 #19172e, 4px 6px 0 #aa8de04c;
  transform: translateY(var(--plate-offset)) rotateX(54deg) rotateZ(-45deg);
}

.signin-plate-bottom { --plate-offset: 21%; }
.signin-plate-middle { --plate-offset: 3%; }
.signin-plate-top {
  --plate-offset: -15%;
  border-color: #c4b3f5;
  background: linear-gradient(140deg, #b6a2f3c7 0%, #8062bce5 36%, #332451fa 71%);
  box-shadow: 4px 5px 0 #3b2e62, 6px 7px 0 #c0a8f47d, 0 0 42px #9675e74a;
}

.signin-plate-top::before {
  position: absolute;
  inset: 13%;
  border: 1px solid #d4c4fd8a;
  border-radius: 9px;
  content: "";
}

.signin-plate-top::after {
  width: 24%;
  aspect-ratio: 1;
  border: 1px solid #eee7ff;
  border-radius: 5px;
  background: #e4d7ffd1;
  box-shadow: 0 0 24px #cfb9fc97, 0 0 0 12px #cfb9fc38;
  content: "";
}

.signin-panel {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: clamp(34px, 5.4vw, 70px);
}

.signin-heading { margin-bottom: 28px; }

.signin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 27px;
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -.02em;
}

.signin-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(215, 208, 255, .30);
  border-radius: 10px;
  background: radial-gradient(circle at 15% 0, #a39aff, transparent 65%), linear-gradient(145deg, #8170f5, #5543d1);
  box-shadow: 0 5px 14px rgba(89, 67, 187, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: white;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -1px;
}

.signin-heading h1,
.signin-error-card h1 {
  margin: 0;
  color: var(--signin-ink);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.2;
}

.signin-heading p,
.signin-error-card p {
  margin: 10px 0 0;
  color: var(--signin-muted);
  font-size: 14px;
}

.signin-primary,
.signin-submit {
  box-sizing: border-box;
  width: 100%;
  min-height: 49px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.signin-primary {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  background: var(--signin-accent);
  box-shadow: 0 8px 18px #5741be25;
  color: #fff;
  text-align: left;
}

.signin-primary:hover { background: var(--signin-accent-hover); }
.signin-arrow { justify-self: end; font-size: 19px; }

.signin-wecom-mark {
  position: relative;
  width: 24px;
  height: 24px;
}

.signin-wecom-mark::before,
.signin-wecom-mark::after {
  position: absolute;
  border: 1.5px solid currentColor;
  border-radius: 5px 5px 5px 1px;
  content: "";
}

.signin-wecom-mark::before {
  top: 4px;
  left: 1px;
  width: 14px;
  height: 10px;
  opacity: .78;
}

.signin-wecom-mark::after {
  right: 1px;
  bottom: 3px;
  width: 14px;
  height: 10px;
  background: var(--signin-accent);
}

.signin-primary:hover .signin-wecom-mark::after { background: var(--signin-accent-hover); }

.signin-wecom-mark span {
  position: absolute;
  bottom: 8px;
  left: 11px;
  z-index: 1;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 4px 0 currentColor;
}

#loginView .login-message {
  box-sizing: border-box;
  min-height: 42px;
  margin: 12px 0 0;
  font-size: 13px;
}

.signin-emergency {
  margin-top: 21px;
  border-top: 1px solid var(--signin-line);
  border-bottom: 1px solid var(--signin-line);
}

.signin-emergency summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  color: #403c59;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.signin-emergency summary::-webkit-details-marker { display: none; }
.signin-emergency summary::after {
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  content: "";
}
.signin-emergency[open] summary::after { transform: translateY(2px) rotate(225deg); }
.signin-emergency summary:hover { color: var(--signin-accent); }

.signin-fields { display: grid; gap: 12px; padding: 2px 0 16px; }
.signin-field { display: grid; gap: 5px; min-width: 0; }
.signin-field label { color: #4b4564; font-size: 13px; font-weight: 650; }

#loginView .signin-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #ded9ea;
  border-radius: 9px;
  background: #faf9fd;
  color: var(--signin-ink);
  font: inherit;
}

#loginView .signin-field input::placeholder { color: #7d7a91; }
#loginView .signin-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px #f2effb inset;
  -webkit-text-fill-color: var(--signin-ink);
}
#loginView .signin-field input[aria-invalid="true"] { border-color: #c85566; background: #fff9fa; }
.signin-password { position: relative; }
#loginView .signin-password input { padding-right: 61px; }
.signin-password button {
  position: absolute;
  inset: 2px 3px 2px auto;
  min-width: 46px;
  border: 0;
  border-radius: 7px;
  background: #faf9fd;
  color: var(--signin-accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.signin-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  color: #6e687e;
  font-size: 13px;
}

.signin-options label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.signin-options input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--signin-accent); }
.signin-submit { min-height: 44px; border-color: #d9d0f4; background: #f3efff; color: #4936a5; }
.signin-submit:hover { background: #e9e2fb; }
.signin-submit:disabled { cursor: wait; opacity: .72; }
.signin-footer { margin-top: 10px; text-align: center; }

.signin-text {
  min-height: 34px;
  padding: 4px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--signin-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-underline-offset: 3px;
}

.signin-text:hover, .signin-password button:hover { text-decoration: underline; }
.signin-page :is(button, a, input, summary):focus-visible {
  outline: 2px solid var(--signin-accent);
  outline-offset: 2px;
}

.signin-error-card { max-width: 508px; padding: clamp(22px, 6vw, 42px); }
.signin-error-card h1 { margin-top: 25px; font-size: clamp(23px, 4vw, 29px); }
.signin-error-card a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-top: 22px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--signin-accent);
  color: #fff;
  font-weight: 680;
  text-decoration: none;
}
.signin-error-card a:hover { background: var(--signin-accent-hover); }

#registerDialog { max-height: calc(100dvh - 28px); }
#registerDialog .register-head button { flex-shrink: 0; }

@media (max-height: 740px) and (min-width: 761px) {
  .signin-surface { min-height: 430px; }
  .signin-panel { padding-block: 29px; }
  .signin-heading { margin-bottom: 21px; }
  .signin-brand { margin-bottom: 17px; }
}

@media (max-height: 660px) and (min-width: 761px) {
  .signin-page { padding: 15px clamp(26px, 4vw, 48px); }
  .signin-panel { padding-block: 18px; }
  .signin-heading { margin-bottom: 16px; }
  .signin-brand { margin-bottom: 14px; }
  .signin-heading h1 { font-size: 32px; }
  .signin-primary { min-height: 44px; }
  .signin-emergency { margin-top: 12px; }
  .signin-emergency summary { min-height: 40px; }
  .signin-fields { gap: 9px; padding-bottom: 12px; }
  .signin-footer { margin-top: 6px; }
}

@media (max-width: 760px) {
  .signin-page { padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .signin-surface { max-width: 480px; min-height: 0; grid-template-columns: minmax(0, 1fr); border-radius: 19px; }
  .signin-visual { height: 126px; border-radius: 18px 18px 0 0; }
  .signin-visual::after { inset: 9px; border-radius: 11px; }
  .signin-art { width: 126px; }
  .signin-panel { padding: 27px clamp(19px, 6vw, 36px); }
  .signin-heading { margin-bottom: 22px; }
  .signin-brand { margin-bottom: 18px; }
  .signin-primary { padding-inline: 12px; }
}

@media (max-width: 760px) and (max-height: 650px) {
  .signin-visual { height: 76px; }
  .signin-art { width: 76px; }
  .signin-panel { padding-block: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .signin-primary, .signin-submit { transition: none; }
}
