@font-face {
  font-family: "Manrope H3";
  src: url("/assets/manrope-latin-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #071019;
  --ink-soft: #3f4b57;
  --ink-faint: #687580;
  --line: rgba(255, 255, 255, 0.76);
  --line-dark: rgba(20, 31, 42, 0.12);
  --glass: rgba(245, 248, 252, 0.73);
  --accent: #0a65e8;
  --success: #0b7f5d;
  --danger: #a91d15;
  --radius-panel: 28px;
  --radius-control: 14px;
  --shadow: 0 30px 90px rgba(7, 16, 25, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #aab0b8 url("/assets/liquid-metal-background.png") center / cover fixed no-repeat;
}

body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Manrope H3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: rgba(235, 239, 244, 0.12);
  box-shadow: inset 0 0 180px rgba(255, 255, 255, 0.22);
}

#liquid-metal-root,
.liquid-metal-canvas,
.liquid-metal-mount,
.liquid-metal-mount > div,
.liquid-metal-mount canvas {
  width: 100%;
  height: 100%;
}

#liquid-metal-root {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #aeb3b9 url("/assets/liquid-metal-background.png") center / cover no-repeat;
}

.liquid-metal-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.liquid-metal-mount {
  position: absolute !important;
  inset: 0;
  transform: scale(1.035);
}

.liquid-metal-mount canvas {
  display: block;
  object-fit: cover;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(10, 101, 232, 0.48);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.login-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 28px;
}

.glass-surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  backdrop-filter: blur(32px) saturate(150%);
}

.login-shell {
  display: grid;
  width: min(900px, 100%);
  min-height: 520px;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.08fr);
  overflow: hidden;
  animation: shell-arrive 520ms cubic-bezier(0.22, 0.74, 0.24, 1) both;
}

@keyframes shell-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-pane,
.auth-pane {
  min-width: 0;
  padding: clamp(32px, 5vw, 56px);
}

.brand-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-dark);
  background: linear-gradient(145deg, rgba(252, 253, 255, 0.36), rgba(199, 207, 218, 0.2));
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  color: #f5f7fa;
  background: rgba(7, 16, 25, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 9px 22px rgba(7, 16, 25, 0.18);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-name {
  min-width: 0;
}

.brand-name strong,
.brand-name small {
  display: block;
}

.brand-name strong {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.brand-name small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-left: auto;
  padding: 0 9px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.56);
  font-size: 9px;
  font-weight: 780;
  white-space: nowrap;
}

.welcome-copy {
  margin: auto 0;
  padding: 48px 0;
}

.welcome-label {
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.07em;
}

.welcome-copy h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1;
}

.welcome-copy > p:last-child {
  max-width: 310px;
  margin: 19px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.7;
}

.service-note {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 660;
  line-height: 1.5;
}

.auth-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(248, 250, 253, 0.25);
}

.service-state {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 720;
}

.service-state i {
  display: block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8b949d;
  box-shadow: 0 0 0 4px rgba(104, 117, 128, 0.12);
}

.service-state[data-state="checking"] i {
  animation: status-pulse 1.35s ease-in-out infinite;
}

.service-state[data-state="ready"] i {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(11, 127, 93, 0.12);
}

.service-state[data-state="error"] i,
.service-state[data-state="locked"] i {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(169, 29, 21, 0.1);
}

@keyframes status-pulse {
  50% {
    opacity: 0.48;
    transform: scale(0.74);
  }
}

.field-block {
  display: grid;
  gap: 9px;
}

.field-block > label {
  font-size: 13px;
  font-weight: 770;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgba(7, 16, 25, 0.12);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 5px rgba(7, 16, 25, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.password-control:focus-within {
  border-color: rgba(10, 101, 232, 0.72);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 0 0 4px rgba(10, 101, 232, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.password-control:has(input[aria-invalid="true"]) {
  border-color: rgba(169, 29, 21, 0.58);
  box-shadow: 0 0 0 4px rgba(169, 29, 21, 0.08);
}

#password {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 0 6px 0 16px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
  font-weight: 590;
  letter-spacing: 0.02em;
}

#password:disabled {
  cursor: wait;
  opacity: 0.62;
}

.reveal-button {
  min-width: 60px;
  min-height: 38px;
  margin-right: 7px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 760;
}

.reveal-button:hover:not(:disabled),
.retry-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.82);
}

.field-helper,
.inline-error,
.access-note,
.locked-panel p {
  line-height: 1.55;
}

.field-helper {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.inline-error {
  margin: 1px 0 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 650;
}

.login-button {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: #f5f7fa;
  background: rgba(7, 16, 25, 0.94);
  box-shadow: 0 13px 30px rgba(7, 16, 25, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 790;
  white-space: nowrap;
}

.login-button:hover:not(:disabled) {
  background: #071019;
}

.login-button:disabled,
.reveal-button:disabled,
.retry-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.auth-checking .login-button {
  background-image: linear-gradient(100deg, rgba(7, 16, 25, 0.9) 0%, rgba(62, 76, 90, 0.94) 48%, rgba(7, 16, 25, 0.9) 100%);
  background-size: 220% 100%;
  animation: checking-sweep 1.45s ease-in-out infinite;
}

@keyframes checking-sweep {
  50% {
    background-position: 100% 0;
  }
}

.pressable {
  transition: transform 120ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 180ms ease;
}

.pressable:active:not(:disabled) {
  transform: scale(0.975);
}

.locked-panel {
  padding: 18px;
  border: 1px solid rgba(169, 29, 21, 0.18);
  border-radius: var(--radius-control);
  background: rgba(255, 247, 246, 0.54);
}

.locked-panel strong {
  font-size: 13px;
}

.locked-panel p {
  margin: 7px 0 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

.retry-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 760;
}

.access-note {
  margin: 24px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 660;
  text-align: center;
}

@media (max-width: 760px) {
  .login-page {
    align-items: start;
    padding: 16px;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .brand-pane,
  .auth-pane {
    padding: 28px;
  }

  .brand-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .welcome-copy {
    margin: 0;
    padding: 44px 0 16px;
  }

  .welcome-copy h1 {
    font-size: clamp(38px, 12vw, 48px);
  }

  .welcome-copy > p:last-child {
    max-width: 420px;
  }

  .service-note {
    display: none;
  }

  .service-state {
    margin-bottom: 20px;
  }
}

@media (max-width: 430px) {
  .login-page {
    padding: 10px;
  }

  .brand-pane,
  .auth-pane {
    padding: 24px 20px;
  }

  .brand-lockup {
    gap: 9px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-name small {
    max-width: 130px;
  }

  .family-badge {
    min-height: 26px;
    padding-inline: 8px;
  }

  .welcome-copy {
    padding-top: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .login-shell {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass-surface {
    background: rgba(242, 245, 249, 0.98);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .brand-pane,
  .auth-pane {
    background: rgba(242, 245, 249, 0.98);
  }
}

@media (forced-colors: active) {
  .glass-surface,
  .password-control,
  .login-button,
  .reveal-button,
  .retry-button,
  .locked-panel {
    border: 1px solid CanvasText;
  }

  .service-state i {
    background: CanvasText;
    box-shadow: none;
  }
}
