:root {
  --ink: #101923;
  --paper: #f3efe6;
  --surface: #fbf8f1;
  --muted: #6d706d;
  --line: #d3cbbd;
  --lime: #d7df86;
  --red: #b9412d;
  --white: #fffdf8;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong",
    "SimSun", Georgia, serif;
  --sans: "Aptos", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(500px, 1.08fr);
  min-height: 100svh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  color: var(--white);
  background:
    radial-gradient(circle at 28% 34%, rgba(215, 223, 134, 0.13), transparent 28%),
    linear-gradient(150deg, #183e50, #101923 64%);
}

.auth-visual::after {
  position: absolute;
  right: -210px;
  bottom: -340px;
  width: 720px;
  height: 720px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  content: "";
}

.auth-visual-top {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  align-items: center;
}

.auth-visual-top > strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.auth-mark {
  display: grid;
  gap: 4px;
  width: 31px;
}

.auth-mark span {
  display: block;
  height: 3px;
  background: var(--white);
}

.auth-mark span:nth-child(2) {
  width: 72%;
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.auth-visual-copy > p {
  color: #aebbbc;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.auth-visual-copy h1 {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 5.6vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.02;
}

.auth-visual-foot {
  position: relative;
  z-index: 1;
  max-width: 400px;
  color: #8e9c9f;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.045em;
}

.auth-panel {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 42px;
  background:
    linear-gradient(rgba(16, 25, 35, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 25, 35, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 72px 72px;
}

.auth-panel-inner {
  width: min(100%, 470px);
}

.auth-home {
  display: inline-block;
  margin-bottom: 60px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  position: relative;
  padding: 0 0 14px;
  margin-right: 28px;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 650;
}

.auth-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--ink);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

.auth-tab.is-active {
  color: var(--ink);
}

.auth-tab.is-active::after {
  transform: scaleX(1);
}

.auth-eyebrow {
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.075em;
}

.auth-panel h2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 3.7rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-intro {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.auth-form label {
  margin-top: 8px;
  color: var(--ink-soft, #29343c);
  font-size: 0.72rem;
  font-weight: 650;
}

.auth-form input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: var(--surface);
  transition: border-color 160ms ease;
}

.auth-form input:focus {
  border-color: var(--ink);
}

.auth-form input::placeholder {
  color: #999790;
}

.auth-submit {
  min-height: 52px;
  margin-top: 18px;
  color: var(--white);
  border: 0;
  background: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: var(--red);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.58;
}

.auth-forgot {
  justify-self: end;
  margin-top: 2px;
  padding: 3px 0;
  color: var(--red);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
}

.auth-phone-confirm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 15px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.auth-phone-confirm > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.54rem;
}

.auth-phone-confirm strong {
  grid-column: 1;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.auth-phone-confirm button {
  grid-row: 1 / 3;
  grid-column: 2;
  padding: 5px 0;
  color: var(--red);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.66rem;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.auth-code-row button {
  min-width: 104px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.auth-code-row button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.auth-hidden-username {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.auth-status {
  min-height: 22px;
  margin-top: 18px;
  color: var(--red);
  font-size: 0.74rem;
}

.auth-status.is-success {
  color: #2d6d50;
}

.auth-terms {
  margin-top: 28px;
  color: #96958e;
  font-size: 0.64rem;
  line-height: 1.7;
}

.auth-admin-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 34px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.auth-admin-entry a {
  color: var(--red);
  border-bottom: 1px solid currentColor;
}

.auth-admin-entry a:hover {
  color: var(--ink);
}

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

  .auth-visual {
    min-height: 330px;
    padding: 26px;
  }

  .auth-visual-copy h1 {
    font-size: clamp(2.7rem, 10vw, 4.4rem);
  }

  .auth-visual-foot {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    padding: 44px 22px 60px;
  }

  .auth-home {
    margin-bottom: 42px;
  }
}

@media (max-width: 480px) {
  .auth-visual {
    min-height: 260px;
  }

  .auth-visual-copy > p {
    display: none;
  }

  .auth-visual-copy h1 {
    margin-top: 0;
    font-size: 2.55rem;
  }

  .auth-tabs {
    margin-bottom: 36px;
  }
}
