:root {
  --auth-bg: #eef2f5;
  --auth-surface: #ffffff;
  --auth-ink: #172033;
  --auth-muted: #667386;
  --auth-line: #d4dde7;
  --auth-blue: #1f5fd1;
  --auth-blue-dark: #174aa6;
  --auth-cyan: #0e8da8;
  --auth-green: #11845b;
  --auth-error: #b42318;
  --auth-font: "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

.auth-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background: var(--auth-bg);
  font-family: var(--auth-font);
  letter-spacing: 0;
}

.auth-page::before {
  position: fixed;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--auth-blue);
  content: "";
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  place-items: center;
}

.auth-panel {
  width: min(100%, 404px);
  padding: 30px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: var(--auth-surface);
  box-shadow: 0 18px 46px rgba(23, 32, 51, 0.1);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8edf2;
}

.auth-brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid #bfd2f5;
  border-radius: 7px;
  color: var(--auth-blue);
  background: #f4f8ff;
  place-items: center;
}

.auth-brand-mark svg {
  width: 23px;
  height: 23px;
}

.auth-brand-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.auth-brand-subtitle {
  margin-top: 2px;
  color: var(--auth-green);
  font-size: 12px;
  font-weight: 700;
}

.auth-heading {
  padding: 24px 0 18px;
}

.auth-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

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

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

.auth-field label {
  color: #39465a;
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #bdc9d8;
  border-radius: 6px;
  outline: none;
  color: var(--auth-ink);
  background: #ffffff;
  font: 600 16px/1 var(--auth-font);
  letter-spacing: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-field input:focus {
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 209, 0.13);
}

.auth-password-toggle {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.auth-password-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--auth-blue);
}

.auth-error {
  min-height: 20px;
  margin: -2px 0 0;
  color: var(--auth-error);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-error-placeholder {
  visibility: hidden;
}

.auth-submit {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--auth-blue);
  cursor: pointer;
  font: 800 15px/1 var(--auth-font);
  letter-spacing: 0;
  transition: background-color 150ms ease, transform 150ms ease;
}

.auth-submit svg {
  width: 18px;
  height: 18px;
}

.auth-submit:hover {
  background: var(--auth-blue-dark);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:focus-visible,
.auth-logout button:focus-visible {
  outline: 3px solid rgba(14, 141, 168, 0.35);
  outline-offset: 2px;
}

.auth-logout {
  position: fixed;
  z-index: 2147483000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0;
}

.auth-logout button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(101, 114, 135, 0.35);
  border-radius: 6px;
  color: #435066;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(23, 32, 51, 0.14);
  cursor: pointer;
  place-items: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.auth-logout button:hover {
  color: var(--auth-blue);
  border-color: rgba(31, 95, 209, 0.45);
}

.auth-logout svg {
  width: 19px;
  height: 19px;
}

.auth-logout.auth-logout-inline {
  position: static;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}

.auth-logout-inline button {
  width: 36px;
  height: 36px;
  box-shadow: none;
}

.reference-top .auth-logout-inline {
  margin-left: 0;
}

@media (max-width: 480px) {
  .auth-page::before {
    inset: 0 0 auto;
    width: 100%;
    height: 6px;
  }

  .auth-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

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

  .auth-brand-name {
    font-size: 16px;
  }

  .auth-heading h1 {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-field input,
  .auth-submit {
    transition: none;
  }
}
