.portal-login {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.login-header { flex: 0 0 auto; }

.login-main {
  width: min(100% - 40px, 460px);
  flex: 1 0 auto;
  padding: 64px 0 46px;
  display: grid;
  place-items: center;
}

.login-panel {
  position: relative;
  width: 100%;
  padding: 38px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.025)), rgba(24, 12, 42, .72);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 3px;
  box-shadow: 0 30px 90px rgba(0,0,0,.36), 0 0 56px rgba(133,74,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: login-panel-in .9s cubic-bezier(.16,.72,.2,1) .35s both;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8c78ff, #ed71d1, transparent);
  opacity: .78;
}

.login-panel__mark {
  width: 54px;
  height: 54px;
  margin-bottom: 30px;
  display: grid;
  place-items: center;
  color: #a976ff;
  border: 1px solid rgba(169,118,255,.4);
  background: rgba(169,118,255,.07);
  transform: rotate(45deg);
}

.login-panel__mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-45deg);
}

.login-panel__heading > span {
  display: block;
  margin-bottom: 9px;
  color: #a976ff;
  font: 700 10px/1.2 Arial, sans-serif;
  letter-spacing: .24em;
}

.login-panel h1 {
  margin: 0;
  color: rgba(251,248,255,.96);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .1em;
}

.login-error {
  margin-top: 24px;
  padding: 12px 14px;
  color: #ffd7ed;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(237,113,209,.1);
  border: 1px solid rgba(237,113,209,.32);
}

.login-form {
  margin-top: 30px;
  display: grid;
  gap: 11px;
}

.login-form label {
  margin-top: 7px;
  color: rgba(246,241,255,.8);
  font-size: 13px;
  letter-spacing: .12em;
}

.login-field {
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(7,3,15,.36);
  border: 1px solid rgba(255,255,255,.14);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.login-field:focus-within {
  border-color: rgba(169,118,255,.78);
  background: rgba(15,7,28,.56);
  box-shadow: 0 0 0 3px rgba(169,118,255,.12);
}

.login-field > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: rgba(203,183,240,.72);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  color: #fff;
  color-scheme: dark;
  font: 16px/1.2 "Microsoft JhengHei", Arial, sans-serif;
  background: transparent;
  border: 0;
  outline: 0;
}

/* Keep browser/password-manager autofill consistent with the dark form. */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #170d2c inset;
  box-shadow: 0 0 0 1000px #170d2c inset;
  transition: background-color 9999s ease-out 0s;
}

.login-field input:autofill {
  color: #fff;
  caret-color: #fff;
  background: #170d2c;
  box-shadow: 0 0 0 1000px #170d2c inset;
}

.password-toggle {
  flex: 0 0 auto;
  padding: 8px 2px 8px 9px;
  color: rgba(230,217,250,.72);
  font: 12px/1 Arial, sans-serif;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.password-toggle:hover { color: #fff; }
.password-toggle:focus-visible { outline: 2px solid #a976ff; outline-offset: 3px; }

.login-submit {
  min-height: 52px;
  margin-top: 17px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font: 500 15px/1 "Microsoft JhengHei", Arial, sans-serif;
  letter-spacing: .16em;
  background: #875bdc;
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  transition: filter .2s, box-shadow .2s, transform .2s;
}

.login-submit svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-submit:hover {
  filter: brightness(1.12);
  box-shadow: 0 12px 34px rgba(141,73,223,.3);
}

.login-submit:active { transform: translateY(1px); }
.login-submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.login-footer { flex: 0 0 auto; }

@keyframes login-panel-in {
  from { opacity: 0; transform: translateY(28px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 620px) {
  .login-main { width: min(100% - 36px, 460px); padding: 40px 0 30px; }
  .login-panel { padding: 30px 24px; }
  .login-panel__mark { margin-bottom: 26px; }
  .login-panel h1 { font-size: 27px; }
  .login-footer { padding-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-panel { animation: none; }
  .login-submit { transition: none; }
}
