:root {
  --auth-bg: #0b0d13;
  --auth-card: #15171e;
  --auth-card-2: #15171e;
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-border-soft: rgba(255, 255, 255, 0.04);
  --auth-text: #f1f5f9;
  --auth-muted: #94a3b8;
  --auth-dim: #64748b;
  --auth-danger-bg: rgba(251, 113, 133, 0.12);
  --auth-btn-primary-bg: #f8fafc;
  --auth-btn-primary-text: #0f172a;
  --auth-btn-primary-hover: #e2e8f0;
  --auth-btn-ghost-bg: transparent;
  --auth-btn-ghost-border: rgba(255, 255, 255, 0.15);
  --auth-btn-ghost-text: #f1f5f9;
  --auth-btn-ghost-hover: rgba(255, 255, 255, 0.05);
  --auth-input-bg: #1e2028;
  --auth-input-border: rgba(255, 255, 255, 0.1);
  --auth-radius: 20px;
  --auth-radius-sm: 12px;
  --auth-focus: 0 0 0 2px rgba(255, 255, 255, 0.2);
  color-scheme: dark;
}

html[data-bd-theme="light"] {
  --auth-bg: #f8fafc;
  --auth-card: #ffffff;
  --auth-card-2: #ffffff;
  --auth-border: rgba(15, 23, 42, 0.08);
  --auth-border-soft: rgba(15, 23, 42, 0.04);
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-dim: #94a3b8;
  --auth-danger-bg: rgba(251, 113, 133, 0.14);
  --auth-btn-primary-bg: #0f172a;
  --auth-btn-primary-text: #f8fafc;
  --auth-btn-primary-hover: #1e293b;
  --auth-btn-ghost-bg: transparent;
  --auth-btn-ghost-border: rgba(15, 23, 42, 0.15);
  --auth-btn-ghost-text: #0f172a;
  --auth-btn-ghost-hover: rgba(15, 23, 42, 0.04);
  --auth-input-bg: #f1f5f9;
  --auth-input-border: rgba(15, 23, 42, 0.08);
  --auth-focus: 0 0 0 2px rgba(15, 23, 42, 0.2);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "SF Pro Text", "SF Pro Display", "Inter", sans-serif;
  color: var(--auth-text);
  background: var(--auth-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-bd-theme="light"] body {
  background: var(--auth-bg);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 22px;
}

.auth-top {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.auth-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.auth-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--auth-radius);
  border: 1px solid var(--auth-border);
  background: var(--auth-card);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.auth-header {
  text-align: center;
  padding: 36px 32px 24px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 1px solid var(--auth-border);
  background: var(--auth-input-bg);
  box-shadow: none;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

html[data-bd-theme="light"] .brand-icon {
  border: 1px solid var(--auth-border);
  background: var(--auth-input-bg);
  box-shadow: none;
}

.brand-icon img {
  width: 48px;
  height: 48px;
  display: block;
}

.auth-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin-top: 6px;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--auth-muted);
}

.auth-main {
  padding: 0 32px 36px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-label {
  display: grid;
  gap: 6px;
}

.auth-label > span {
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--auth-radius-sm);
  border: 1px solid var(--auth-input-border);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.auth-input:focus {
  border-color: var(--auth-border);
  box-shadow: var(--auth-focus);
}

.auth-input::placeholder {
  color: var(--auth-dim);
}

.auth-btn {
  border: 1px solid var(--auth-btn-ghost-border);
  background: var(--auth-btn-ghost-bg);
  color: var(--auth-btn-ghost-text);
  border-radius: 999px;
  height: 42px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.auth-btn:hover {
  background: var(--auth-btn-ghost-hover);
}

.auth-btn-primary {
  border: none;
  background: var(--auth-btn-primary-bg);
  color: var(--auth-btn-primary-text);
  box-shadow: none;
}

.auth-btn-primary:hover {
  background: var(--auth-btn-primary-hover);
}

.auth-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.auth-full {
  width: 100%;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-link {
  color: var(--auth-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

html[data-bd-theme="light"] .auth-link {
  color: var(--auth-text);
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-divider {
  position: relative;
  text-align: center;
  color: var(--auth-dim);
  font-size: 12px;
  margin: 2px 0;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid var(--auth-border-soft);
  transform: translateY(-50%);
}

.auth-divider > span {
  position: relative;
  display: inline-block;
  padding: 0 8px;
  background: var(--auth-card);
}

.auth-callout {
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-input-bg);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--auth-muted);
}

.auth-callout-error {
  border-color: rgba(251, 113, 133, 0.35);
  background: var(--auth-danger-bg);
  color: #fecdd3;
}

.auth-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--auth-border-soft);
  font-size: 12px;
  line-height: 1.6;
  color: var(--auth-dim);
}

.auth-theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--auth-btn-ghost-border);
  background: var(--auth-btn-ghost-bg);
  color: var(--auth-btn-ghost-text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-theme-btn:hover {
  background: var(--auth-btn-ghost-hover);
}

.auth-lang-select {
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--auth-btn-ghost-border);
  background: var(--auth-btn-ghost-bg);
  color: var(--auth-btn-ghost-text);
  font-size: 13px;
  padding: 0 12px;
  cursor: pointer;
  outline: none;
  font-weight: 500;
}

.auth-lang-select:hover {
  background: var(--auth-btn-ghost-hover);
}

.auth-lang-select option {
  background: var(--auth-card);
  color: var(--auth-text);
}

.auth-google-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 44px;
  color-scheme: light;
}

.auth-hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .auth-shell {
    align-items: flex-start;
    padding: 20px 14px;
  }

  .auth-title {
    font-size: 24px;
  }
}
