.auth {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  padding: clamp(var(--space-8), 8vh, var(--space-20)) var(--space-4) var(--space-16);
}

.auth::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 560px;
  z-index: -1;
  background-image: radial-gradient(ellipse 42% 58% at 50% 0%, var(--glow), transparent 72%), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, black 30%, transparent 78%);
  pointer-events: none;
}

.auth-card {
  display: grid;
  gap: var(--space-6);
  width: 100%;
  max-width: 400px;
  padding: var(--space-8);
  box-shadow: var(--shadow-medium), var(--highlight);
}

.auth-card-wide {
  max-width: 560px;
}

.auth-head {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  text-align: center;
}

.auth-mark {
  margin-bottom: var(--space-2);
  border-radius: 10px;
}

.auth-mark svg {
  width: 36px;
  height: 36px;
}

.auth-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth-head p {
  color: var(--text-muted);
  font-size: 14px;
}

.auth-form,
.auth-fieldset {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.auth-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-fieldset:disabled {
  opacity: 0.55;
}

.auth-form .field-label {
  color: var(--text);
  font-size: 13px;
}

.auth-form .input {
  height: 40px;
  padding: 0 12px;
  font-size: 14.5px;
}

.auth-secret .input {
  padding-right: 44px;
}

.auth-reveal {
  position: absolute;
  right: 4px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-subtle);
  transition: color 150ms ease, background-color 150ms ease;
}

.auth-reveal:hover {
  background: var(--surface-hover);
  color: var(--text);
}

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

.auth-reveal[aria-pressed="true"] .reveal-hide {
  display: block;
}

.auth-aside {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 400;
}

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

.auth-providers {
  display: grid;
  gap: var(--space-2);
}

.auth-submit,
.auth-provider {
  width: 100%;
}

.auth-submit {
  margin-top: var(--space-1);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: calc(var(--space-2) * -1);
  color: var(--text-subtle);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.auth-switch a,
.auth-card .callout a,
.profile-note a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.auth-switch a:hover,
.profile-note a:hover {
  text-decoration-color: currentColor;
}

.auth-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.profile-head > div {
  min-width: 0;
}

.profile-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 20px;
  font-weight: 600;
}

.profile-head h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.profile-head p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.profile-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.profile-facts {
  display: grid;
  margin: 0;
}

.profile-facts > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}

.profile-facts > div:last-child {
  padding-bottom: 0;
}

.profile-facts dt {
  color: var(--text-muted);
  font-size: 13px;
}

.profile-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
  margin: 0;
}

.profile-email {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.profile-inline {
  display: inline-flex;
}

.profile-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.profile-github:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-muted {
  color: var(--text-subtle);
}

.profile-note {
  color: var(--text-muted);
  font-size: 13.5px;
}

.profile-signout {
  display: flex;
  justify-content: center;
}

@media (max-width: 640px) {
  .auth-card {
    padding: var(--space-6) var(--space-5);
  }

  .auth-form .input {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .profile-facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }
}
