:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --brand: #2c61eb;
  --brand-deep: #2457dd;
  --panel: #eef0f5;
  --ink: #171a21;
  --muted: #7b8292;
  --line: #d1d5dc;
  --danger: #dc3f4e;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-width: 320px; min-height: 100%; background: var(--panel); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--panel);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.page-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 48px rgb(28 42 68 / 14%);
}

.brand-hero {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: #2564ed;
}
.brand-texture {
  position: absolute;
  inset: 0;
  opacity: .055;
  background: url("../img/hero-texture.webp") center / cover no-repeat;
  mix-blend-mode: screen;
}
.brand-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 100%;
  padding: 0 20px 0 28px;
}
.brand-mark {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px rgb(10 56 161 / 25%));
}
.brand-slogan {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.52;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgb(10 45 130 / 22%);
}
.brand-slogan span { font-size: inherit; }
.brand-wordmark {
  align-self: start;
  margin: 95px 0 0;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}
.brand-wordmark strong { font-size: 31px; font-weight: 500; }

.auth-panel {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 264px);
  margin-top: -36px;
  padding: 0 23px calc(34px + env(safe-area-inset-bottom));
  border-radius: 36px 36px 0 0;
  background: var(--panel);
}
.mode-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 69px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--line);
}
.mode-tabs.single-tab { grid-template-columns: 1fr; }
.mode-tab {
  position: relative;
  appearance: none;
  border: 0;
  color: #292d37;
  background: transparent;
  font-size: 21px;
  cursor: pointer;
}
.mode-tab::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 3px;
  content: "";
  background: transparent;
  transform: scaleX(0);
  transition: transform 180ms ease, background-color 180ms ease;
}
.mode-tab.is-active::after { background: #3768ec; transform: scaleX(1); }
.mode-tab:focus-visible, .visibility-button:focus-visible, .primary-button:focus-visible, .code-button:focus-visible {
  outline: 3px solid rgb(44 97 235 / 28%);
  outline-offset: 3px;
}
.step-heading {
  height: 69px;
  margin: -28px 0 28px;
  border-bottom: 2px solid var(--line);
  color: #292d37;
  font-size: 21px;
  line-height: 69px;
  text-align: center;
}
.field-group { margin-bottom: 28px; }
.field-group label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 27px;
  margin: 0 2px 13px;
  color: #121722;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}
.field-group label svg {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #5d8df6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}
.field-group label img {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  object-fit: contain;
}
.field-group input {
  width: 100%;
  height: 58px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  outline: none;
  color: #151821;
  background: #fff;
  font-size: 17px;
  box-shadow: 0 1px 2px rgb(32 45 72 / 2%);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field-group input::placeholder { color: #a5aab5; }
.field-group input:focus {
  border-color: #6f97f3;
  box-shadow: 0 0 0 3px rgb(55 104 236 / 12%);
}
.field-group.has-error input { border-color: var(--danger); }
.field-error {
  min-height: 0;
  margin: 6px 4px -8px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.35;
}
.field-error:empty { display: none; }
.password-control, .code-control { position: relative; display: flex; align-items: center; }
.password-control input { padding-right: 52px; }
.visibility-button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #818897;
  background: transparent;
  cursor: pointer;
}
.visibility-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.visibility-button .eye-closed, .visibility-button[aria-pressed="true"] .eye-open { display: none; }
.visibility-button[aria-pressed="true"] .eye-closed { display: block; }
.code-control, .code-row { gap: 9px; }
.code-control input, .code-row input { min-width: 0; flex: 1; }
.code-button {
  flex: 0 0 auto;
  height: 58px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #2580e9;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.code-button:disabled { cursor: wait; opacity: .65; }
.primary-button {
  position: relative;
  display: grid;
  width: 100%;
  height: 54px;
  margin-top: 25px;
  padding: 0 24px;
  place-items: center;
  border: 0;
  border-radius: 28px;
  color: #fff;
  background: var(--brand);
  font-size: 19px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 18px rgb(44 97 235 / 19%);
  transition: background-color 160ms ease, transform 120ms ease;
}
.primary-button:hover { background: var(--brand-deep); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.button-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.primary-button.is-loading .button-label { display: none; }
.primary-button.is-loading .button-spinner { display: block; }
.form-message { min-height: 20px; margin: 0; color: #257246; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message.is-error { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 390px) {
  .brand-hero { height: 300px; }
  .brand-row { grid-template-columns: 86px minmax(0, 1fr) auto; gap: 8px; padding-right: 19px; padding-left: 28px; }
  .brand-mark { width: 86px; height: 86px; }
  .brand-slogan { font-size: 16px; }
  .brand-wordmark { margin-top: 95px; font-size: 18px; }
  .brand-wordmark strong { font-size: 31px; }
  .auth-panel { min-height: calc(100vh - 264px); padding-right: 23px; padding-left: 23px; border-radius: 36px 36px 0 0; }
  .mode-tabs { margin-bottom: 28px; }
  .field-group { margin-bottom: 28px; }
}
@media (max-width: 350px) {
  .field-group label { font-size: 15px; }
  .field-group input { font-size: 16px; }
  .code-button { padding-right: 11px; padding-left: 11px; font-size: 13px; }
}
@media (min-width: 481px) { .page-shell { min-height: max(100vh, 760px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

