:root {
  --page-blue-1: #023f75;
  --page-blue-2: #0878cf;
  --stage-blue: rgba(0, 77, 139, 0.62);
  --card-blue: rgba(36, 139, 226, 0.56);
  --light-blue: #8ccfff;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --shadow-blue: rgba(0, 30, 70, 0.55);
  --font-ui: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  background: #043f75;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input {
  font: inherit;
  -webkit-text-size-adjust: 100%;
}

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 48%, rgba(30, 156, 245, 0.96) 0 20%, rgba(10, 117, 207, 0.96) 35%, rgba(3, 63, 116, 0.95) 76%),
    linear-gradient(135deg, var(--page-blue-1), var(--page-blue-2));
}

.login-page::before,
.login-page::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.login-page::before {
  background:
    radial-gradient(circle at 50% 45%, rgba(69, 183, 255, 0.42), transparent 34%),
    radial-gradient(circle at 17% 84%, rgba(7, 42, 83, 0.56), transparent 25%),
    radial-gradient(circle at 93% 85%, rgba(6, 55, 105, 0.48), transparent 26%);
}

.login-page::after {
  background:
    linear-gradient(90deg, rgba(0, 15, 43, 0.38), transparent 17%, transparent 83%, rgba(0, 18, 48, 0.28)),
    linear-gradient(180deg, rgba(0, 13, 37, 0.35), transparent 22%, transparent 72%, rgba(0, 15, 40, 0.32));
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.46;
  pointer-events: none;
}

.ambient-left {
  left: -10vw;
  bottom: 8vh;
  width: 38vw;
  height: 30vh;
  background: rgba(7, 50, 98, 0.65);
}

.ambient-right {
  right: -12vw;
  bottom: 1vh;
  width: 42vw;
  height: 28vh;
  background: rgba(13, 111, 184, 0.52);
}

.glass-stage {
  position: relative;
  width: min(1366px, 71.15vw);
  aspect-ratio: 1366 / 768;
  min-width: 760px;
  border-radius: clamp(16px, 1.2vw, 24px);
  background:
    radial-gradient(circle at 57% 50%, rgba(35, 157, 255, 0.58), transparent 34%),
    linear-gradient(135deg, rgba(1, 38, 80, 0.72), var(--stage-blue));
  box-shadow:
    0 38px 80px rgba(0, 24, 72, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -26px 70px rgba(0, 42, 98, 0.26);
  z-index: 1;
}

.stage-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 1366px;
  height: 768px;
  transform: scale(var(--stage-scale, 1));
  transform-origin: top left;
}

.decor {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.decor-ring {
  top: -54px;
  left: 28.5%;
  width: 142px;
  height: 142px;
  object-fit: contain;
  filter: drop-shadow(0 13px 15px rgba(0, 31, 70, 0.38));
}

.decor-ribbon {
  left: -54px;
  bottom: -96px;
  width: 476px;
  height: auto;
  opacity: 0.78;
  filter:
    hue-rotate(-92deg)
    saturate(1.08)
    brightness(1.16)
    drop-shadow(0 22px 24px rgba(0, 19, 54, 0.28));
}

.decor-wave-left {
  top: 151px;
  left: 217px;
  width: 184px;
  height: 96px;
  filter: drop-shadow(0 16px 15px rgba(0, 28, 76, 0.35));
}

.decor-wave-left span,
.decor-wave-right span {
  position: absolute;
  display: block;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d8f0ff 0%, #72bfff 56%, #3f96e5 100%);
  box-shadow:
    inset 8px 9px 15px rgba(255, 255, 255, 0.42),
    inset -8px -10px 17px rgba(0, 69, 135, 0.42);
}

.decor-wave-left span:first-child {
  top: 12px;
  left: 0;
  width: 118px;
  transform: rotate(-45deg);
}

.decor-wave-left span:last-child {
  top: 14px;
  left: 67px;
  width: 98px;
  transform: rotate(-45deg);
}

.decor-wave-left::before,
.decor-wave-left::after {
  position: absolute;
  bottom: 5px;
  content: "";
  display: block;
  height: 29px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d6efff, #72beff 64%, #408ed8);
  box-shadow: inset 6px 8px 12px rgba(255, 255, 255, 0.42);
}

.decor-wave-left::before {
  left: 7px;
  width: 72px;
  transform: rotate(-45deg);
}

.decor-wave-left::after {
  left: 56px;
  width: 64px;
  transform: rotate(-45deg);
}

.decor-swirl {
  left: 306px;
  top: 470px;
  width: 194px;
  height: 135px;
  filter: drop-shadow(0 15px 16px rgba(0, 23, 64, 0.4));
}

.decor-swirl span {
  position: absolute;
  display: block;
  border: 38px solid rgba(128, 202, 255, 0.95);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 999px;
  box-shadow:
    inset 6px 10px 14px rgba(255, 255, 255, 0.34),
    0 11px 20px rgba(0, 33, 85, 0.36);
}

.decor-swirl span:first-child {
  top: -3px;
  left: 8px;
  width: 148px;
  height: 148px;
  transform: rotate(22deg);
}

.decor-swirl span:last-child {
  top: 38px;
  left: 77px;
  width: 112px;
  height: 112px;
  opacity: 0.88;
  transform: rotate(73deg);
}

.decor-loop {
  top: 76px;
  right: 142px;
  width: 455px;
  height: 431px;
  opacity: 0.68;
  filter: blur(0.1px) drop-shadow(0 28px 22px rgba(0, 19, 64, 0.38));
}

.decor-loop::before,
.decor-loop::after,
.decor-loop span {
  position: absolute;
  content: "";
  display: block;
  border-radius: 999px;
}

.decor-loop::before {
  top: 10px;
  left: 88px;
  width: 206px;
  height: 246px;
  border: 49px solid rgba(0, 97, 181, 0.88);
  border-left-color: transparent;
  transform: rotate(27deg);
  box-shadow: inset -16px -12px 18px rgba(0, 36, 92, 0.52);
}

.decor-loop::after {
  top: 142px;
  right: 17px;
  width: 170px;
  height: 185px;
  border: 48px solid rgba(0, 111, 199, 0.88);
  border-left-color: transparent;
  transform: rotate(26deg);
  box-shadow: inset -16px -13px 18px rgba(0, 35, 89, 0.46);
}

.decor-loop span {
  top: 78px;
  left: 5px;
  width: 245px;
  height: 99px;
  background: linear-gradient(135deg, rgba(16, 153, 246, 0.96), rgba(0, 90, 172, 0.86));
  transform: rotate(-27deg);
}

.decor-wave-right {
  right: 260px;
  bottom: 172px;
  width: 178px;
  height: 93px;
  filter: drop-shadow(0 12px 13px rgba(0, 24, 64, 0.35));
}

.decor-wave-right span {
  height: 28px;
  background: linear-gradient(135deg, #d6efff 0%, #79c6ff 62%, #428fd5 100%);
}

.decor-wave-right span:first-child {
  top: 0;
  left: 0;
  width: 92px;
  transform: rotate(22deg);
}

.decor-wave-right span:last-child {
  top: 41px;
  right: 0;
  width: 105px;
  transform: rotate(15deg);
}

.decor-cloud {
  right: -205px;
  bottom: -29px;
  width: 535px;
  height: 158px;
  opacity: 0.86;
  filter: drop-shadow(0 20px 25px rgba(0, 25, 70, 0.22));
}

.decor-cloud span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(126, 194, 255, 0.95), rgba(61, 146, 221, 0.76));
  box-shadow: inset 8px 13px 22px rgba(255, 255, 255, 0.22);
}

.decor-cloud span:first-child {
  left: 0;
  bottom: 28px;
  width: 148px;
  height: 102px;
  transform: rotate(32deg);
}

.decor-cloud span:nth-child(2) {
  left: 105px;
  bottom: 25px;
  width: 270px;
  height: 86px;
}

.decor-cloud span:last-child {
  right: 0;
  bottom: 39px;
  width: 185px;
  height: 81px;
  transform: rotate(-16deg);
}

.login-card {
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 3;
  width: 580px;
  height: 720px;
  margin: 0;
  padding: 60px 104px 58px;
  color: var(--ink);
  text-align: left;
  background:
    radial-gradient(circle at 85% 9%, rgba(115, 191, 255, 0.72), transparent 26%),
    linear-gradient(155deg, rgba(54, 152, 235, 0.62), var(--card-blue) 55%, rgba(42, 143, 226, 0.66));
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 28px;
  box-shadow:
    0 30px 55px rgba(0, 43, 109, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -22px 55px rgba(28, 124, 213, 0.26);
  backdrop-filter: blur(17px);
  transform: translateX(-50%);
}

.login-card::before,
.login-card::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.login-card::before {
  top: 35px;
  right: 75px;
  width: 218px;
  height: 39px;
  background: rgba(0, 49, 111, 0.26);
  filter: blur(14px);
  transform: rotate(-36deg);
}

.login-card::after {
  left: -95px;
  bottom: 25px;
  width: 275px;
  height: 68px;
  background: rgba(0, 62, 128, 0.21);
  filter: blur(15px);
  transform: rotate(46deg);
}

.logo {
  margin-bottom: 48px;
  text-align: center;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 32px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

label {
  display: block;
  margin: 0 0 9px;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

input {
  display: block;
  width: 100%;
  height: 48px;
  min-height: 44px;
  padding: 0 21px;
  color: #1b477b;
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  border-radius: 7px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 2px 8px rgba(0, 42, 105, 0.12);
  font-size: 13px;
}

input::placeholder {
  color: #c7d0dc;
}

input:focus {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.76),
    0 0 0 5px rgba(58, 170, 255, 0.22),
    0 2px 8px rgba(0, 42, 105, 0.12);
}

#email {
  margin-bottom: 28px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 16px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  color: #c7d0dc;
  background: transparent;
  border: 0;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle span,
.password-toggle span::after {
  display: block;
  border: 1.4px solid currentColor;
  content: "";
}

.password-toggle span {
  position: relative;
  width: 16px;
  height: 10px;
  border-radius: 50% / 60%;
}

.password-toggle span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.password-toggle[aria-pressed="true"] span::before {
  position: absolute;
  top: 50%;
  left: -3px;
  width: 21px;
  height: 1.5px;
  content: "";
  background: currentColor;
  transform: rotate(-35deg);
}

.form-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: #ffe0e0;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.form-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.form-message.success {
  color: #dcfce7;
}

.forgot-link {
  display: inline-block;
  margin: 10px 0 25px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
}

.forgot-link:hover,
.register-copy a:hover {
  text-decoration: underline;
}

.login-card.mode-register .forgot-link {
  visibility: hidden;
}

.signin-button {
  display: block;
  width: 100%;
  height: 52px;
  color: var(--ink);
  background: #01497e;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 12px 21px rgba(0, 40, 92, 0.22);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.signin-button:hover {
  background: #025a9b;
  box-shadow: 0 14px 25px rgba(0, 40, 92, 0.28);
  transform: translateY(-1px);
}

.signin-button:active {
  transform: translateY(0);
}

.signin-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.divider {
  margin: 25px 0 20px;
  color: var(--ink);
  text-align: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
}

.social-row {
  display: flex;
  justify-content: center;
  min-height: 45px;
}

.google-signin-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  transition: opacity 160ms ease;
}

.google-signin-button.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.google-signin-button iframe {
  margin: 0 !important;
}

.register-copy {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}

.register-copy a {
  color: var(--ink);
  text-decoration: none;
}

.login-card.is-signed-in {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card.is-signed-in label,
.login-card.is-signed-in input,
.login-card.is-signed-in .password-field,
.login-card.is-signed-in .forgot-link,
.login-card.is-signed-in .signin-button,
.login-card.is-signed-in .divider,
.login-card.is-signed-in .social-row,
.login-card.is-signed-in .register-copy {
  display: none !important;
}

.login-card.is-signed-in .logo {
  margin-bottom: 36px;
}

.login-card.is-signed-in h1 {
  margin-bottom: 24px;
  text-align: center;
}

.signed-in-panel {
  display: grid;
  gap: 18px;
  margin-top: 0;
}

.signed-in-account {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.signed-in-account span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
}

.signed-in-email {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signed-in-actions {
  display: grid;
  gap: 12px;
}

.signed-in-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.signed-in-button:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.signed-in-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.signed-in-button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #432bff 0%, #7b5cff 100%);
  box-shadow: 0 14px 28px rgba(67, 43, 255, 0.24);
  color: white;
}

.signed-in-button-quiet {
  border-color: rgba(1, 73, 126, 0.5);
  background: rgba(2, 73, 126, 0.42);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

@media (max-width: 1180px), ((hover: none) and (pointer: coarse) and (max-width: 1366px)) {
  .login-page {
    min-height: 100svh;
    padding: 32px;
  }

  .glass-stage {
    width: 100%;
    max-width: 1000px;
    min-width: 0;
    min-height: min(calc(100svh - 64px), 820px);
    aspect-ratio: auto;
    overflow: hidden;
  }

  .stage-content {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transform: none;
  }

  .decor-ring,
  .decor-ribbon,
  .decor-wave-left,
  .decor-swirl,
  .decor-loop,
  .decor-wave-right,
  .decor-cloud {
    display: none;
  }

  .login-card {
    top: 50%;
    left: 50%;
    width: clamp(480px, 58vw, 640px);
    height: auto;
    min-height: 0;
    padding: 52px 72px 50px;
    border-radius: 24px;
    transform: translate(-50%, -50%);
  }

  .logo {
    margin-bottom: 40px;
    font-size: 30px;
  }

  h1 {
    margin-bottom: 28px;
    font-size: 30px;
  }

  label {
    font-size: 13px;
  }

  input {
    height: 52px;
    min-height: 44px;
    font-size: 16px;
  }

  .signin-button {
    height: 54px;
    font-size: 16px;
  }

  .social-row {
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  .login-page {
    min-height: 100svh;
    padding: 0;
  }

  .glass-stage {
    width: 100vw;
    min-width: 0;
    aspect-ratio: auto;
    min-height: 100svh;
    border-radius: 0;
    overflow: hidden;
  }

  .stage-content {
    position: relative;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
  }

  .decor-ring,
  .decor-ribbon,
  .decor-wave-left,
  .decor-swirl,
  .decor-loop,
  .decor-wave-right,
  .decor-cloud {
    display: none;
  }

  .login-card {
    top: 50%;
    left: 50%;
    width: min(360px, calc(100vw - 28px));
    height: auto;
    min-height: 528px;
    padding: 35px 42px;
    border-radius: 20px;
    transform: translate(-50%, -50%);
  }

  .logo {
    margin-bottom: 34px;
    font-size: 22px;
  }

  h1 {
    margin-bottom: 21px;
    font-size: 23px;
  }

  label {
    font-size: 12px;
  }

  input {
    height: 46px;
    min-height: 44px;
    font-size: 16px;
  }
}
