.login-layout {
  min-height: 68vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-choice {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  width: min(560px, 100%);
}

.login-choice h1 {
  margin-bottom: .35em;
}

.login-actions {
  display: grid;
  gap: 18px;
  max-width: 420px;
  margin: 34px auto 0;
}

.login-choice-button {
  width: 100%;
  min-height: 58px;
  font-size: 1.05rem;
}

.forgot-password-link {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.password-help {
  max-width: 820px;
  margin: 6vh auto;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.scan-reader {
  max-width: 440px;
  margin: 35px auto;
  justify-content: center;
  min-height: 88px;
  background: white;
}

#manual-login,
#nfc-login {
  width: min(92vw, 500px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 80px #17211b55;
}

#manual-login::backdrop,
#nfc-login::backdrop {
  background: #17211b99;
  backdrop-filter: blur(3px);
}

.manual-login-form {
  position: relative;
  padding: 28px;
}

.dialog-close {
  position: absolute;
  right: 15px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #e8ece8;
  color: var(--ink);
  font-size: 1.25rem;
}

.nfc-login-form {
  text-align: center;
}

.login-leaderboard {
  position: absolute;
  right: calc(50% + 330px);
  max-width: 360px;
  width: min(360px, calc(50vw - 380px));
  margin: 0;
}

.login-leaderboard h2,
.leaderboard-entry h3 {
  margin: 0;
}

.leaderboard-search {
  min-width: 0;
  margin: 0;
}

.leaderboard-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf7;
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 1.05rem;
}

.leaderboard-entry p {
  margin: 3px 0;
  font-weight: 800;
}

.leaderboard-result {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: #eef2ed;
}

@media (max-width: 520px) {
  .login-layout {
    display: block;
    min-height: auto;
  }
  .login-choice {
    margin-top: 8vh;
  }
  .login-leaderboard {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 28px;
  }
}

@media (max-width: 1180px) {
  .login-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(460px, 560px);
    gap: 28px;
    justify-content: center;
  }
  .login-leaderboard {
    position: static;
    width: auto;
  }
}
