/* The login page: a black-and-white dithered wave (login-bg.js) under one glass card. */
.login-page {
  position: relative;
  display: grid;
  min-height: 100dvh;
  padding: 24px 16px;
  place-items: center;
  overflow: hidden;
  background: #000 radial-gradient(120% 90% at 50% 100%, #3a3a3a 0%, #151515 55%, #000 100%);
}
.login-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .9s ease;
}
.login-background.is-live { opacity: 1; }
/* A soft vignette, so the card sits in a calm spot and the edges read as a frame. */
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(60% 55% at 50% 50%, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, 0) 100%);
}
@media (prefers-reduced-motion: reduce) { .login-background { transition: none; } }

.login-card {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(380px, 100%);
  padding: 30px 30px 28px;
  gap: 20px;
  color: var(--ink);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .075) 0%, rgba(255, 255, 255, .025) 45%, rgba(255, 255, 255, .01) 100%),
    rgba(20, 22, 24, .58);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .55),
    0 2px 6px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  backdrop-filter: blur(22px) saturate(1.15);
}
/* A faint lit edge along the top, the way light catches glass. */
.login-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14%;
  right: 14%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .7), rgba(255, 255, 255, 0));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card { background: rgba(24, 26, 28, .94); }
}

.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand .app-logo { width: 30px; height: 30px; }
.login-brand .app-brand-name { font-size: 15px; }

.login-heading { display: grid; gap: 4px; }
.login-card h1 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.login-lead { margin: 0; color: var(--muted); font-size: 13px; }

.login-form { display: grid; gap: 14px; }
.login-field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .01em; }
.login-field label { cursor: default; }
.login-password { position: relative; }
.login-password input { padding-right: 46px; }
.login-password input[type="text"] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.login-eye {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  translate: 0 -50%;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.login-eye:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
.login-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-eye .login-eye-hide, .login-eye.is-visible .login-eye-show { display: none; }
.login-eye.is-visible .login-eye-hide { display: block; }
.login-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(0, 0, 0, .32);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
  font-size: 15px;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.login-field input:hover { border-color: rgba(255, 255, 255, .2); }
.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, .4);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px rgba(25, 168, 123, .22);
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #16191b inset;
  caret-color: var(--ink);
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  color: var(--danger);
  background: rgba(229, 103, 107, .14);
  border: 1px solid rgba(229, 103, 107, .25);
  border-radius: 12px;
  font-size: 13px;
}

.login-submit {
  position: relative;
  height: 46px;
  margin-top: 2px;
  color: var(--on-accent);
  background: linear-gradient(180deg, #22bb8a 0%, var(--accent) 55%, var(--accent-dark) 100%);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(25, 168, 123, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease, filter .16s ease;
}
.login-submit:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(25, 168, 123, .4), inset 0 1px 0 rgba(255, 255, 255, .25); }
.login-submit:active:not(:disabled) { transform: translateY(1px); }
.login-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.login-submit:disabled { opacity: .6; cursor: progress; }

/* A card at the exact middle reads as sitting high: on a desktop it rests a little below it. */
@media (min-width: 761px) and (min-height: 600px) {
  .login-card { translate: 0 4vh; }
}

@media (max-width: 480px) {
  .login-card { padding: 26px 22px 24px; border-radius: 20px; }
}
