:root {
  --navy-950: #041629;
  --navy-900: #071d36;
  --navy-800: #0a2c4d;
  --blue-500: #409eff;
  --blue-400: #65b7ff;
  --cyan-300: #64dcff;
  --gold-400: #f1c46e;
  --ink-900: #18283d;
  --ink-700: #435269;
  --ink-500: #728096;
  --line: #dfe6ee;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --danger: #c93535;
  --danger-soft: #fff2f2;
  --success: #177a51;
  --success-soft: #edf9f3;
  --shadow: 0 26px 70px rgba(17, 48, 82, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--navy-950);
}

body {
  margin: 0;
  color: var(--ink-900);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(460px, 0.82fr);
  min-height: 100svh;
}

.brand-panel {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(32px, 4vw, 62px);
  color: #fff;
  background:
    radial-gradient(circle at 76% 16%, rgba(64, 158, 255, 0.25), transparent 25%),
    radial-gradient(circle at 8% 82%, rgba(44, 116, 162, 0.21), transparent 34%),
    linear-gradient(145deg, #061a30 0%, #08233f 52%, #041528 100%);
}

.brand-panel::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 74px 74px;
  content: "";
  mask-image: linear-gradient(to bottom right, rgba(0, 0, 0, 0.8), transparent 80%);
  pointer-events: none;
}

.brand-panel::after {
  position: absolute;
  right: -15%;
  bottom: -28%;
  width: min(62vw, 860px);
  aspect-ratio: 1;
  border: 1px solid rgba(105, 208, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(64, 158, 255, 0.025),
    0 0 0 140px rgba(64, 158, 255, 0.018);
  content: "";
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}

.orb-one {
  top: 22%;
  right: 8%;
  width: 8px;
  height: 8px;
  background: var(--cyan-300);
  box-shadow:
    0 0 22px 6px rgba(100, 220, 255, 0.35),
    50px 82px 0 -2px var(--gold-400);
}

.orb-two {
  bottom: 18%;
  left: 10%;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(100, 220, 255, 0.16);
  background: rgba(64, 158, 255, 0.035);
}

.grid-glow {
  position: absolute;
  top: 42%;
  left: 0;
  width: 48%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100, 220, 255, 0.3), transparent);
  transform: rotate(-17deg);
  transform-origin: left center;
}

.brand-header,
.brand-content,
.brand-footer {
  position: relative;
  z-index: 1;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.2));
}

.brand-wordmark {
  display: grid;
  gap: 2px;
}

.brand-wordmark strong {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.11em;
}

.brand-wordmark span {
  color: rgba(220, 239, 255, 0.55);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.brand-content {
  width: min(760px, 92%);
  margin: auto 0;
  padding: 64px 0 38px;
  animation: rise-in 660ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 24px;
  color: #9ddfff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: var(--gold-400);
}

.brand-content h1 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(42px, 4.5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.brand-content h1 em {
  color: transparent;
  font-style: normal;
  background: linear-gradient(92deg, #79dcff 8%, #b8ecff 54%, #f1c46e 110%);
  -webkit-background-clip: text;
  background-clip: text;
}

.brand-description {
  max-width: 520px;
  margin: 24px 0 0;
  color: rgba(226, 240, 251, 0.64);
  font-size: 15px;
  letter-spacing: 0.02em;
  line-height: 1.85;
}

.capability-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 52px;
  border-top: 1px solid rgba(188, 222, 245, 0.13);
  border-bottom: 1px solid rgba(188, 222, 245, 0.13);
}

.capability-item {
  display: flex;
  min-height: 112px;
  gap: 14px;
  padding: 24px 20px 24px 0;
}

.capability-item + .capability-item {
  padding-left: 22px;
  border-left: 1px solid rgba(188, 222, 245, 0.1);
}

.capability-number {
  padding-top: 3px;
  color: var(--gold-400);
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
}

.capability-item strong {
  display: block;
  margin-bottom: 9px;
  color: #f2f8fe;
  font-size: 14px;
  font-weight: 600;
}

.capability-item p {
  margin: 0;
  color: rgba(211, 231, 247, 0.5);
  font-size: 11px;
  line-height: 1.65;
}

.brand-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(199, 226, 245, 0.37);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.brand-footer-line {
  width: 34px;
  height: 1px;
  background: rgba(199, 226, 245, 0.18);
}

.form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: clamp(28px, 4.2vw, 64px);
  background:
    radial-gradient(circle at 85% 9%, rgba(64, 158, 255, 0.1), transparent 20%),
    linear-gradient(155deg, #f7f9fc 0%, #eef3f8 100%);
}

.form-panel::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(23, 65, 104, 0.08) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  content: "";
  mask-image: linear-gradient(130deg, transparent 20%, black 100%);
  pointer-events: none;
}

.form-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 448px);
  padding: clamp(32px, 4vw, 52px);
  border: 1px solid rgba(215, 225, 236, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: card-in 720ms 80ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mobile-brand {
  display: none;
}

.form-kicker {
  margin: 0 0 12px;
  color: var(--blue-500);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.22em;
}

.form-heading h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.form-heading > p:last-child {
  margin: 11px 0 0;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.65;
}

.form-status {
  margin-top: 24px;
  padding: 11px 13px;
  border: 1px solid #f1caca;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
  line-height: 1.55;
}

.form-status.is-success {
  border-color: #c7ead9;
  color: var(--success);
  background: var(--success-soft);
}

#login-form {
  margin-top: 30px;
}

.form-field + .form-field {
  margin-top: 20px;
}

.form-field label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.label-row span {
  color: #9aa5b5;
  font-size: 10px;
}

.input-shell {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--blue-500);
  background: #fcfdff;
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.11);
}

.input-shell.is-invalid {
  border-color: #de8b8b;
  box-shadow: 0 0 0 3px rgba(201, 53, 53, 0.07);
}

.input-shell > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-right: 11px;
  stroke: #8491a4;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  outline: 0;
  color: var(--ink-900);
  background: transparent;
  font-size: 14px;
}

.input-shell input::placeholder {
  color: #aab4c2;
}

.password-toggle {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  margin-right: -5px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #7e8ca0;
  background: transparent;
}

.password-toggle:hover {
  color: var(--blue-500);
  background: #f0f7ff;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(64, 158, 255, 0.55);
  outline-offset: 1px;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.field-error {
  min-height: 16px;
  margin: 5px 2px 0;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.5;
}

.login-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(100deg, #348ee9, #4facff);
  box-shadow: 0 12px 26px rgba(64, 158, 255, 0.24);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
}

.login-button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.17), transparent 80%);
  content: "";
  transform: translateX(-110%);
  transition: transform 450ms ease;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(64, 158, 255, 0.3);
  filter: saturate(1.08);
}

.login-button:hover:not(:disabled)::before {
  transform: translateX(110%);
}

.login-button:focus-visible,
.logout-button:focus-visible {
  outline: 2px solid rgba(64, 158, 255, 0.68);
  outline-offset: 3px;
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-label,
.button-arrow {
  position: relative;
  z-index: 1;
}

.button-arrow {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.login-button.is-loading .button-label,
.login-button.is-loading .button-arrow {
  display: none;
}

.login-button.is-loading .button-spinner {
  display: block;
}

.session-card {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid #dce9e4;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(160deg, #fbfffd, #f2faf6);
}

.session-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 50%;
  color: var(--success);
  background: #e5f6ed;
}

.session-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-card > p:first-of-type {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.session-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-900);
  font-size: 19px;
}

.session-card > span {
  display: block;
  margin-top: 5px;
  color: #8b96a7;
  font-size: 11px;
}

.session-note {
  margin: 18px 0 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.6;
}

.logout-button {
  margin-top: 18px;
  padding: 9px 18px;
  border: 1px solid #cad8e4;
  border-radius: 8px;
  color: var(--ink-700);
  background: #fff;
  font-size: 12px;
}

.logout-button:hover {
  border-color: var(--blue-500);
  color: var(--blue-500);
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #edf0f4;
}

.security-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  stroke: #8a99aa;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.security-note p {
  margin: 0;
  color: #8b97a7;
  font-size: 10px;
  line-height: 1.65;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  color: #a3acb8;
  font-size: 9px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .login-page {
    grid-template-columns: minmax(0, 1fr) minmax(430px, 0.9fr);
  }

  .brand-content {
    width: 100%;
  }

  .capability-list {
    grid-template-columns: 1fr;
  }

  .capability-item {
    min-height: auto;
    padding: 16px 0;
  }

  .capability-item + .capability-item {
    padding-left: 0;
    border-top: 1px solid rgba(188, 222, 245, 0.1);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
    padding: 24px 24px 34px;
  }

  .brand-panel::after {
    right: -35%;
    bottom: -120%;
  }

  .brand-content {
    padding: 48px 0 8px;
  }

  .brand-content h1 {
    font-size: clamp(34px, 9vw, 48px);
  }

  .brand-description {
    margin-top: 16px;
  }

  .capability-list,
  .brand-footer {
    display: none;
  }

  .form-panel {
    min-height: auto;
    padding: 22px 18px 36px;
  }
}

@media (max-width: 520px) {
  .brand-header {
    gap: 11px;
  }

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

  .brand-wordmark strong {
    font-size: 18px;
  }

  .brand-content {
    padding-top: 38px;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 8px;
  }

  .brand-content h1 {
    font-size: 36px;
  }

  .brand-description {
    font-size: 13px;
    line-height: 1.75;
  }

  .form-shell {
    padding: 28px 22px;
    border-radius: 18px;
  }

  .form-heading h2 {
    font-size: 28px;
  }

  .form-footer {
    flex-direction: column;
    gap: 4px;
  }
}

@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;
  }
}
