/* 登录 / 注册 — 弹窗与独立页共用 */

.auth-standalone {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.auth-card {
  width: min(100%, 400px);
  padding: 28px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
}

.auth-card__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.auth-card__lead {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.auth-card__lead a {
  color: var(--accent-deep);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: rgba(196, 122, 48, 0.08);
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tab.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(60, 44, 32, 0.1);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease, outline-color 0.15s ease;
}

.auth-field input:focus {
  outline: 2px solid rgba(196, 122, 48, 0.3);
  border-color: var(--accent);
}

.auth-sms-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.auth-sms-row .btn--compact {
  min-width: 108px;
  padding: 0 10px;
}

.auth-error {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #c62828;
}

.auth-error[hidden] {
  display: none;
}

.auth-legal {
  margin: 14px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.auth-legal[hidden] {
  display: none;
}

.auth-legal a {
  color: var(--accent-deep);
}

.auth-hint {
  margin: -4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-forgot {
  margin: -4px 0 0;
  font-size: 0.86rem;
  text-align: right;
}

.auth-forgot a {
  color: var(--accent-deep);
}

.auth-footer {
  margin: 16px 0 0;
  font-size: 0.86rem;
  text-align: center;
  color: var(--text-soft);
}

.auth-footer a {
  color: var(--accent-deep);
}

.auth-switch {
  margin: 4px 0 0;
  font-size: 0.86rem;
  text-align: center;
  color: var(--text-soft);
}

.auth-switch__btn {
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--accent-deep);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-back {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.86rem;
  color: var(--muted);
}

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

/* 弹窗容器 */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 34, 28, 0.45);
}

.auth-overlay__panel {
  position: relative;
  width: min(100%, 400px);
  max-height: min(92vh, 640px);
  overflow: auto;
}

.auth-overlay__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

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

.auth-agreement {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
}

.auth-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.auth-check a {
  color: var(--accent-deep);
}

.auth-overlay__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.auth-overlay__actions .btn--primary {
  grid-column: 2;
}

body.auth-overlay-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 18px 20px;
  }

  .auth-sms-row {
    grid-template-columns: 1fr;
  }

  .auth-overlay__actions {
    grid-template-columns: 1fr;
  }

  .auth-overlay__actions .btn--primary {
    grid-column: 1;
    order: -1;
  }
}
