/* Sign-in and sign-up pages: /login, /signup, /signup/verify.
 *
 * Dark theme on top of theme-dark.css (`.user-body--dark`), with the public
 * header and footer from site.css. The stage is a slow aurora of brand gold,
 * blue and violet light over a faint grid; the form sits on a frosted glass
 * card whose edge carries a slowly turning gradient. A brand panel beside the
 * card (above it on phones) says what the page is for.
 *
 * Motion: aurora drift, the turning card edge, a staggered rise of the page
 * on load, a shimmer across the main button and focus glows. Only transform
 * and opacity are animated, and everything stops under
 * prefers-reduced-motion. Sizes are fluid (clamp) from phones to large
 * monitors.
 */

.auth-body {
  --auth-bg: #07080b;
  /* Nearly opaque, so the turning edge light never shows through the form. */
  --auth-card: rgba(17, 18, 24, 0.95);
  --auth-card-solid: #121319;
  --auth-field: rgba(255, 255, 255, 0.04);
  --auth-field-hover: rgba(255, 255, 255, 0.07);
  --auth-line: rgba(255, 255, 255, 0.1);
  --auth-line-strong: rgba(255, 255, 255, 0.2);
  --auth-text: #f4f5f8;
  --auth-muted: #a6a8b6;
  --auth-subtle: #7c7f8e;
  --auth-gold: var(--color-brand);
  --auth-gold-strong: #ffd84d;
  --auth-gold-soft: rgba(235, 196, 42, 0.14);
  --auth-gold-glow: rgba(235, 196, 42, 0.35);
  --auth-error: #ff8a8a;
  --auth-error-soft: rgba(255, 128, 128, 0.12);
  --auth-success: #5ee0a0;

  --auth-radius: clamp(18px, 1rem + 0.5vw, 28px);
  --auth-radius-sm: clamp(10px, 0.55rem + 0.2vw, 14px);
  --auth-control: clamp(48px, 2.6rem + 0.5vw, 58px);
  --auth-fs-body: clamp(0.9375rem, 0.85rem + 0.2vw, 1.0625rem);
  --auth-fs-small: clamp(0.8125rem, 0.75rem + 0.15vw, 0.9375rem);
  --auth-fs-title: clamp(1.625rem, 1.2rem + 1.2vw, 2.25rem);
  --auth-fs-hero: clamp(2rem, 1.1rem + 3vw, 4rem);
  --auth-gap: clamp(1rem, 0.6rem + 1vw, 1.5rem);
  --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);

  background-color: var(--auth-bg);
  color: var(--auth-text);
  font-size: var(--auth-fs-body);
}

/* ------------------------------------------------------------- Stage */

.auth-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--site-header-height));
  min-height: calc(100dvh - var(--site-header-height));
  padding: clamp(1.5rem, 1rem + 3vw, 5rem) var(--site-header-gutter);
  overflow: hidden;
}

.auth-stage__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.auth-aurora {
  position: absolute;
  width: clamp(28rem, 55vw, 70rem);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.9;
  will-change: transform;
}

.auth-aurora--gold {
  top: -38%;
  left: -16%;
  background: radial-gradient(circle, rgba(235, 196, 42, 0.26), transparent 62%);
  animation: auth-drift-a 22s ease-in-out infinite alternate;
}

.auth-aurora--blue {
  right: -22%;
  bottom: -45%;
  background: radial-gradient(circle, rgba(88, 132, 255, 0.24), transparent 62%);
  animation: auth-drift-b 26s ease-in-out infinite alternate;
}

.auth-aurora--violet {
  top: 20%;
  left: 38%;
  width: clamp(18rem, 32vw, 42rem);
  background: radial-gradient(circle, rgba(168, 102, 255, 0.16), transparent 64%);
  animation: auth-drift-c 30s ease-in-out infinite alternate;
}

@keyframes auth-drift-a {
  to { transform: translate3d(12%, 10%, 0) scale(1.12); }
}

@keyframes auth-drift-b {
  to { transform: translate3d(-14%, -8%, 0) scale(0.92); }
}

@keyframes auth-drift-c {
  to { transform: translate3d(-30%, 18%, 0) scale(1.18); }
}

.auth-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: clamp(36px, 2rem + 1vw, 56px) clamp(36px, 2rem + 1vw, 56px);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}

/* ------------------------------------------------------------- Layout */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 1rem + 2vw, 4rem);
  width: 100%;
  max-width: clamp(26rem, 24rem + 10vw, 32rem);
}

@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, clamp(26rem, 22rem + 8vw, 32rem));
    max-width: clamp(64rem, 50rem + 20vw, 84rem);
  }

  .auth-shell--wide {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, clamp(36rem, 30rem + 12vw, 46rem));
  }
}

.auth-shell--wide {
  max-width: clamp(26rem, 20rem + 30vw, 46rem);
}

@media (min-width: 1024px) {
  .auth-shell--wide {
    align-items: start;
    max-width: clamp(70rem, 56rem + 20vw, 92rem);
  }

  /* Beside a tall form the brand panel stays in view while scrolling. */
  .auth-shell--wide .auth-pitch {
    position: sticky;
    top: calc(var(--site-header-height) + clamp(2rem, 1rem + 3vw, 5rem));
  }
}

/* --------------------------------------------------------- Brand panel */

.auth-pitch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.6rem, 0.4rem + 0.5vw, 1rem);
  animation: auth-rise 800ms var(--auth-ease) both;
}

.auth-pitch__mark {
  display: inline-grid;
  place-items: center;
  width: clamp(3.25rem, 2.6rem + 1.6vw, 4.75rem);
  aspect-ratio: 1;
  margin-bottom: 0.25rem;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius-sm);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  box-shadow: 0 10px 40px -12px var(--auth-gold-glow);
}

.auth-pitch__cube {
  width: 58%;
  height: 58%;
  animation: auth-float 6s ease-in-out infinite;
}

@keyframes auth-float {
  50% { transform: translateY(-4px) rotate(-4deg); }
}

.auth-pitch__kicker {
  color: var(--auth-gold);
  font-size: var(--auth-fs-small);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-pitch__heading {
  max-width: 14ch;
  font-family: var(--font-brand);
  font-size: var(--auth-fs-hero);
  font-weight: var(--font-weight-brand);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.auth-gradient-text {
  background-image: linear-gradient(100deg, var(--auth-gold-strong), var(--auth-gold) 45%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-pitch__lead {
  max-width: 34em;
  color: var(--auth-muted);
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
  line-height: 1.6;
}

.auth-pitch__points {
  display: none;
  margin: clamp(0.5rem, 0.3rem + 0.6vw, 1.25rem) 0 0;
  padding: 0;
  list-style: none;
}

.auth-pitch__point {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.55em 0;
  color: var(--auth-muted);
  font-size: var(--auth-fs-small);
}

.auth-pitch__point-icon {
  flex: 0 0 auto;
  width: 2.1em;
  height: 2.1em;
  padding: 0.45em;
  border: 1px solid var(--auth-line);
  border-radius: 50%;
  background-color: var(--auth-gold-soft);
  color: var(--auth-gold);
}

@media (min-width: 1024px) {
  .auth-pitch__points {
    display: block;
  }
}

/* On phones the brand panel is a compact heading above the card. */
@media (max-width: 1023.98px) {
  .auth-pitch {
    align-items: center;
    text-align: center;
  }

  .auth-pitch__heading {
    max-width: none;
    font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  }

  .auth-pitch__lead {
    font-size: var(--auth-fs-small);
  }
}

/* ---------------------------------------------------------------- Card */

.auth-card {
  position: relative;
  border-radius: var(--auth-radius);
  padding: 1px;
  overflow: hidden;
  background: var(--auth-line);
  box-shadow:
    0 40px 80px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: auth-rise 800ms 120ms var(--auth-ease) both;
}

/* The turning gradient that lights the card's edge. */
.auth-card__glow {
  position: absolute;
  inset: -60%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(235, 196, 42, 0.85) 40deg,
    transparent 95deg,
    transparent 190deg,
    rgba(108, 140, 255, 0.7) 230deg,
    transparent 290deg
  );
  animation: auth-spin 9s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(1turn); }
}

.auth-card__body {
  position: relative;
  padding: clamp(1.4rem, 1rem + 1.6vw, 2.75rem);
  border-radius: calc(var(--auth-radius) - 1px);
  background-color: var(--auth-card-solid);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .auth-card__body {
    background-color: var(--auth-card);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
  }
}

.auth-card__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: var(--auth-gap);
}

.auth-card__badge {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.35rem;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--auth-gold-strong), var(--auth-gold));
  color: var(--color-brand-contrast);
  box-shadow: 0 10px 30px -10px var(--auth-gold-glow);
}

.auth-card__badge svg {
  width: 1.4rem;
  height: 1.4rem;
}

.auth-card__badge--mail {
  animation: auth-pulse 2.6s var(--auth-ease) infinite;
}

@keyframes auth-pulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.08); }
}

.auth-card__title {
  font-family: var(--font-brand);
  font-size: var(--auth-fs-title);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

.auth-card__subtitle {
  color: var(--auth-muted);
  font-size: var(--auth-fs-small);
}

.auth-card__email {
  color: var(--auth-text);
}

.auth-card__alert {
  margin-bottom: var(--auth-gap);
  animation: auth-shake 420ms var(--auth-ease);
}

@keyframes auth-shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.auth-card__switch,
.auth-card__fineprint {
  margin-top: var(--auth-gap);
  color: var(--auth-muted);
  font-size: var(--auth-fs-small);
  text-align: center;
}

.auth-card__fineprint {
  margin-top: 0.85rem;
  color: var(--auth-subtle);
  font-size: var(--font-size-xs);
}

.auth-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: var(--auth-gap);
  padding-top: var(--auth-gap);
  border-top: 1px solid var(--auth-line);
}

.auth-card__actions form {
  margin: 0;
}

.auth-link {
  color: var(--auth-gold);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  transition: text-decoration-color var(--transition-fast), color var(--transition-fast);
}

.auth-link:hover {
  color: var(--auth-gold-strong);
  text-decoration-color: currentColor;
}

/* -------------------------------------------------------------- Steps */

.auth-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--auth-gap);
  padding: 0;
  list-style: none;
  color: var(--auth-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.auth-steps__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-steps__item + .auth-steps__item::before {
  content: "";
  width: clamp(1.5rem, 1rem + 2vw, 3rem);
  height: 1px;
  margin-inline-end: 0.25rem;
  background: var(--auth-line-strong);
}

.auth-steps__dot {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--auth-line-strong);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}

.auth-steps__dot svg {
  width: 0.85rem;
  height: 0.85rem;
}

.auth-steps__item.is-current {
  color: var(--auth-text);
}

.auth-steps__item.is-current .auth-steps__dot {
  border-color: var(--auth-gold);
  background-color: var(--auth-gold);
  color: var(--color-brand-contrast);
  box-shadow: 0 0 0 4px var(--auth-gold-soft);
}

.auth-steps__item.is-done .auth-steps__dot {
  border-color: var(--auth-success);
  color: var(--auth-success);
}

/* --------------------------------------------------------------- Form */

.auth-form {
  display: grid;
  gap: var(--auth-gap);
}

.auth-form > * {
  animation: auth-rise 700ms var(--auth-ease) both;
}

.auth-form > :nth-child(2) { animation-delay: 160ms; }
.auth-form > :nth-child(3) { animation-delay: 220ms; }
.auth-form > :nth-child(4) { animation-delay: 280ms; }
.auth-form > :nth-child(5) { animation-delay: 340ms; }
.auth-form > :nth-child(n + 6) { animation-delay: 400ms; }

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
}

.auth-form__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.auth-form__hint {
  color: var(--auth-subtle);
  font-size: var(--font-size-xs);
}

.auth-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-section__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 0.9rem;
  padding: 0;
  color: var(--auth-gold);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-section__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--auth-line-strong), transparent);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 560px) {
  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-grid__full {
    grid-column: 1 / -1;
  }
}

/* One field per line at every width (Country, State, City), so long names
   such as "Saint Vincent and the Grenadines" are never cut off. */
@media (min-width: 560px) {
  .auth-grid--stacked {
    grid-template-columns: minmax(0, 1fr);
  }
}

.auth-section .auth-field--mobile {
  margin-top: 1rem;
}

/* -------------------------------------------------------------- Fields */

.auth-field {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-field__label {
  padding: 0;
  color: var(--auth-text);
  font-size: var(--auth-fs-small);
  font-weight: var(--font-weight-semibold);
}

.auth-field__required {
  color: var(--auth-gold);
}

.auth-field__control-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__control {
  width: 100%;
  min-height: var(--auth-control);
  padding: 0 1rem;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius-sm);
  background-color: var(--auth-field);
  color: var(--auth-text);
  font: inherit;
  font-size: var(--auth-fs-body);
  transition: border-color var(--transition-normal), background-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

.auth-field__control::placeholder {
  color: var(--auth-subtle);
}

.auth-field__control:hover {
  border-color: var(--auth-line-strong);
  background-color: var(--auth-field-hover);
}

.auth-field__control:focus {
  outline: none;
  border-color: var(--auth-gold);
  background-color: rgba(235, 196, 42, 0.05);
  box-shadow: 0 0 0 4px var(--auth-gold-soft), 0 10px 30px -14px var(--auth-gold-glow);
}

.auth-field__control:-webkit-autofill,
.auth-field__control:-webkit-autofill:hover,
.auth-field__control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-text);
  -webkit-box-shadow: 0 0 0 1000px #15161c inset;
  caret-color: var(--auth-text);
}

.auth-field__control-wrap--icon .auth-field__control {
  padding-inline-start: 2.9rem;
}

.auth-field__icon {
  position: absolute;
  left: 1rem;
  display: inline-flex;
  color: var(--auth-subtle);
  pointer-events: none;
  transition: color var(--transition-normal);
}

.auth-field__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.auth-field__control-wrap:focus-within .auth-field__icon {
  color: var(--auth-gold);
}

.auth-field__control-wrap--toggle .auth-field__control {
  padding-inline-end: 3.2rem;
}

.auth-field__toggle {
  position: absolute;
  right: 0.4rem;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.auth-field__toggle:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--auth-text);
}

.auth-field__toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.auth-field__toggle-hide,
.auth-field__toggle[aria-pressed="true"] .auth-field__toggle-show {
  display: none;
}

.auth-field__toggle[aria-pressed="true"] .auth-field__toggle-hide {
  display: inline-flex;
}

.auth-field__control-wrap--select .auth-field__select {
  padding-inline-end: 2.6rem;
  appearance: none;
  cursor: pointer;
}

.auth-field__select option {
  background-color: #15161c;
  color: var(--auth-text);
}

.auth-field__select:disabled {
  cursor: progress;
  opacity: 0.6;
}

.auth-field__chevron {
  position: absolute;
  right: 0.9rem;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--auth-muted);
  pointer-events: none;
}

.auth-field__control-wrap--prefix .auth-field__control {
  padding-inline-start: 4.6rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.auth-field__prefix {
  position: absolute;
  left: 0.45rem;
  display: inline-grid;
  place-items: center;
  min-width: 3.6rem;
  height: calc(var(--auth-control) - 0.9rem);
  padding: 0 0.6rem;
  border-radius: 8px;
  background-color: var(--auth-gold-soft);
  color: var(--auth-gold);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.auth-field__hint {
  color: var(--auth-subtle);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.auth-field__error {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: var(--auth-error);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
}

.auth-field__error-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.05rem;
}

.auth-field--invalid .auth-field__control {
  border-color: var(--auth-error);
  background-color: var(--auth-error-soft);
}

.auth-field--invalid .auth-field__control:focus {
  box-shadow: 0 0 0 4px var(--auth-error-soft);
}

/* Gender: segmented pills built on real radio buttons. */
.auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-pill {
  position: relative;
  flex: 1 1 6rem;
}

.auth-pill__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-pill__label {
  display: grid;
  place-items: center;
  min-height: calc(var(--auth-control) - 6px);
  padding: 0 1rem;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  background-color: var(--auth-field);
  color: var(--auth-muted);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: border-color var(--transition-normal), background-color var(--transition-normal),
    color var(--transition-normal), transform var(--transition-fast);
}

.auth-pill:hover .auth-pill__label {
  border-color: var(--auth-line-strong);
  color: var(--auth-text);
}

.auth-pill__input:checked + .auth-pill__label {
  border-color: var(--auth-gold);
  background-color: var(--auth-gold-soft);
  color: var(--auth-gold);
  box-shadow: inset 0 0 0 1px var(--auth-gold);
}

.auth-pill__input:focus-visible + .auth-pill__label {
  outline: 2px solid var(--auth-gold);
  outline-offset: 3px;
}

.auth-pill__input:active + .auth-pill__label {
  transform: scale(0.97);
}

/* Remember me: a custom box over a real checkbox. */
.auth-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  cursor: pointer;
}

.auth-check__input {
  position: absolute;
  opacity: 0;
}

.auth-check__box {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border: 1px solid var(--auth-line-strong);
  border-radius: 6px;
  background-color: var(--auth-field);
  color: transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.auth-check__box svg {
  width: 0.85rem;
  height: 0.85rem;
  transform: scale(0.4);
  transition: transform var(--transition-normal);
}

.auth-check__input:checked + .auth-check__box {
  border-color: var(--auth-gold);
  background-color: var(--auth-gold);
  color: var(--color-brand-contrast);
}

.auth-check__input:checked + .auth-check__box svg {
  transform: scale(1);
}

.auth-check__input:focus-visible + .auth-check__box {
  outline: 2px solid var(--auth-gold);
  outline-offset: 3px;
}

.auth-check__label {
  font-size: var(--auth-fs-small);
  font-weight: var(--font-weight-medium);
}

/* Password strength meter (sign-up). */
.auth-meter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-meter__bar {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.auth-meter__bar span {
  height: 4px;
  border-radius: 999px;
  background-color: var(--auth-line);
  transition: background-color var(--transition-normal);
}

.auth-meter__label {
  min-width: 4.5rem;
  color: var(--auth-muted);
  font-size: var(--font-size-xs);
  text-align: end;
}

.auth-meter[data-level="1"] .auth-meter__bar span:nth-child(-n + 1) { background-color: var(--auth-error); }
.auth-meter[data-level="2"] .auth-meter__bar span:nth-child(-n + 2) { background-color: #f0a83c; }
.auth-meter[data-level="3"] .auth-meter__bar span:nth-child(-n + 3) { background-color: var(--auth-gold); }
.auth-meter[data-level="4"] .auth-meter__bar span { background-color: var(--auth-success); }

/* The code field: big, spaced digits. */
.auth-otp {
  min-height: clamp(60px, 3.2rem + 1vw, 72px);
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.55em;
  text-align: center;
  text-indent: 0.55em;
}

/* ------------------------------------------------------------- Buttons */

.auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--auth-control);
  padding: 0 1.5rem;
  overflow: hidden;
  border: 0;
  border-radius: var(--auth-radius-sm);
  background: linear-gradient(135deg, var(--auth-gold-strong), var(--auth-gold) 55%, #e0a800);
  color: var(--color-brand-contrast);
  font: inherit;
  font-size: var(--auth-fs-body);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  box-shadow: 0 14px 34px -14px var(--auth-gold-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-normal);
}

/* A light sweep crosses the button on hover. */
.auth-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--auth-ease);
}

.auth-submit:hover::before {
  transform: translateX(120%);
}

.auth-submit:hover {
  box-shadow: 0 18px 40px -12px var(--auth-gold-glow);
}

.auth-submit:active {
  transform: translateY(1px) scale(0.99);
}

.auth-submit:focus-visible {
  outline: 2px solid var(--auth-gold-strong);
  outline-offset: 3px;
}

/* While a submission is in flight (form-submit.js) the button ignores the
   pointer entirely: no hover sweep, no press, no second click. */
.auth-submit[disabled],
.auth-submit[aria-disabled="true"],
.auth-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
  box-shadow: none;
}

.auth-submit__arrow {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform var(--transition-normal);
}

.auth-submit:hover .auth-submit__arrow {
  transform: translateX(4px);
}

.auth-submit:not(.is-loading) .button__spinner {
  display: none;
}

.auth-submit.is-loading .auth-submit__arrow {
  display: none;
}

.auth-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--auth-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--auth-text);
  font: inherit;
  font-size: var(--auth-fs-small);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

.auth-ghost:hover:not([disabled]) {
  border-color: var(--auth-gold);
  background-color: var(--auth-gold-soft);
  color: var(--auth-gold);
}

.auth-ghost[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.auth-ghost[aria-disabled="true"],
.auth-ghost.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.auth-ghost--quiet {
  border-color: transparent;
  color: var(--auth-muted);
}

.auth-ghost__icon {
  width: 1rem;
  height: 1rem;
}

.auth-ghost:not(.is-loading) .button__spinner {
  display: none;
}

.auth-ghost.is-loading .auth-ghost__icon {
  display: none;
}

.auth-body :focus-visible {
  outline-color: var(--auth-gold);
}

/* -------------------------------------------------------------- Phones */

@media (max-width: 479.98px) {
  .auth-stage {
    align-items: start;
  }

  .auth-card__actions {
    flex-direction: column;
  }

  .auth-card__actions .auth-ghost {
    justify-content: center;
    width: 100%;
  }

  .auth-steps__item span:last-child {
    display: none;
  }

  .auth-steps__item.is-current span:last-child {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-aurora,
  .auth-card__glow,
  .auth-pitch__cube,
  .auth-card__badge--mail,
  .auth-pitch,
  .auth-card,
  .auth-form > *,
  .auth-card__alert {
    animation: none;
  }

  .auth-submit::before {
    display: none;
  }
}
