/* ============================================================
   青鸾官网 · 登录 / 注册
   ============================================================ */
.auth {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  min-height: 100vh;
}

/* ---------------------------------------------------------- 左：品牌面板 */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 44px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: radial-gradient(90% 70% at 18% 0%, rgba(79, 227, 166, 0.14), transparent 58%),
    radial-gradient(70% 60% at 92% 100%, rgba(69, 211, 232, 0.1), transparent 62%), #080B0E;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 26% 18%, #000, transparent 74%);
  mask-image: radial-gradient(70% 60% at 26% 18%, #000, transparent 74%);
  opacity: 0.55;
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -60px;
  width: 420px;
  height: 420px;
  background: url("../img/logo.png") center / contain no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

.auth-brand-top {
  position: relative;
  z-index: 1;
  align-self: flex-start;
}

.auth-quote {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.auth-quote h2 {
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.auth-quote-sub {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.auth-points {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.auth-points li {
  position: relative;
  padding-left: 26px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(79, 227, 166, 0.3);
  border-radius: 50%;
  background: rgba(79, 227, 166, 0.1);
}

.auth-points li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 5px;
  height: 3px;
  border-left: 1.5px solid var(--brand);
  border-bottom: 1.5px solid var(--brand);
  transform: rotate(-45deg);
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------- 右：表单 */
.auth-panel {
  display: grid;
  place-items: center;
  padding: 56px 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 404px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  font-size: 13px;
  color: var(--text-3);
  transition: color var(--t-fast) var(--ease);
}

.auth-back:hover {
  color: var(--text);
}

.auth-title {
  font-size: 30px;
  line-height: 1.3;
  font-weight: 600;
}

.auth-sub {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--text-2);
}

#authForm {
  margin-top: 28px;
}

.field {
  margin-bottom: 18px;
}

.field > label:not(.check) {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-3);
}

.control {
  position: relative;
}

.control input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}

.control input::placeholder {
  color: var(--text-3);
}

.control input:hover {
  border-color: var(--line-3);
}

.control input:focus {
  outline: none;
  border-color: rgba(79, 227, 166, 0.55);
  background: #11161B;
  box-shadow: 0 0 0 3px rgba(79, 227, 166, 0.14);
}

.control input[aria-invalid="true"] {
  border-color: rgba(255, 107, 107, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

.control:has(.eye) input {
  padding-right: 46px;
}

.field.has-error > label:not(.check) {
  color: #FFB3B3;
}

.eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.eye:hover {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
}

.eye svg {
  width: 18px;
  height: 18px;
}

.eye[aria-pressed="true"] {
  color: var(--brand);
}

.field-err {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #FFB3B3;
}

/* 记住我 / 条款 */
.check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-box {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line-3);
  border-radius: 5px;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.check input:checked + .check-box {
  border-color: var(--brand);
  background: var(--brand);
}

.check input:checked + .check-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border-right: 2px solid var(--brand-ink);
  border-bottom: 2px solid var(--brand-ink);
  transform: rotate(45deg);
}

.check input:focus-visible + .check-box {
  outline: 3px solid rgba(79, 227, 166, 0.5);
  outline-offset: 2px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 22px;
}

.auth-link {
  color: var(--brand);
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 按钮加载态 */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(7, 9, 11, 0.22);
  border-top-color: #07090B;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .spinner {
  display: inline-block;
}

.btn.is-loading .btn-text {
  opacity: 0.7;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 密码强度 */
.strength {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.strength i {
  flex: 1;
  height: 3px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.09);
  transition: background-color var(--t-mid) var(--ease);
}

.strength[data-level="1"] i:nth-child(1) {
  background: #FF8A8A;
}

.strength[data-level="2"] i:nth-child(-n + 2) {
  background: #F5C86B;
}

.strength[data-level="3"] i {
  background: var(--brand);
}

.field-agree {
  margin-top: 22px;
}

.field-agree .check {
  align-items: flex-start;
  width: 100%;
}

.field-agree .check > span:last-child {
  min-width: 0;
}

.field-agree .check-box {
  margin-top: 2px;
}

/* 提示 */
.form-alert {
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--r-sm);
  background: rgba(255, 107, 107, 0.08);
  color: #FFB3B3;
  font-size: 13px;
  line-height: 1.65;
}

.auth-alt {
  margin-top: 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-2);
}

.auth-alt a {
  color: var(--brand);
  font-weight: 500;
}

.auth-note {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-3);
}

.auth-demo {
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 940px) {
  .auth {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .auth-brand {
    gap: 18px;
    padding: 22px var(--pad-x);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-brand::after {
    width: 220px;
    height: 220px;
    right: -50px;
    bottom: -70px;
  }

  .auth-quote h2 {
    font-size: 22px;
  }

  .auth-quote-sub {
    margin-top: 8px;
    font-size: 13px;
  }

  .auth-points,
  .auth-brand-foot {
    display: none;
  }

  .auth-panel {
    padding: 36px var(--pad-x) 56px;
    place-items: start center;
  }
}

@media (max-width: 480px) {
  .auth-title {
    font-size: 26px;
  }
}

.code-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.code-control input {
  flex: 1;
}

.code-control .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
