body[data-auth="pending"] > :is(.rail, .skip, #content, #notice),
body[data-auth="ready"] > .auth {
  display: none;
}

.auth {
  display: grid;
  place-content: center;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 16px;
  background: linear-gradient(155deg, #eaf3fd, #f5f8fc 55%);
}

.auth-card {
  width: min(100%, 390px);
  min-width: min(390px, calc(100vw - 32px));
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 14px 36px #082b5210;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-weight: 800;
  letter-spacing: .04em;
}

.auth-brand img {
  width: 33px;
  height: 33px;
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 1.65rem;
  letter-spacing: -.035em;
}

.auth-card > p {
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

.auth-card .fields .button {
  width: 100%;
}

.auth-card .error:empty {
  display: none;
}

.auth-card .auth-links {
  margin: 14px 0 0;
}

.auth-card .auth-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
}

.auth-card .message-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.message-list li {
  overflow-wrap: anywhere;
}

.account {
  margin-top: auto;
  padding: 8px 5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
}

.account[hidden] {
  display: none;
}

.account + .rail-foot {
  margin-top: 0;
}

#account-name {
  overflow-wrap: anywhere;
}

.account button {
  color: var(--accent);
  border: 0;
  background: none;
  padding: 6px 0;
  min-height: 44px;
  font-weight: 700;
}

@media (max-width: 740px) {
  .account {
    margin: 0;
    justify-content: flex-end;
    padding: 0;
  }

  #account-name, .account:not([hidden]) + .rail-foot {
    display: none;
  }
}

.password-field { display: grid; gap: 6px; }
.password-control { position: relative; }
.password-control input { width: 100%; padding-right: 94px; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 44px; min-width: 80px; padding: 6px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--accent); font: inherit; font-weight: 700; cursor: pointer;
}
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.required-star { color: #b42318; }
