.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  background-color: var(--c-popup-bg);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--c-border);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-brand);
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--c-base-subtitle-text);
  font-size: 0.9375rem;
}

.login-form {
  display: flex;
  flex-direction: column;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-link {
  color: var(--c-brand);
  font-size: 0.875rem;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.hot-login-email {
  padding: 0.75rem 1rem;
  background-color: var(--c-border);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  color: var(--c-base-text);
  margin-bottom: 1.25rem;
  text-align: center;
}

/* --- background pattern ---------------------------------------------------
   Rows of the product name, drifting slowly behind the card. Decorative: the
   markup is aria-hidden, and nothing here carries meaning. Kept faint enough
   that it reads as texture rather than content — at 0.04 opacity the brand blue
   is a tint, not text you catch yourself reading. */

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.login-bg__row {
  display: flex;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: clamp(2.75rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--c-brand);
  opacity: 0.045;
  will-change: transform;
  animation: login-drift 90s linear infinite;
}

.login-bg__row span {
  padding-right: 0.35em;
}

/* Alternate direction and vary the pace so the rows never lock into a single
   sliding block, which reads as a glitch rather than movement. */
.login-bg__row:nth-child(even) {
  animation-direction: reverse;
  opacity: 0.03;
}

.login-bg__row:nth-child(3n) { animation-duration: 120s; }
.login-bg__row:nth-child(4n) { animation-duration: 75s; }

@keyframes login-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Motion is decoration here, so it is the first thing to drop. */
@media (prefers-reduced-motion: reduce) {
  .login-bg__row { animation: none; }
}

/* --- card and methods ----------------------------------------------------- */

/* Above the pattern, and opaque so the drifting text never shows through the
   card and competes with the buttons. */
.login-card {
  position: relative;
  z-index: 1;
}

.login-methods {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* button_to wraps each button in its own form; without this they collapse to
   content width instead of filling the card. */
.login-method,
.login-method .base-button {
  width: 100%;
}

/* Shown only after a refused sign-in: the explanation and the way out. Separated by a
   rule so it reads as a secondary option rather than a second thing to try first. */
.login-escape {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-border);
}

.login-escape p {
  margin: 0 0 0.75rem;
  color: var(--c-base-subtitle-text);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.login-escape form,
.login-escape .base-button {
  width: 100%;
}

/* Body copy inside the auth card. Previously inline hex on each page, which drifted
   from the palette; these follow the tokens like everything else. */
.login-body {
  margin: 0;
  color: var(--c-base-text);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.login-hint {
  margin: 0 0 1rem;
  color: var(--c-base-subtitle-text);
  font-size: 0.875rem;
}

/* Logo beside a method's label. Sized to the text rather than fixed, so a mark swapped
   for a different aspect ratio does not need the CSS revisited. */
.login-method .base-button {
  gap: 0.5rem;
}

/* Wraps the inlined SVG; the svg itself is sized, so a mark with a different aspect
   ratio needs no CSS change. */
.login-method__logo {
  display: inline-flex;
  flex: 0 0 auto;
}

.login-method__logo svg {
  height: 1.2em;
  width: auto;
  display: block;
}

/* Development-only "sign in as" panel (sessions/_dev_login); never rendered elsewhere */
.dev-login {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.dev-login__note {
  font-size: 0.8125rem;
  color: var(--c-base-subtitle-text);
  margin: 0 0 0.25rem;
}

.dev-login__list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 20rem;
  overflow-y: auto;
}

.dev-login__user {
  margin: 0;
}

.dev-login__user .base-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.dev-login__meta {
  font-size: 0.8125rem;
  color: var(--c-base-subtitle-text);
  white-space: nowrap;
}
