/*
 * [keystone_login] — scoped under .ks-login. Public pages never receive the
 * shell's --ks-* custom properties (those are injected on :root only at
 * shell-render time), so this hardcodes the admin design system's own
 * values by number, the same convention the candidates module's public
 * pages use for the identical reason.
 *
 * The card is the sidebar's own dark colour (--ks-sidebar-bg), not a plain
 * white box (found live, 0.60.1): a white-on-dark branding logo — the
 * normal case, since the sidebar is dark — is invisible on white. Matching
 * the sidebar colour here also makes this read as the same product as the
 * /keystone shell, not a generic form: an accent bar across the top (the
 * shell's own accent colour), uppercase tracked labels instead of bold
 * plain-dark ones, a pill-shaped submit button with a hover lift. The outer
 * page stays transparent so the site's own theme shows through behind the
 * card (see candidates' own 1.1.6 fix).
 */
.ks-login {
  --c-accent: #2563eb;
  --c-accent-hover: #1d4ed8;
  --c-accent-soft: #eaf1fe;
  --c-card: #1b2233;
  --c-card-2: #232c40;
  --c-fg: #aeb7c9;
  --c-fg-active: #ffffff;
  --c-border: rgba(255, 255, 255, .12);
  --c-danger: #ff8a90;
  --c-danger-bg: rgba(229, 72, 77, .16);
  --c-radius: 16px;
  --c-radius-sm: 8px;
  --c-shadow: 0 1px 2px rgba(10, 14, 28, .2), 0 16px 40px rgba(10, 14, 28, .28);

  display: flex;
  justify-content: center;
  padding: 56px 16px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.ks-login *, .ks-login *::before, .ks-login *::after { box-sizing: border-box; }

.ks-login__panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--c-card);
  box-shadow: var(--c-shadow);
  border-radius: var(--c-radius);
  padding: 40px 32px 32px;
  text-align: center;
  overflow: hidden;
}
.ks-login__panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-accent), #60a5fa);
}

.ks-login__logo { max-width: 180px; max-height: 56px; margin: 0 auto 28px; display: block; }
.ks-login__wordmark { font-size: 20px; font-weight: 700; color: var(--c-fg-active); margin-bottom: 28px; letter-spacing: -.01em; }

.ks-login__error {
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border-radius: var(--c-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 18px;
  text-align: left;
}

.ks-login__field { text-align: left; margin-bottom: 16px; }
.ks-login__field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-fg);
  margin-bottom: 6px;
}
.ks-login__field input {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--c-radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  color: var(--c-fg-active);
  background: var(--c-card-2);
  transition: border-color .12s ease, background .12s ease;
}
.ks-login__field input::placeholder { color: rgba(174, 183, 201, .55); }
.ks-login__field input:focus {
  outline: none;
  border-color: var(--c-accent);
  background: #283049;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .25);
}
/* Chrome/Safari paint autofilled (and, in some versions, actively-matching-a-
   saved-credential) fields with their own background + black text, ignoring
   this stylesheet's color — found live: the field read as dark text on a
   dark field while the browser's autofill was engaged, fine again once it
   wasn't. The 9999s background-color transition is the standard trick that
   defeats the forced repaint; the inset box-shadow overrides the autofill
   background itself. */
.ks-login__field input:-webkit-autofill,
.ks-login__field input:-webkit-autofill:hover,
.ks-login__field input:-webkit-autofill:focus,
.ks-login__field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--c-fg-active);
  -webkit-box-shadow: 0 0 0px 1000px var(--c-card-2) inset;
  box-shadow: 0 0 0px 1000px var(--c-card-2) inset;
  caret-color: var(--c-fg-active);
  transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}

.ks-login__remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--c-fg);
  margin-bottom: 22px; text-align: left;
}
.ks-login__remember input { accent-color: var(--c-accent); width: 15px; height: 15px; }

.ks-login__submit {
  display: inline-block;
  width: 100%;
  background: var(--c-accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: .01em;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
  transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.ks-login__submit:hover {
  background: var(--c-accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .45);
}
.ks-login__submit--link { width: auto; display: inline-block; padding: 11px 28px; }

.ks-login__hint { font-size: 14px; color: var(--c-fg); margin: 0 0 20px; }
.ks-login__hint strong { color: var(--c-fg-active); }
.ks-login__lost { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--c-fg); text-decoration: none; }
.ks-login__lost:hover { color: var(--c-fg-active); }
