/* ─── page scaffold ─────────────────────────────────────────────── */
html, body {
  margin: 0;
  height: auto;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  /* Match the marketing hero so the login feels like part of the same site. */
  background:
    radial-gradient(1200px 500px at 50% -10%, #dfe9ff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #f7f9ff 0%, #ffffff 100%);
}

/* full-screen flexbox → centers the card regardless of master.css */
#site-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh;
  height: auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* ─── login card ────────────────────────────────────────────────── */
#login-container {
  /* Bigger, bolder card. */
  width: min(92vw, 480px);
  padding: 3rem 2.75rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(15, 26, 51, 0.06),
    0 10px 40px rgba(11, 92, 255, 0.12);
  border: 1px solid rgba(11, 92, 255, 0.08);

  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-sizing: border-box;
}

#login-container img {
  width: clamp(180px, 60%, 260px);
  height: auto;
  align-self: center;
}

/* ─── form layout ──────────────────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}

.form-row input[type="text"],
.form-row input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 1px solid #d6dbea;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus {
  outline: none;
  border-color: #0b5cff;
  box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.18);
}

/* ─── buttons ──────────────────────────────────────────────────── */
.button-row {
  justify-content: center;
  margin-top: 0.25rem;
}

.button-row button {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  background: #0b5cff;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.button-row button:hover {
  background: #0947cc;
}

.button-row button:active {
  transform: translateY(1px);
}

.button-row .link-button {
  display: inline-block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: #0b5cff;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.button-row .link-button:hover {
  background: #0947cc;
}

/* Secondary button variant: outlined, used for "Request Access". */
.button-row .link-button--secondary {
  background: transparent;
  color: #0b5cff;
  border: 1px solid #0b5cff;
}

.button-row .link-button--secondary:hover {
  background: #eef4ff;
}

/* Divider between primary auth and secondary CTAs. */
.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #9aa3b8;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e9f2;
}

/* Footer line under the CTAs. */
.login-footer-note {
  text-align: center;
  color: #6a7388;
  font-size: 0.88rem;
  margin: 0;
}

.login-footer-note a {
  color: #0b5cff;
  text-decoration: none;
  font-weight: 600;
}

.login-footer-note a:hover {
  text-decoration: underline;
}

/* ─── errors / alerts ─────────────────────────────────────────── */
ul.errorlist.nonfield li {
  color: #b42318;
  font-size: 0.92rem;
  text-align: center;
  margin: 0;
  padding: 0.5rem 0.75rem;
  list-style: none;
  background: #fef3f2;
  border: 1px solid #fda29b;
  border-radius: 6px;
}

.login-alert {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
  text-align: center;
}

.login-alert--error {
  background: #fef3f2;
  border: 1px solid #fda29b;
  color: #b42318;
}

/* ─── narrow-screen tweaks ────────────────────────────────────── */
@media (max-width: 480px) {
  #login-container {
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }
  #login-container img {
    width: clamp(140px, 55%, 200px);
  }
}

/* ─── dark-mode overrides ──────────────────────────────────────
   The persisted theme survives logout, so a user who logged out
   in dark mode lands on this page with html[data-theme="dark"]
   already applied. The base styles here use hardcoded light
   values plus `color-scheme: dark` from theme.css makes the
   browser invert form-control defaults — the combination leaves
   the card white with dark inputs and broken contrast. These
   overrides reskin the card, labels, inputs, and chrome to read
   correctly when dark theme is active. */
html[data-theme="dark"] #login-container {
  background: #161b23;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .form-row label {
  color: #e5e9f0;
}

html[data-theme="dark"] .form-row input[type="text"],
html[data-theme="dark"] .form-row input[type="password"] {
  background: #0f131a;
  border-color: rgba(255, 255, 255, 0.14);
  color: #e5e9f0;
}

html[data-theme="dark"] .form-row input[type="text"]::placeholder,
html[data-theme="dark"] .form-row input[type="password"]::placeholder {
  color: #6c7585;
}

html[data-theme="dark"] .form-row input[type="text"]:focus,
html[data-theme="dark"] .form-row input[type="password"]:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

html[data-theme="dark"] .button-row button,
html[data-theme="dark"] .button-row .link-button {
  background: #2563eb;
}

html[data-theme="dark"] .button-row button:hover,
html[data-theme="dark"] .button-row .link-button:hover {
  background: #1d4ed8;
}

html[data-theme="dark"] .button-row .link-button--secondary {
  background: transparent;
  color: #93b8ff;
  border-color: #2f5fe0;
}

html[data-theme="dark"] .button-row .link-button--secondary:hover {
  background: rgba(37, 99, 235, 0.16);
  color: #c8dafd;
}

html[data-theme="dark"] .login-divider {
  color: #7a8497;
}

html[data-theme="dark"] .login-divider::before,
html[data-theme="dark"] .login-divider::after {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .login-footer-note {
  color: #a3adbf;
}

html[data-theme="dark"] .login-footer-note a {
  color: #93b8ff;
}

html[data-theme="dark"] .login-alert--error,
html[data-theme="dark"] ul.errorlist.nonfield li {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(252, 165, 165, 0.45);
  color: #fecaca;
}
