.modern-auth {
  --auth-bg: #09090b;
  --auth-muted: #a1a1aa;
  --auth-light: 180, 185, 200;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background: var(--auth-bg);
  color: #f4f4f5;
}

[data-theme="comet"] .modern-auth {
  --auth-bg: #0b101b;
  --auth-muted: #a4adbd;
  --auth-light: 120, 155, 210;
}

.modern-auth #particles-js {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .7;
}

.modern-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, rgba(var(--auth-light), .13), transparent 66%);
  animation: auth-drift 18s ease-in-out infinite alternate;
}

.modern-auth .auth-toolbar {
  position: absolute;
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3vw, 32px);
  z-index: 3;
}

.modern-auth .auth-theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--auth-light), .15);
  border-radius: 12px;
  background: rgba(var(--auth-light), .05);
  color: var(--auth-muted);
  font-size: 20px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.modern-auth .auth-theme-toggle:hover,
.modern-auth .auth-theme-toggle[aria-expanded="true"] {
  background: rgba(var(--auth-light), .12);
  color: #fff;
  transform: translateY(-1px);
}

.modern-auth .auth-theme-menu {
  min-width: 150px;
  margin-top: 8px !important;
  padding: 6px;
  border: 1px solid rgba(var(--auth-light), .15) !important;
  border-radius: 12px !important;
  background: rgba(9, 9, 11, .94) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .4);
}

.modern-auth .theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}

.modern-auth .theme-option:hover,
.modern-auth .theme-option.active {
  background: rgba(var(--auth-light), .1);
  color: #fff;
}

.modern-auth .theme-check {
  margin-left: auto;
  opacity: 0;
}

.modern-auth .theme-option.active .theme-check {
  opacity: 1;
}

.modern-auth .auth-center {
  width: min(460px, calc(100% - 32px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 72px 0;
}

.modern-auth .auth-card {
  width: 100%;
  padding: clamp(26px, 5vw, 42px) clamp(18px, 4vw, 36px);
  text-align: center;
  animation: auth-rise .8s cubic-bezier(.22, 1, .36, 1) both, auth-float 8s 1s ease-in-out infinite;
}

.modern-auth .auth-brand {
  position: relative;
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 600;
  letter-spacing: clamp(3px, .6vw, 6px);
  line-height: 1.2;
  text-shadow: 0 0 26px rgba(var(--auth-light), .12);
}

.modern-auth .auth-brand span {
  display: inline-block;
  animation: auth-title 7s ease-in-out infinite;
}

.modern-auth .auth-tagline {
  max-width: 350px;
  margin: 14px auto 0;
  color: var(--auth-muted);
  font-size: clamp(11px, 1.3vw, 13px);
  line-height: 1.6;
  opacity: .84;
}

.modern-auth .auth-rule {
  width: clamp(80px, 22vw, 150px);
  height: 1px;
  margin: 22px auto 28px;
  background: linear-gradient(90deg, transparent, rgba(var(--auth-light), .6), transparent);
  animation: auth-pulse 5s ease-in-out infinite;
}

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

.modern-auth .auth-button {
  min-height: clamp(44px, 5vw, 52px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  color: #fff;
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.modern-auth .auth-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
}

.modern-auth .auth-button.discord { background: #5865f2; }
.modern-auth .auth-button.telegram { background: #229ed9; }
.modern-auth .auth-button iconify-icon { font-size: 19px; }

.modern-auth .auth-recovery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--auth-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color .2s ease;
}

.modern-auth .auth-recovery:hover { color: #fff; }

.modern-auth .auth-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(var(--auth-light), .14);
}

.modern-auth .auth-stat strong {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.modern-auth .auth-stat span,
.modern-auth .auth-footer {
  color: var(--auth-muted);
  font-size: 11px;
  letter-spacing: .3px;
}

.modern-auth .auth-footer {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
}

.modern-auth .invite-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px auto 0;
  padding: 14px;
  border: 1px solid rgba(var(--auth-light), .12);
  border-radius: 14px;
  text-align: left;
  background: rgba(var(--auth-light), .035);
}

.modern-auth .server-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 14px;
  object-fit: cover;
}

.modern-auth .server-info { min-width: 0; }
.modern-auth .server-title { display: flex; gap: 8px; align-items: center; text-decoration: none; }
.modern-auth .server-name { overflow: hidden; color: #fff; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.modern-auth .server-channel { color: var(--auth-muted); font-size: 12px; }
.modern-auth .server-stats { display: flex; gap: 12px; margin-top: 7px; color: var(--auth-muted); font-size: 11px; }
.modern-auth .dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #777; }
.modern-auth .dot.online { background: #44b37f; }

.modern-auth .token-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.modern-auth .token-input {
  min-height: 50px;
  border: 1px solid rgba(var(--auth-light), .16);
  border-radius: 11px;
  background: rgba(var(--auth-light), .05);
  color: #fff;
  text-align: center;
}

.modern-auth .token-input::placeholder { color: var(--auth-muted); }
.modern-auth .token-input:focus { border-color: rgba(var(--auth-light), .45); box-shadow: 0 0 0 3px rgba(var(--auth-light), .08); }
.modern-auth .token-submit { width: 100%; background: rgba(var(--auth-light), .16); }

@keyframes auth-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-float { 0%, 100% { translate: 0 3px; } 50% { translate: 0 -6px; } }
@keyframes auth-drift { from { transform: scale(.96); opacity: .7; } to { transform: scale(1.06); opacity: 1; } }
@keyframes auth-title { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }
@keyframes auth-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

@media (max-width: 520px) {
  .modern-auth .auth-center { width: min(100% - 24px, 440px); padding-top: 76px; }
  .modern-auth .auth-toolbar { top: 14px; right: 14px; }
  .modern-auth .auth-button { min-height: 48px; }
  .modern-auth .invite-card { padding: 12px; }
  .modern-auth .server-stats { flex-direction: column; gap: 3px; }
}
