:root {
  color-scheme: light;
  --paper: #fffaf4;
  --soft: #f7f8f1;
  --panel: rgba(255, 255, 255, 0.84);
  --line: #eadfd3;
  --text: #211b16;
  --muted: #6f6258;
  --muted-2: #9b8d82;
  --blue: #6d3fd1;
  --green: #26724e;
  --amber: #b87900;
  --red: #c43f35;
  --accent: #ff5a2c;
  --shadow: 0 18px 48px rgba(38, 48, 41, 0.08);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, #eefaf0, transparent 28%),
    radial-gradient(circle at 86% 10%, #efe8ff, transparent 26%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(109, 63, 209, 0.16);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.admin-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 32px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.72);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.auth-brand span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: url("../assets/avatars/bird-logo.svg") center / contain no-repeat;
  box-shadow: 0 0 0 1px rgba(33, 27, 22, 0.08), 0 10px 20px rgba(33, 27, 22, 0.10);
}

.auth-brand strong {
  font-size: 18px;
  line-height: 1;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-side-copy {
  max-width: 520px;
}

.auth-side-copy h1 {
  margin: 12px 0 0;
  font-size: clamp(38px, 5vw, 70px);
  line-height: 0.98;
  letter-spacing: 0;
}

.auth-side-copy p:not(.eyebrow) {
  max-width: 34rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.security-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.security-strip div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.security-strip span {
  display: block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.security-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.2;
}

.security-strip em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.auth-panel {
  width: min(100%, 760px);
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 14px;
  padding: 32px;
}

.auth-card,
.auth-audit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card {
  overflow: hidden;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 241, 0.48);
}

.auth-tabs button,
.text-button,
.auth-card-head a,
.code-row button,
.captcha-code,
.sso-button,
.submit-button {
  appearance: none;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-tabs button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.auth-tabs button.is-active {
  border-color: rgba(109, 63, 209, 0.24);
  background: rgba(109, 63, 209, 0.1);
  color: var(--blue);
}

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

.auth-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.auth-card-head h2 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.auth-card-head a,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.field,
.captcha-field {
  display: grid;
  gap: 7px;
}

.field span,
.captcha-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.captcha-row input,
.code-row input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: rgba(255, 250, 244, 0.82);
  color: var(--text);
  outline: 0;
}

.field textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
  line-height: 1.5;
}

.field select {
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.captcha-row input:focus,
.code-row input:focus {
  border-color: rgba(109, 63, 209, 0.36);
  box-shadow: 0 0 0 3px rgba(109, 63, 209, 0.08);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.factor-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(247, 248, 241, 0.46);
}

.factor-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.factor-heading span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.factor-heading p,
.helper-text {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.factor-heading strong {
  flex: 0 0 auto;
  border: 1px solid rgba(38, 114, 78, 0.2);
  border-radius: 7px;
  padding: 7px 9px;
  background: rgba(38, 114, 78, 0.08);
  color: var(--green);
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
}

.factor-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.factor-option {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  background: rgba(255, 250, 244, 0.78);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.factor-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.factor-option span {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.factor-option em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.factor-option:hover,
.factor-option:has(input:focus-visible) {
  border-color: rgba(109, 63, 209, 0.24);
  background: rgba(109, 63, 209, 0.06);
}

.factor-option.is-active {
  border-color: rgba(109, 63, 209, 0.32);
  background: rgba(109, 63, 209, 0.1);
  box-shadow: 0 0 0 1px rgba(109, 63, 209, 0.08) inset;
}

.factor-panel {
  display: grid;
  gap: 7px;
}

.captcha-row,
.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 8px;
}

.captcha-code {
  min-height: 40px;
  border-color: rgba(109, 63, 209, 0.22);
  background:
    linear-gradient(135deg, rgba(109, 63, 209, 0.12), rgba(255, 90, 44, 0.08)),
    rgba(255, 255, 255, 0.92);
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.code-row button {
  min-height: 40px;
  color: var(--blue);
}

.sso-button {
  min-height: 40px;
  color: var(--blue);
}

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

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.check-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.submit-button {
  min-height: 42px;
  border-color: transparent;
  background: var(--accent);
  color: #fffaf4;
  font-size: 13px;
}

.submit-button:hover {
  background: #e94f28;
}

.auth-tabs button:hover,
.text-button:hover,
.auth-card-head a:hover,
.code-row button:hover,
.captcha-code:hover,
.sso-button:hover {
  border-color: rgba(109, 63, 209, 0.24);
  background: rgba(109, 63, 209, 0.08);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-status.is-error {
  color: var(--red);
}

.form-status.is-success {
  color: var(--green);
}

.auth-audit-card {
  padding: 16px;
}

.auth-audit-card strong {
  font-size: 13px;
}

.auth-audit-card ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-mini-legal {
  padding: 0 24px 18px;
  text-align: center;
}

.auth-mini-legal a {
  color: rgba(33, 27, 22, 0.48);
  font-size: 11px;
  font-weight: 680;
  text-decoration: none;
  transition: color 0.18s ease;
}

.auth-mini-legal a:hover {
  color: var(--purple);
}

@media (max-width: 980px) {
  .admin-auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side {
    min-height: auto;
    gap: 32px;
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-side-copy h1 {
    font-size: 42px;
  }

  .auth-panel {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .auth-side,
  .auth-panel {
    padding: 18px;
  }

  .security-strip,
  .factor-picker,
  .field-grid,
  .captcha-row,
  .code-row {
    grid-template-columns: 1fr;
  }

  .factor-heading {
    flex-direction: column;
  }

  .auth-form {
    padding: 18px;
  }

  .auth-card-head,
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-card-head a,
  .text-button {
    width: 100%;
  }
}
