:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #fff;
  --line: #d4dbe0;
  --text: #111820;
  --muted: #65727c;
  --teal: #087f73;
  --teal-strong: #05685e;
  --teal-soft: #dcf4f0;
  --red: #b42318;
  --red-soft: #fee4e2;
  --topbar-bg: rgb(255 255 255 / 91%);
  --surface-raised: #fff;
  --shadow: 0 1px 2px rgb(17 24 32 / 6%), 0 22px 60px rgb(17 24 32 / 10%);
  --ring: 0 0 0 3px rgb(8 127 115 / 16%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1113;
  --surface: #181b1f;
  --line: #343a41;
  --text: #e8edf1;
  --muted: #9ca7b1;
  --teal: #38c976;
  --teal-strong: #20a960;
  --teal-soft: #123526;
  --red: #ff6464;
  --red-soft: #3b1d1d;
  --surface-raised: #1d2126;
  --shadow: 0 1px 2px rgb(0 0 0 / 38%), 0 24px 64px rgb(0 0 0 / 28%);
  --ring: 0 0 0 3px rgb(56 201 118 / 18%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #090a0f;
  color: var(--text);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.theme-toggle {
  position: fixed;
  z-index: 2;
  top: 22px;
  right: 24px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(90deg, #111 0 50%, #fff 50% 100%);
  box-shadow: inset 0 0 0 4px var(--surface);
  cursor: pointer;
}

:root[data-theme="dark"] .theme-toggle {
  background: linear-gradient(90deg, #fff 0 50%, #111 50% 100%);
}

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 36px 18px;
  background: transparent;
}

.login-panel {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-top: 3px solid var(--teal);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgb(17 24 32 / 7%), 0 5px 14px rgb(17 24 32 / 10%);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.login-heading {
  margin: 28px 0 22px;
}

.login-heading h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.login-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

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

.login-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.login-field input {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.login-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.login-field input:focus {
  border-color: var(--teal);
  box-shadow: var(--ring);
}

.login-error {
  min-height: 18px;
  margin: -3px 0 0;
  color: var(--red);
  font-size: 12px;
}

.login-submit {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal-strong);
  border-radius: 7px;
  background: linear-gradient(145deg, var(--teal), var(--teal-strong));
  box-shadow: 0 6px 18px rgb(8 127 115 / 22%);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

.login-submit:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgb(8 127 115 / 28%);
  transform: translateY(-1px);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.login-submit:focus-visible,
.theme-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--ring);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.login-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.security-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

@media (max-width: 520px) {
  .theme-toggle {
    top: 14px;
    right: 14px;
  }

  .login-page {
    padding: 70px 12px 24px;
  }

  .login-panel {
    padding: 21px 18px;
  }

  .login-heading h1 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
  }

}
