html.auth-nav-pending .auth-shell {
  opacity: 0;
  pointer-events: none;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(255, 42, 42, 0.16), transparent 55%),
    radial-gradient(700px 420px at 90% 90%, rgba(184, 15, 26, 0.18), transparent 50%),
    linear-gradient(180deg, #070305, #0c0608 60%, #050203);
}
.auth-bg .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,42,42,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,42,42,0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  animation: gridDrift 18s linear infinite;
}
@keyframes gridDrift {
  from { transform: translateY(0); }
  to { transform: translateY(56px); }
}

#hexCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.auth-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.auth-brand {
  padding: 18px 8px 8px;
  animation: fadeUp 0.7s ease both;
}
.logo-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: linear-gradient(160deg, #2a0c10, #120608);
  border: 1px solid var(--line-strong);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  box-shadow: 0 0 28px var(--red-glow);
  animation: pulseGlow 3.2s ease-in-out infinite;
}
.logo-mark svg { width: 30px; height: 30px; color: var(--red-hot); }
.brand-logo {
  display: block;
  width: min(440px, 100%);
  height: auto;
  margin: 0 0 18px;
  filter: drop-shadow(0 0 28px rgba(255, 42, 42, 0.38));
}
.brand-kicker {
  color: var(--red-hot);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.auth-brand h1 {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.92;
  letter-spacing: 0.04em;
}
.auth-brand h1 span { color: var(--red); text-shadow: 0 0 24px var(--red-glow); }
.auth-brand p {
  margin-top: 18px;
  max-width: 420px;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.45;
}
.auth-card {
  padding: 28px 26px 24px;
  animation: fadeUp 0.7s 0.1s ease both;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 42, 42, 0.08);
}
.auth-card h2 {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.08em;
  margin: 6px 0 6px;
}
.auth-card .sub { color: var(--muted); margin-bottom: 22px; }
.auth-form { display: grid; gap: 14px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.auth-meta a { color: var(--red-hot); }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check input { accent-color: var(--red); }
.switch-auth {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
}
.switch-auth a { color: #fff; border-bottom: 1px solid var(--red); }
.auth-error {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid var(--line-strong);
  color: var(--red-hot);
  font-weight: 700;
}
.auth-error.show { display: block; animation: fadeUp 0.25s ease; }

@media (min-width: 881px) {
  body.auth-register .auth-shell {
    align-items: start;
    padding-top: 24px;
  }
  body.auth-register .auth-card {
    max-height: min(720px, calc(100vh - 48px));
    overflow-y: auto;
  }
}

.auth-route-loader {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  background: rgba(5, 3, 5, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.auth-route-loader.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.auth-route-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
}
.auth-route-loader[hidden] { display: none !important; }
.auth-route-loader:not([hidden]) { display: grid; }

.auth-route-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: authLoaderIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes authLoaderIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-route-loader__stage {
  position: relative;
  width: clamp(112px, 28vw, 148px);
  height: clamp(112px, 28vw, 148px);
  display: grid;
  place-items: center;
}
.auth-route-loader__logo {
  width: 58%;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 22px rgba(255, 42, 42, 0.55));
  animation: authLoaderLogoPulse 1.6s ease-in-out infinite;
}
@keyframes authLoaderLogoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.92; }
}

.auth-route-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(184, 15, 26, 0.35);
  border-top-color: var(--red);
  border-right-color: rgba(255, 77, 77, 0.85);
  box-shadow: 0 0 28px rgba(255, 42, 42, 0.25), inset 0 0 18px rgba(255, 42, 42, 0.08);
  animation: authLoaderSpin 0.95s linear infinite;
}
.auth-route-loader__ring--inner {
  inset: 12%;
  border-width: 2px;
  border-top-color: var(--red-deep);
  border-right-color: var(--red-hot);
  animation-duration: 1.35s;
  animation-direction: reverse;
  opacity: 0.9;
}
@keyframes authLoaderSpin {
  to { transform: rotate(360deg); }
}

.auth-route-loader__label {
  font-family: var(--display);
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 800;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--red);
  text-shadow: 0 0 20px var(--red-glow);
  animation: authLoaderText 1.1s ease-in-out infinite;
}
@keyframes authLoaderText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

body.auth-nav-lock {
  overflow: hidden;
  touch-action: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-route-loader__ring { animation-duration: 1.8s; }
  .auth-route-loader__logo { animation: none; }
  .auth-route-loader__label { animation: none; }
  .auth-route-loader__inner { animation: none; }
}

@media (max-width: 880px) {
  .auth-body {
    padding: 18px 12px calc(28px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .auth-shell { width: 100%; max-width: 100%; }
  .auth-shell { grid-template-columns: 1fr; gap: 16px; }
  .auth-brand { text-align: center; padding: 8px 0 0; }
  .auth-brand h1 { font-size: clamp(28px, 9vw, 42px); }
  .auth-brand p { margin-inline: auto; font-size: 16px; }
  .logo-mark, .brand-logo { margin-inline: auto; }
  .brand-logo { width: min(260px, 72vw); }
  .auth-card { padding: 20px 16px 18px; }
  .auth-row { grid-template-columns: 1fr; }
  .auth-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
}
