.auth-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background:
    radial-gradient(1200px 800px at 70% 30%, rgba(7, 56, 57, .4), transparent 60%),
    radial-gradient(900px 600px at 20% 80%, rgba(242, 196, 129, .12), transparent 55%),
    var(--color-neutral);
  position: relative;
  overflow: hidden;
}

.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--color-border);
}
.auth-art img {
  width: 86%;
  max-width: 720px;
  filter: drop-shadow(0 0 60px rgba(255, 209, 102, .16));
  animation: art-float 7s ease-in-out infinite;
}
@keyframes art-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-xxl) var(--sp-xl);
  gap: var(--sp-md);
  position: relative;
  z-index: 2;
}
.auth-logo {
  width: min(260px, 75%);
  align-self: flex-start;
  filter: drop-shadow(0 4px 16px rgba(255, 209, 102, 0.18));
}
.auth-tag {
  color: var(--color-tertiary);
  font: var(--text-body-lg);
  font-weight: 700;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  height: 42px;
  min-height: 42px;
  border-radius: var(--r-md);
  font: var(--text-label-md);
  font-weight: 900;
  color: var(--color-tertiary);
  transition: all 140ms ease;
}
.auth-tab:active { transform: scale(0.97); }
.auth-tab.active {
  background: var(--color-secondary);
  color: var(--color-on-surface);
  border: 1px solid rgba(197, 164, 93, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
/* step 2 of the password reset is its own flex column: without this the code
   and password fields sit flush against each other */
#rs-step2 { display: flex; flex-direction: column; gap: 14px; margin-top: 2px; }
.auth-form .btn {
  min-height: 48px;
  height: 48px;
  font-size: 15px;
  margin-top: 6px;
}
.auth-hint {
  font: var(--text-body-sm);
  font-weight: 700;
  color: var(--color-tertiary);
  text-align: center;
}
.auth-hint b { color: var(--color-accent); }

/* Sign-up consent row + the "already have an account?" switch. */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font: var(--text-body-sm);
  font-weight: 600;
  color: var(--color-tertiary);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}
.auth-terms input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  accent-color: var(--color-accent);
  cursor: pointer;
}
.auth-terms b { color: var(--color-accent); font-weight: 800; }
.auth-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--color-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Mobile refinement */
@media (max-width: 900px) {
  .auth-stage {
    grid-template-columns: 1fr;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
    background:
      radial-gradient(600px 400px at 50% 15%, rgba(7, 56, 57, 0.45), transparent 70%),
      radial-gradient(500px 300px at 80% 80%, rgba(242, 196, 129, 0.12), transparent 60%),
      var(--color-neutral);
  }
  .auth-art { display: none; }
  .auth-panel {
    width: 100%;
    max-width: 400px;
    padding: 24px 20px;
    background: rgba(18, 20, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: var(--r-xl);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    gap: 14px;
  }
  .auth-logo {
    align-self: center;
    width: 200px;
  }
  .auth-tag {
    text-align: center;
    font-size: 14px;
  }
}

/* Telegram Mini App auto-login state (driven by telegramAutoLogin in auth.js) */
.auth-tg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 0 10px;
  font: var(--text-body, 14px/1.5 sans-serif);
  font-weight: 700;
  color: var(--color-tertiary);
  text-align: center;
}
.auth-tg-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  animation: auth-tg-spin 0.9s linear infinite;
}
@keyframes auth-tg-spin { to { transform: rotate(360deg); } }
