.auth-toolbar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 4;
}

.auth-layout {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-stack {
  width: 100%;
  max-width: 17.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
}

.auth-stack .wordmark {
  align-self: center;
  margin-bottom: 0.25rem;
  font-size: 1.75rem;
}

.auth-accounts-wrap {
  align-self: stretch;
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.auth-accounts-wrap[hidden] {
  display: none;
}

.auth-accounts-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.2rem 0.35rem 0.35rem;
}

.auth-account-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(354 85% 48%) 0%, hsl(354 90% 58%) 30%, hsl(0 80% 65%) 55%, hsl(0 85% 65%) 100%);
  color: hsl(0 0% 100%);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px light-dark(hsl(0 0% 0% / 0.17), hsl(0 0% 0%));
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, filter 0.12s ease,
    var(--press-transition);
}

.auth-account-chip.is-current {
  border-color: hsl(var(--accent-h) 55% 52%);
  box-shadow: 0 0 0 1px hsl(var(--accent-h) 55% 52% / 0.35), 0 2px 6px hsl(0 0% 0% / 0.14);
}

@media (hover: hover) and (pointer: fine) {
  .auth-account-chip:hover:not(.is-current) {
    filter: brightness(1.06);
    box-shadow: 0 2px 6px hsl(0 0% 0% / 0.16);
  }
}

.auth-account-chip:active {
  filter: brightness(0.96);
  transform: scale(0.97);
}

.auth-account-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-elevated), 0 0 0 4px hsl(var(--accent-h) 55% 52%);
}

.auth-label {
  font-size: 0.6875rem;
  font-weight: 500;
  padding-left: 2px;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.auth-input {
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: var(--color-elevated);
  color: var(--color-base);
  box-shadow: inset 0 1px 0 hsl(0 0% 0% / 0.04);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.auth-input::placeholder {
  color: var(--color-muted);
}

@media (hover: hover) and (pointer: fine) {
  .auth-input:not(:focus):hover {
    border-color: light-dark(hsl(220 13% 78%), hsl(220 12% 22%));
  }
}

.auth-input:focus {
  outline: none;
  border-color: hsl(var(--accent-h) 55% 52%);
  box-shadow: inset 0 1px 0 hsl(0 0% 0% / 0.04), 0 0 0 1px var(--focus-shadow);
}


.auth-field-warning {
  font-size: 0.6875rem;
  font-weight: 500;
  color: light-dark(hsl(40 80% 45%), hsl(40 70% 55%));
  text-align: right;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.auth-input.has-error:not(:focus) {
  border-color: hsl(40 80% 45%);
  box-shadow: inset 0 1px 0 hsl(0 0% 0% / 0.04), 0 0 0 1px hsl(40 75% 60% / 0.3);
}

.auth-action-button {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.45rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

.auth-signin-button {
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--accent-h) 55% 42%);
  background: linear-gradient(180deg,
      hsl(var(--accent-h) 72% 48%) 0%,
      hsl(var(--accent-h) 78% 44%) 100%);
  color: hsl(0 0% 100%);
  box-shadow: 0 1px 0 hsl(0 0% 0% / 0.12), inset 0 1px 0 hsl(0 0% 100% / 0.12);
  transition: border-color 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease,
    var(--press-transition);
}

@media (hover: hover) and (pointer: fine) {
  .auth-signin-button:hover {
    border-color: hsl(var(--accent-h) 55% 36%);
    filter: brightness(1.03);
  }
}

.auth-signin-button:active {
  filter: brightness(0.97);
  box-shadow: inset 0 1px 1px hsl(0 0% 0% / 0.12);
}

.auth-stack .auth-signin-button,
.auth-stack .auth-register-button {
  width: 100%;
}

.auth-register-button {
  border: 1px solid hsl(var(--accent-h) 55% 52% / 0.35);
  background: var(--color-accent-half);
  color: var(--color-base);
  transition: background 0.12s ease, border-color 0.12s ease, var(--press-transition);
}

@media (hover: hover) and (pointer: fine) {
  .auth-register-button:hover {
    background: color-mix(in srgb, var(--color-accent) 58%, var(--color-elevated));
    border-color: hsl(var(--accent-h) 55% 48%);
  }
}

.auth-register-button:active {
  background: color-mix(in srgb, var(--color-accent) 52%, var(--color-elevated));
  border-color: hsl(var(--accent-h) 55% 42%);
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}