:root {
  color-scheme: dark;
  --ground: #191d20;
  --paper: #f3f2ec;
  --muted: #c3cccb;
  --blue: #c4e2f7;
  --border: #566069;
  --field: #22292e;
  --edge: clamp(20px, 4.1vw, 64px);
  background: var(--ground);
  color: var(--paper);
  font: 1rem / 1.55 "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }

:is(a, button, input):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--edge) 0;
}

.brand, .header-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper);
  text-decoration: none;
}

.brand img { display: block; width: 124px; height: auto; }
.header-action {
  justify-content: center;
  min-width: 68px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .875rem;
}
.header-action:hover { border-color: var(--blue); color: var(--blue); }

.registration {
  display: grid;
  width: min(100% - var(--edge) * 2, 1080px);
  min-height: calc(100svh - 64px);
  margin-inline: auto;
  padding: 40px 0 54px;
  grid-template-columns: minmax(0, 1fr) minmax(355px, 442px);
  align-items: center;
  gap: clamp(40px, 7vw, 106px);
}

.registration__intro {
  position: relative;
  isolation: isolate;
  padding-block: 94px;
}

.registration__mark {
  position: absolute;
  z-index: -1;
  inset: 50% auto auto 46%;
  width: min(120%, 530px);
  height: auto;
  opacity: .085;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.75rem);
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -.045em;
}

.registration__intro p, .success p {
  margin: 16px 0 0;
  color: var(--muted);
}

.registration__account { min-width: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend {
  float: left;
  width: 100%;
  margin: 0 0 15px;
  padding: 0 0 9px;
  border-bottom: 1px solid #d7e7ee30;
  font-size: 1.06rem;
  font-weight: 650;
}
legend + * { clear: both; }

label {
  display: block;
  margin: 0 0 5px;
  font-size: .875rem;
  font-weight: 550;
}

input:not([type="radio"]), button { font: inherit; }
input:not([type="radio"]) {
  display: block;
  width: 100%;
  height: 45px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--field);
  color: var(--paper);
}
input::placeholder { color: #aab3b7; }
input[aria-invalid="true"] { border-color: #ffb7ac; }
input:autofill { border-color: #91a8b9; }

.hint {
  min-height: 19px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .8125rem;
}

.password-field { position: relative; margin-bottom: 11px; }
.password-field input { padding-right: 69px; }
.phone-field { position: relative; }
.phone-field input { padding-left: 61px; }
#phone-prefix {
  position: absolute;
  inset: 10px auto 10px 12px;
  display: flex;
  align-items: center;
  padding-right: 11px;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: .875rem;
  pointer-events: none;
}
#show-password {
  position: absolute;
  inset: 1px 1px 1px auto;
  min-width: 57px;
  min-height: 43px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: .875rem;
}
#show-password:hover { background: #c4e2f710; }
.hint + label { margin-top: 10px; }
.verification { margin-top: 21px; }
#registration-mode { margin-top: 13px; }

.method-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 13px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.method-switch label { position: relative; margin: 0; }
.method-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.method-switch span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.method-switch input:checked + span { background: #35444e; color: var(--paper); }
.method-switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.code-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}
.verification > label { margin-top: 11px; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }

#send-code {
  min-width: 100px;
  min-height: 45px;
  padding-inline: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--blue);
  font-size: .875rem;
}
#send-code:not(:disabled):hover { border-color: var(--blue); }

.notice { margin: 6px 0; color: #ffc3ba; font-size: .875rem; }

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
}
.auth-switch a, .auth-back { color: var(--blue); text-decoration: none; }
.auth-switch a:hover, .auth-back:hover { text-decoration: underline; }
.auth-back { border: 0; background: transparent; padding: 4px 8px; font-size: inherit; }

.submit {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #13212a;
  font-weight: 650;
  text-decoration: none;
}
.submit:not(:disabled):hover { background: #e2f1fc; }
.success h2 { margin: 0; font-size: 1.75rem; }
.success p { margin: 14px 0 20px; }

@media (max-width: 780px) {
  .registration { grid-template-columns: minmax(0, 1fr); gap: 27px; width: min(100% - var(--edge) * 2, 480px); }
  .registration__intro { padding-block: 0; }
  .registration__mark { display: none; }
  .registration__intro p { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .method-switch span { transition: none; }
}
