.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.045), transparent 31%),
    #0a0a0a;
  overflow: hidden;
}

.auth-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
}

.auth-gate::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.auth-gate[hidden] {
  display: none !important;
}

body.auth-pending {
  overflow: hidden;
  background: #0a0a0a;
}

body.auth-pending .sidebar,
body.auth-pending .page {
  visibility: hidden;
}

.auth-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  width: min(420px, 100%);
  min-height: 532px;
  padding: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background:
    radial-gradient(circle at 58% 9%, rgba(255, 255, 255, 0.12), transparent 3%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 35%),
    rgba(17, 17, 17, 0.9);
  box-shadow: 0 0 32px rgba(255, 255, 255, 0.05), 0 22px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
}

.auth-panel:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.auth-panel::before,
.auth-panel::after {
  content: "";
  position: absolute;
  top: 24px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.auth-panel::before {
  right: 48px;
}

.auth-panel::after {
  right: 24px;
  background: #11d98d;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #f8fafc;
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 34px;
}

.auth-panel h1 {
  margin-bottom: 14px;
  color: #f8fafc;
  font-size: 30px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
}

.auth-gradient-text {
  color: transparent;
  background: linear-gradient(135deg, #fff 0%, #a0a0a0 50%, #fff 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.auth-panel p {
  max-width: 280px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

.auth-google-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  width: 100%;
  min-height: 56px;
  margin-top: 44px;
  padding: 0 24px;
  border: 1px solid #fff;
  border-radius: 12px;
  color: #111827;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
  transition: box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.auth-google-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  opacity: 0;
  transform: translateX(-100%);
}

.auth-google-button:hover,
.auth-google-button:focus-visible {
  border-color: #fff;
  background: #f1f5f9;
  box-shadow: 0 14px 34px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  outline: 0;
}

.auth-google-button:hover::before,
.auth-google-button:focus-visible::before {
  opacity: 1;
  animation: auth-shimmer 1.35s ease;
}

.auth-google-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: transparent;
}

.auth-google-icon svg {
  width: 21px;
  height: 21px;
  stroke: none;
}

.auth-terms {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.auth-terms a {
  color: rgba(255, 255, 255, 0.52);
  text-underline-offset: 3px;
}

.auth-terms a:hover,
.auth-terms a:focus-visible {
  color: #fff;
  outline: 0;
}

@keyframes auth-shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.auth-message {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 40%, var(--line));
  border-radius: 8px;
  color: var(--red) !important;
  background: color-mix(in srgb, var(--red) 10%, transparent);
}

.auth-user-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.auth-user-button[hidden] {
  display: none !important;
}

.auth-user-button:hover,
.auth-user-button:focus-visible,
.auth-user-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--soft) 64%, transparent);
  outline: 0;
}

.auth-user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 999px;
  color: white;
  background: #c2410c;
  font-size: 14px;
  font-weight: 900;
}

.auth-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-user-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 120;
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg));
  box-shadow: var(--shadow);
}

.auth-account-menu[hidden] {
  display: none !important;
}

.auth-account-head {
  min-width: 0;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.auth-account-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 999px;
  color: white;
  background: #c2410c;
  font-weight: 900;
}

.auth-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-account-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.auth-account-copy strong,
.auth-account-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-account-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
}

.auth-account-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.auth-logout-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.auth-logout-button svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.auth-logout-button:hover,
.auth-logout-button:focus-visible {
  border-color: var(--line);
  background: var(--soft);
  outline: 0;
}

body.auth-locked {
  overflow: hidden;
}
