.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  isolation: isolate;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(196, 92, 38, 0.22), transparent 52%),
    radial-gradient(720px 480px at 0% 100%, rgba(28, 107, 104, 0.28), transparent 50%),
    linear-gradient(165deg, #061112 0%, #071617 42%, #0c2425 100%);
}

.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: min(440px, 100%);
  padding: 28px 26px 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 28%),
    #0b1f20;
  color: #eef6f4;
  box-shadow:
    0 0 0 1px rgba(244, 239, 230, 0.08),
    0 28px 80px rgba(0, 0, 0, 0.45);
  animation: auth-in 420ms var(--ease);
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand .mark {
  width: 48px;
  height: 48px;
  font-size: 17px;
}

.auth-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.auth-brand small {
  color: var(--sidebar-muted);
  font-size: 13px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-lead {
  margin: 0 0 22px;
  color: #9db0ad;
  font-size: 14px;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}

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

.auth-btn:hover { transform: translateY(-1px); }

.auth-btn-primary {
  background: linear-gradient(180deg, #d36a2e, var(--clay));
  color: #fff8f3;
  box-shadow: 0 10px 24px rgba(196, 92, 38, 0.32);
}

.auth-btn-primary:hover { background: linear-gradient(180deg, #dc7436, var(--clay-2)); }

.auth-btn-ghost {
  background: rgba(255,255,255,0.04);
  color: #e7f1ef;
  box-shadow: inset 0 0 0 1px rgba(244, 239, 230, 0.12);
}

.auth-btn-ghost:hover { background: rgba(255,255,255,0.07); }

.auth-note {
  margin: 16px 0 0;
  color: #7f9693;
  font-size: 12px;
  text-align: center;
}

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

.auth-field span {
  font-size: 12px;
  font-weight: 700;
  color: #9db0ad;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: #071617;
  color: #f4efe6;
  box-shadow: inset 0 0 0 1px rgba(244, 239, 230, 0.1);
  outline: none;
}

.auth-field input:focus {
  box-shadow: inset 0 0 0 1px rgba(196, 92, 38, 0.55);
}

.auth-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(180, 35, 24, 0.16);
  color: #ffd2cd;
  font-size: 13px;
}

.auth-login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-back {
  color: #9db0ad;
  font-size: 13px;
  font-weight: 600;
}

.auth-back:hover { color: #fff; }

.account-box {
  margin-bottom: 12px;
  padding: 10px 10px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.account-box strong {
  display: block;
  font-size: 13px;
}

.account-box small {
  display: block;
  margin: 2px 0 8px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

body.auth-open #app {
  display: none !important;
}
