:root {
  --navy-950: #07182d;
  --navy-900: #0a2447;
  --navy-800: #123963;
  --ink-900: #0b2748;
  --ink-700: #334a66;
  --muted-600: #61758c;
  --muted-500: #536b84;
  --cobalt-700: #1647db;
  --cobalt-600: #2059f0;
  --cobalt-500: #2d68ff;
  --cyan-400: #6eddeb;
  --cyan-300: #8be6f1;
  --line: #d7e3f0;
  --line-strong: #c6d8ea;
  --paper: #ffffff;
  --input-bg: #f9fcff;
  --focus: #1f57e8;
  --danger: #9d2c1f;
  --danger-bg: #fff5f3;
  --danger-line: #f1cdc7;
  --radius-card: 28px;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f2f7fd;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: #f2f7fd;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #07182d;
  background: #cfe2ff;
}

.page-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(440px, 0.93fr);
  min-height: 100vh;
  min-height: 100svh;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(30px, 3.7vw, 54px) clamp(34px, 4.8vw, 74px) clamp(30px, 4.2vh, 48px);
  color: #f5fbff;
  background:
    radial-gradient(ellipse at 84% 14%, rgba(90, 196, 230, 0.16), transparent 38%),
    radial-gradient(ellipse at 8% 88%, rgba(37, 99, 235, 0.18), transparent 46%),
    linear-gradient(138deg, var(--navy-950) 0%, #09213d 48%, #0b2b50 100%);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(159, 204, 241, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(159, 204, 241, 0.052) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.72), transparent 72%);
  -webkit-mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.72), transparent 72%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  top: -240px;
  left: -220px;
  z-index: 0;
  width: 560px;
  height: 560px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 193, 232, 0.09), transparent 68%);
}

.brand-header,
.brand-copy,
.brand-footer {
  position: relative;
  z-index: 2;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: #d8f8ff;
  border: 1px solid rgba(136, 216, 238, 0.28);
  border-radius: 13px;
  background: rgba(7, 29, 55, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.brand-mark svg {
  display: block;
  width: 29px;
  height: 29px;
}

.brand-lockup-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.brand-lockup-title {
  color: #f5fbff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.brand-lockup-subtitle {
  color: #8fb4d2;
  font-size: 9.5px;
  line-height: 1.35;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.brand-copy {
  width: min(100%, 556px);
  margin-top: clamp(76px, 14vh, 166px);
}

.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 clamp(20px, 3vh, 30px);
  padding: 7px 12px;
  color: #a9d8e6;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.16em;
  border: 1px solid rgba(130, 207, 230, 0.22);
  border-radius: 999px;
  background: rgba(8, 31, 58, 0.38);
}

.product-tag::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 0 4px rgba(100, 221, 234, 0.08);
}

.brand-headline {
  max-width: 540px;
  margin: 0;
  color: #f2f8ff;
  font-size: clamp(38px, 4.25vw, 62px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.035em;
}

.brand-headline-emphasis {
  display: block;
  margin-top: 0.08em;
  color: var(--cyan-300);
}

.brand-description {
  width: min(100%, 462px);
  margin: 28px 0 0;
  color: #b2cce3;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.025em;
}

.wafer-art {
  position: absolute;
  right: clamp(-190px, -8vw, -80px);
  bottom: clamp(-280px, -25vh, -150px);
  z-index: 1;
  width: min(76%, 760px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.94;
  filter: drop-shadow(0 42px 70px rgba(1, 15, 32, 0.3));
}

.wafer-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.wafer-orbit {
  transform-box: view-box;
  transform-origin: 386px 376px;
  animation: wafer-orbit 48s linear infinite;
}

.brand-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: clamp(38px, 8vh, 96px);
  color: #6e92b0;
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.2em;
}

.brand-footer-line {
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, rgba(123, 221, 234, 0.42), rgba(123, 221, 234, 0.04));
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 3.3vw, 44px) clamp(24px, 3.4vw, 54px) clamp(18px, 3vh, 28px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 88% 4%, rgba(255, 255, 255, 0.96), transparent 46%),
    radial-gradient(ellipse at 8% 96%, rgba(197, 224, 250, 0.34), transparent 42%),
    linear-gradient(180deg, #f3f8fe 0%, #eff6fd 58%, #f8fbff 100%);
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: -224px;
  right: -214px;
  width: 500px;
  height: 500px;
  pointer-events: none;
  border: 1px solid rgba(80, 136, 201, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(80, 136, 201, 0.035),
    0 0 0 112px rgba(80, 136, 201, 0.022);
}

.auth-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: clamp(26px, 4vh, 52px) 0;
}

.auth-card {
  width: min(100%, 448px);
  padding: clamp(30px, 3.6vw, 46px);
  border: 1px solid rgba(206, 222, 240, 0.96);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 30px 78px -32px rgba(22, 62, 108, 0.27),
    0 10px 26px -20px rgba(22, 62, 108, 0.18);
  animation: card-arrive 0.58s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 clamp(23px, 3vh, 30px);
  color: #5f7288;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

.kicker-mark {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid #c9dcf0;
  border-radius: 7px;
  background: #f4f9ff;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.kicker-mark::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 6px;
  height: 6px;
  border: 1px solid #2d67d7;
  border-radius: 1.5px;
  transform: rotate(45deg);
}

.kicker-mark::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #18b5cf;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-heading {
  margin-bottom: 4px;
}

.form-title {
  margin: 0;
  color: var(--ink-900);
  font-size: clamp(28px, 2.8vw, 34px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.form-description {
  margin: 10px 0 0;
  color: #61758c;
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.form-alert {
  margin: 0 0 22px;
  padding: 11px 13px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  border: 1px solid var(--danger-line);
  border-left: 3px solid #cf5748;
  border-radius: 10px;
  background: var(--danger-bg);
}

.form-alert:empty {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.045em;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #8ca0b6;
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.18s ease;
}

.field-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.field-input {
  width: 100%;
  height: 52px;
  min-width: 0;
  padding: 0 16px 0 44px;
  color: #10243c;
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--input-bg);
  caret-color: var(--focus);
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.field-input::placeholder {
  color: #8396aa;
  opacity: 1;
}

.field-input:hover {
  border-color: var(--line-strong);
}

.field-input:focus {
  border-color: var(--focus);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 87, 232, 0.11);
}

.field-control:focus-within .field-icon {
  color: #2d63d9;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  padding: 0 9px;
  color: #657d98;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}

.password-toggle:hover {
  color: #2455c7;
  background: #edf4fc;
}

.password-toggle:focus-visible {
  color: #1d4dc0;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  background: #edf4fc;
}

.password-toggle[aria-pressed="true"] {
  color: var(--focus);
  background: #edf4ff;
}

.password-toggle-icon {
  display: block;
  width: 17px;
  height: 17px;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  padding: 0 20px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.06em;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #245fff 0%, var(--cobalt-700) 100%);
  box-shadow:
    0 13px 25px -13px rgba(27, 82, 231, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

.primary-button:hover {
  filter: brightness(1.045);
  transform: translateY(-1px);
  box-shadow:
    0 17px 30px -13px rgba(27, 82, 231, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

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

.primary-button:focus-visible {
  outline: 3px solid #0d3cb3;
  outline-offset: 3px;
}

.primary-button[aria-disabled="true"] {
  cursor: progress;
  filter: saturate(0.86);
}

.primary-button-icon {
  display: block;
  width: 18px;
  height: 18px;
  transition: transform 0.18s ease;
}

.primary-button:hover .primary-button-icon {
  transform: translateX(2px);
}

.auth-form.is-submitting .primary-button {
  cursor: progress;
}

.auth-form-logout {
  gap: 18px;
}

.cancel-link {
  align-self: center;
  padding: 4px 2px;
  color: #57708e;
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
}

.cancel-link:hover {
  color: #1f4ec8;
  border-bottom-color: currentColor;
}

.cancel-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 16px;
  color: var(--muted-500);
  font-size: 11.5px;
  line-height: 1.6;
}

.footer-site {
  color: #4f6982;
  letter-spacing: 0.07em;
}

.footer-divider {
  width: 1px;
  height: 11px;
  background: #c1d2e3;
}

.site-footer a {
  color: #536b84;
  text-decoration: none;
  border-bottom: 1px solid rgba(83, 107, 132, 0.25);
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
}

.site-footer a:hover {
  color: #1f4ec8;
  border-bottom-color: currentColor;
}

.site-footer a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

@keyframes card-arrive {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wafer-orbit {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .brand-copy {
    margin-top: clamp(56px, 11vh, 118px);
  }

  .brand-headline {
    font-size: clamp(36px, 4.4vw, 50px);
  }

  .brand-description {
    max-width: 400px;
    font-size: 14px;
  }

  .wafer-art {
    width: min(82%, 660px);
    right: clamp(-210px, -10vw, -100px);
    bottom: clamp(-250px, -22vh, -140px);
  }
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100svh;
  }

  .brand-panel {
    min-height: 0;
    padding: 20px clamp(20px, 4.5vw, 34px) 26px;
    border-radius: 0 0 26px 26px;
  }

  .brand-panel::before {
    background-size: 48px 48px;
    mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.5), transparent 62%);
    -webkit-mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.5), transparent 62%);
  }

  .brand-panel::after {
    top: -330px;
    left: auto;
    right: -220px;
  }

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

  .brand-mark svg {
    width: 26px;
    height: 26px;
  }

  .brand-copy {
    width: min(100%, 580px);
    margin-top: 22px;
  }

  .product-tag {
    margin-bottom: 13px;
    padding: 6px 10px;
    font-size: 10.5px;
    letter-spacing: 0.13em;
  }

  .brand-headline {
    max-width: 560px;
    font-size: clamp(25px, 5vw, 34px);
    line-height: 1.3;
    letter-spacing: -0.025em;
  }

  .brand-headline-emphasis {
    display: inline;
    margin-top: 0;
  }

  .brand-description,
  .wafer-art,
  .brand-footer {
    display: none;
  }

  .auth-panel {
    padding: 0 16px;
    overflow: visible;
    background:
      radial-gradient(ellipse at 100% 0%, rgba(255, 255, 255, 0.92), transparent 52%),
      linear-gradient(180deg, #f2f8fe 0%, #f8fbff 100%);
  }

  .auth-panel::before {
    display: none;
  }

  .auth-stage {
    display: block;
    padding: 26px 0 18px;
  }

  .auth-card {
    width: 100%;
    max-width: 486px;
    margin: 0 auto;
    padding: 28px 24px 27px;
    border-radius: 22px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.95) inset,
      0 22px 52px -30px rgba(22, 62, 108, 0.25),
      0 6px 18px -16px rgba(22, 62, 108, 0.16);
  }

  .card-kicker {
    margin-bottom: 22px;
  }

  .site-footer {
    padding: 0 0 max(20px, env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .brand-panel {
    padding: 18px 18px 23px;
    border-radius: 0 0 22px 22px;
  }

  .brand-lockup {
    gap: 11px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 24px;
    height: 24px;
  }

  .brand-lockup-title {
    font-size: 14px;
    letter-spacing: 0.035em;
  }

  .brand-lockup-subtitle {
    font-size: 8.5px;
    letter-spacing: 0.16em;
  }

  .brand-copy {
    margin-top: 18px;
  }

  .brand-headline {
    font-size: 24px;
    line-height: 1.32;
  }

  .auth-panel {
    padding: 0 12px;
  }

  .auth-stage {
    padding-top: 22px;
  }

  .auth-card {
    padding: 25px 18px 24px;
    border-radius: 20px;
  }

  .card-kicker {
    margin-bottom: 20px;
  }

  .form-title {
    font-size: 27px;
  }

  .form-description {
    font-size: 13.5px;
  }

  .site-footer {
    gap: 8px;
    font-size: 11px;
  }
}

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

  .auth-card,
  .wafer-orbit {
    animation: none !important;
  }

  .primary-button:hover,
  .primary-button:hover .primary-button-icon {
    transform: none;
  }
}
