/* ==========================================================================
   义乌AI圈 — authentication surface
   The front door. Paper on ink, seal on paper.
   ========================================================================== */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  background: var(--paper);
}

/* ---------------- aside ---------------- */
.auth__aside {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 34px 44px 30px;
  isolation: isolate;
}

.auth__aside::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 8, 4, 0.62) 0%, rgba(10, 8, 4, 0.12) 26%, rgba(10, 8, 4, 0.08) 50%, rgba(10, 8, 4, 0.86) 100%),
    linear-gradient(90deg, rgba(10, 8, 4, 0.55) 0%, rgba(10, 8, 4, 0.18) 48%, rgba(10, 8, 4, 0) 78%),
    url("../img/login-bg.jpg") 52% center / cover no-repeat;
}

.auth__aside::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.auth__aside .brand__logo { height: 40px; width: auto; }

.auth__slogan {
  font-family: var(--f-serif);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: #e8836d;
  margin-bottom: 14px;
}

.auth__display,
.auth__quote,
.auth__figures,
.auth__slogan,
.auth__kicker {
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.55);
}

.auth__aside-body {
  margin-top: auto;
  position: relative;
  padding-bottom: 22px;
}

.auth__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(242, 236, 221, 0.55);
  margin-bottom: 26px;
}
.auth__kicker::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--red);
}

.auth__display {
  font-size: clamp(46px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: 22px;
}

.auth__display .outline {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.4px rgba(242, 236, 221, 0.72);
}

.auth__quote {
  font-family: var(--f-kai);
  font-size: 16px;
  line-height: 1.95;
  color: rgba(242, 236, 221, 0.72);
  border-left: 2px solid var(--red);
  padding-left: 16px;
  max-width: 26em;
}

.auth__figures {
  display: flex;
  gap: 34px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(242, 236, 221, 0.16);
  flex-wrap: wrap;
}

.auth__fig b {
  display: block;
  font-family: var(--f-mono);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.auth__fig span {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 236, 221, 0.62);
}

.auth__aside-foot {
  margin-top: auto;
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(242, 236, 221, 0.62);
  text-transform: uppercase;
}

.auth__seal {
  position: absolute;
  right: 40px;
  top: 34px;
  width: 78px;
  height: 78px;
  border: 1.5px solid rgba(196, 53, 28, 0.85);
  color: #d8604a;
  display: grid;
  place-items: center;
  font-family: var(--f-serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 1.35;
  transform: rotate(8deg);
  opacity: 0.85;
}

/* ---------------- form side ---------------- */
.auth__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 40px 30px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 37px,
    rgba(20, 18, 10, 0.035) 37px 38px
  );
}

.auth__panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-55);
}

.auth__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: gap 0.25s var(--ease), color 0.2s;
}
@media (hover: hover) { .auth__back:hover { gap: 11px; color: var(--ink); } }

.auth__sheet {
  width: min(404px, 100%);
  margin: auto;
  padding: 30px 0;
}

.auth__title {
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.auth__title em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
}

.auth__desc {
  font-size: 13px;
  color: var(--ink-55);
  line-height: 1.75;
  margin-bottom: 26px;
}

/* tabs */
.auth__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 24px;
}

.auth__tab {
  position: relative;
  padding: 10px 0 11px;
  margin-right: 26px;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-40);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

@media (hover: hover) { .auth__tab:hover { color: var(--ink-70); } }

.auth__tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.auth__tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.auth__tab[aria-selected="true"]::after { transform: scaleX(1); }

/* steps */
.auth-step:not(.is-on) { display: none; }
.auth-step.is-on { display: block; animation: stepIn 0.32s var(--ease); }
.auth-form.auth-step.is-on { display: grid; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.auth-form { display: grid; gap: 15px; }

/* phone with prefix */
.phone-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink-20);
  background: var(--card);
  border-radius: var(--r);
  transition: border-color 0.18s, box-shadow 0.18s;
  overflow: hidden;
}

.phone-field:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 18, 10, 0.08);
}

.phone-field.has-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(196, 53, 28, 0.1);
}

.phone-field__pre {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-70);
  background: var(--paper-2);
  border-right: 1px solid var(--ink-20);
  white-space: nowrap;
  flex: 0 0 auto;
}

.phone-field__pre svg { width: 11px; height: 11px; opacity: 0.5; }

.phone-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 13px 12px;
  font-family: var(--f-mono);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.phone-field input:focus { outline: none; }
.phone-field input { caret-color: var(--red); }
.phone-field input::placeholder { color: var(--ink-40); letter-spacing: 0.06em; }

.phone-field__clear {
  display: grid;
  place-items: center;
  width: 36px;
  border: 0;
  background: none;
  color: var(--ink-40);
  cursor: pointer;
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.phone-field__clear.is-on { opacity: 1; }
@media (hover: hover) { .phone-field__clear:hover { color: var(--ink); } }

/* code field */
.code-row { display: flex; gap: 9px; }
.code-row .input { flex: 1; font-family: var(--f-mono); letter-spacing: 0.18em; }

.otp-send {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 3px 0 2px;
  text-transform: uppercase;
  color: var(--red);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(196, 53, 28, 0.4);
  cursor: pointer;
  line-height: 1.6;
  transition: color 0.2s, border-color 0.2s;
}
@media (hover: hover) { .otp-send:hover:not(:disabled) { color: var(--ink); border-color: var(--ink); } }
.otp-send:disabled { color: var(--ink-40); border-color: var(--ink-12); cursor: not-allowed; }

/* otp boxes */
.otp { display: flex; gap: 8px; }

.otp__box {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 58px;
  text-align: center;
  border: 1px solid var(--ink-20);
  background: var(--card);
  border-radius: var(--r);
  font-family: var(--f-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  caret-color: var(--red);
  padding: 0;
}

@media (hover: hover) { .otp__box:hover { border-color: var(--ink-40); } }

.otp__box:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 18, 10, 0.1);
}

.otp__box:not(:placeholder-shown) {
  background: var(--paper);
  border-color: var(--ink);
}

.otp.has-error .otp__box { border-color: var(--red); }

/* inline status */
.auth-status {
  display: none;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--r);
}
.auth-status.is-on { display: flex; }

.auth-status.is-error {
  color: var(--red-deep);
  background: rgba(196, 53, 28, 0.07);
  border-color: rgba(196, 53, 28, 0.28);
}

.auth-status.is-ok {
  color: var(--ok);
  background: rgba(31, 107, 58, 0.06);
  border-color: rgba(31, 107, 58, 0.25);
}

.auth-status.is-info {
  color: var(--ink-70);
  background: var(--paper-2);
  border-color: var(--ink-12);
}

.auth-status__icon { font-family: var(--f-mono); font-weight: 700; flex: 0 0 auto; }

/* meta row */
.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-help {
  font-size: 12.5px;
  color: var(--ink-55);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  border-bottom: 1px solid var(--ink-20);
  transition: color 0.2s, border-color 0.2s;
}
@media (hover: hover) { .auth-help:hover { color: var(--red); border-color: var(--red); } }

/* password */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 66px; font-family: var(--f-mono); letter-spacing: 0.04em; }

.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 10px;
  border: 0;
  background: none;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-55);
  cursor: pointer;
  border-radius: var(--r-sm);
}
@media (hover: hover) { .pw-toggle:hover { color: var(--ink); background: var(--paper-2); } }

.caps-hint {
  display: none;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}
.caps-hint.is-on { display: block; }

/* strength */
.strength { display: grid; gap: 6px; margin-top: 2px; }
.strength__bars { display: flex; gap: 4px; }
.strength__bars i {
  flex: 1;
  height: 3px;
  background: var(--ink-12);
  transition: background 0.25s;
}
.strength__label {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-40);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}
.strength[data-level="1"] .strength__bars i:nth-child(1) { background: var(--red); }
.strength[data-level="2"] .strength__bars i:nth-child(-n + 2) { background: var(--gold); }
.strength[data-level="3"] .strength__bars i:nth-child(-n + 3) { background: var(--ok); }
.strength[data-level="4"] .strength__bars i { background: var(--ok); }

/* submit */
.auth-submit { margin-top: 4px; height: 50px; position: relative; }

.auth-submit .spinner {
  width: 15px; height: 15px;
  border: 1.5px solid rgba(242, 236, 221, 0.35);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.auth-submit.is-busy .spinner { display: block; }
.auth-submit.is-busy .label { opacity: 0.7; }

@keyframes spin { to { transform: rotate(360deg); } }

/* divider + social */
.auth-div {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.auth-div::before,
.auth-div::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-12);
}

.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1px solid var(--ink-20);
  background: transparent;
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--ink-70);
  cursor: pointer;
  transition: all 0.18s;
}
@media (hover: hover) { .social-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--card); } }
.social-btn svg { width: 16px; height: 16px; }

/* legal */
.auth-legal {
  margin-top: 22px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-40);
  text-align: center;
}

/* success */
.auth-done { text-align: center; padding: 14px 0 4px; }

.auth-done__seal {
  width: 92px;
  height: 92px;
  margin: 0 auto 22px;
  border: 2px solid var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--red);
  font-family: var(--f-serif);
  font-size: 20px;
  letter-spacing: 0.1em;
  transform: rotate(-8deg);
  animation: stampIn 0.5s var(--ease);
  position: relative;
}

.auth-done__seal::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(196, 53, 28, 0.45);
  border-radius: 50%;
}

@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-8deg) scale(1.5); }
  60% { opacity: 1; transform: rotate(-8deg) scale(0.94); }
  100% { transform: rotate(-8deg) scale(1); }
}

.auth-done h3 { font-size: 22px; margin-bottom: 8px; letter-spacing: -0.02em; }
.auth-done p { font-size: 13px; color: var(--ink-55); margin-bottom: 22px; }

/* demo hint */
.demo-hint {
  margin-top: 18px;
  border: 1px dashed var(--ink-20);
  padding: 9px 12px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  line-height: 1.7;
  color: var(--ink-40);
  text-transform: uppercase;
}
.demo-hint b { color: var(--ink-70); letter-spacing: 0.12em; }

/* ---------------- gate modal ---------------- */
.gate-head { margin-bottom: 18px; }
.gate-head .mono { color: var(--red); display: block; margin-bottom: 8px; }
.gate-head h3 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.gate-head p { font-size: 13px; color: var(--ink-55); line-height: 1.7; }

.gate-form { display: grid; gap: 13px; }

.gate-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--ink-20);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.gate-foot a { color: var(--ink-70); border-bottom: 1px solid var(--ink-20); }
@media (hover: hover) { .gate-foot a:hover { color: var(--red); border-color: var(--red); } }

/* contact reveal */
.contact-card { display: grid; gap: 12px; }
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ink-12);
  background: var(--card);
}
.contact-row span {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-40);
  text-transform: uppercase;
}
.contact-row b { font-family: var(--f-mono); font-size: 14px; letter-spacing: 0.04em; }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; min-height: auto; }
  .auth__aside {
    padding: 26px 24px 24px;
    min-height: 250px;
  }
  .auth__aside::before {
    background:
      linear-gradient(180deg, rgba(10, 8, 4, 0.72) 0%, rgba(10, 8, 4, 0.42) 45%, rgba(10, 8, 4, 0.88) 100%),
      linear-gradient(90deg, rgba(10, 8, 4, 0.45) 0%, rgba(10, 8, 4, 0) 70%),
      url("../img/login-bg.jpg") 55% center / cover no-repeat;
  }
  .auth__display { font-size: 40px; margin-bottom: 0; }
  .auth__display .outline { display: inline; margin-left: 6px; }
  .auth__quote { display: none; }
  .auth__figures { margin-top: 20px; padding-top: 16px; gap: 22px; }
  .auth__fig b { font-size: 18px; }
  .auth__aside-foot { display: none; }
  .auth__aside-body { margin-top: 34px; }
  .auth__kicker { margin-bottom: 16px; }
  .auth__seal { width: 60px; height: 60px; font-size: 12px; right: 24px; top: auto; bottom: 24px; }
  .auth__panel { padding: 20px 24px 40px; }
  .auth__sheet { padding: 26px 0 0; }
}

@media (max-width: 560px) {
  .auth__display { font-size: 34px; }
  .auth__fig:nth-child(3) { display: none; }
  .otp { gap: 6px; }
  .otp__box { height: 50px; font-size: 19px; }
  .auth__title { font-size: 26px; }
  .socials { grid-template-columns: 1fr; }
  .code-row { flex-wrap: nowrap; }
  .auth__tabs .auth__tab { margin-right: 20px; }
}

/* 会员登录暂未开放（服务端 SMS_MODE=off） */
.auth-closed {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin-top: 6px;
  padding: 18px 18px 20px;
  border: 1px dashed var(--ink-20);
  background: var(--paper);
}
.auth-closed[hidden] { display: none; }
.auth-closed .mono { color: var(--red); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; }
.auth-closed h3 { font-size: 20px; letter-spacing: -0.02em; }
.auth-closed p { font-size: 13px; line-height: 1.7; color: var(--ink-55); margin-bottom: 6px; }
.auth-step[hidden], .auth__tabs[hidden], .auth-legal[hidden], .auth__desc[hidden] { display: none !important; }
