.login-page {
  /* Swap these two image variables to change the auth background or left-side X. */
  /* --auth-background-image: url("/static/img/starry-auth-bg.svg"); */
  /* --auth-x-logo-image: url("/static/img/x-letter-transparent.png"); */
  --auth-panel-bg: #fff;
  --auth-panel-border: rgba(148, 163, 184, 0.22);
  --auth-field-bg: rgba(2, 6, 23, 0.56);
  --auth-know-more-text: #08111f;
  min-height: 100vh;
  color: #f8fafc;
  background: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.68),
      rgba(0, 0, 0, 0.12) 44%,
      rgba(0, 0, 0, 0.62)
    ),
    var(--auth-background-image) center / cover no-repeat #02040a;
}

:root {
  --bg: #ffffff;
  --surface: #f7f9fc;
  --surface-strong: #eef3f9;
  --line: #d8e0ea;
  --text: #1f2937;
  --muted: #687385;
  --soft: #8b96a8;
  --accent: #0f1720;
  --accent-dark: #1b63a9;
  --green: #0f9f6e;
  --orange: #b45309;
  --code-bg: #0f172a;
  --code-border: #263247;
  --code-text: #dbeafe;
  --code-muted: #94a3b8;
  color-scheme: light;
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 390px) minmax(360px, 460px);
  align-items: center;
  width: min(1060px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px;
}

.login-shell::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  height: 36%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(11, 34, 95, 0.42) 52%,
    rgba(0, 0, 0, 0.72)
  );
}

.auth-info-panel {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 620px;
  padding: 44px;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-x-logo {
  width: min(260px, 70%);
  aspect-ratio: 237 / 290;
  background: var(--auth-x-logo-image) center / contain no-repeat;
  filter: drop-shadow(0 32px 54px rgba(0, 102, 204, 0.36));
}

.auth-info-panel p {
  max-width: 280px;
  margin: 24px 0 0;
  color: rgba(226, 232, 240, 0.78);
  text-align: center;
  line-height: 1.6;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
}

.login-brand {
  width: fit-content;
  margin-bottom: 28px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.login-brand .brand-logo {
  width: 184px;
  filter: drop-shadow(0 12px 24px rgba(0, 102, 204, 0.18));
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: rgba(203, 213, 225, 0.82);
  font-size: 13px;
}

.login-form input {
  height: 40px;
  padding: 0 12px;
  color: #f8fafc;
  background: var(--auth-field-bg);
  border: 1px solid rgba(99, 102, 241, 0.42);
  border-radius: 7px;
  outline: 0;
}

.login-form input:focus {
  border-color: #2781ff;
  box-shadow: 0 0 0 3px rgba(39, 129, 255, 0.18);
}

.login-form button {
  height: 40px;
  padding: 0 14px;
  color: white;
  background: #2277f7;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.demo-credentials {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  margin: 24px 0;
  padding: 14px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
}

.demo-credentials span {
  color: rgba(203, 213, 225, 0.76);
  font-weight: 700;
}

.demo-credentials code {
  overflow-x: auto;
}

.login-error {
  padding: 10px 12px;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffdad6;
  border-radius: 7px;
}

.login-notice {
  padding: 10px 12px;
  color: #bfdbfe;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
}

.org-picker {
  position: relative;
}

.org-results {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.org-results::-webkit-scrollbar {
  width: 10px;
}

.org-results::-webkit-scrollbar-thumb {
  background: #c7d2e2;
  border: 3px solid rgba(255, 255, 255, 0.98);
  border-radius: 999px;
}

.org-results::-webkit-scrollbar-track {
  background: transparent;
}

.org-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 750;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.org-result::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: #7c8aa0;
  border-radius: 50%;
}

.org-result:hover,
.org-result:focus {
  color: var(--accent-dark);
  background: #edf5ff;
  outline: 0;
  transform: translateX(2px);
}

.org-result:last-child {
  border-bottom: 0;
}

.auth-switch {
  margin: 18px 0 0;
  color: rgba(203, 213, 225, 0.68);
  text-align: center;
}

.auth-switch a {
  color: #93c5fd;
  font-weight: 800;
}

.resend-code {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.9em;
}

.resend-code #resendCodeMessage {
  display: block;
  margin: 0 0 6px;
  color: rgba(203, 213, 225, 0.68);
}

.resend-code button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #93c5fd;
  font-weight: 800;
  cursor: pointer;
}

.resend-code button:disabled {
  color: rgba(203, 213, 225, 0.5);
  cursor: default;
}

/* ===== Signup page — clean white theme ===== */
.login-page.auth-signup {
  background: #ffffff;
  color: #fff;
}

.auth-signup .login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-signup .login-shell::after {
  display: none;
}

.auth-signup .auth-info-panel {
  display: none;
}

.auth-signup .login-card {
  max-width: 500px;
  min-height: auto;
  padding: 52px 44px 44px;
  background: #ffffff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 6px rgba(0, 0, 0, 0.04);
  backdrop-filter: none;
  align-content: start;
}

.auth-signup h1,
.auth-signup .lead {
  display: none;
}

.auth-signup .login-brand {
  justify-self: center;
  margin-bottom: 36px;
}

.auth-signup .login-brand .brand-logo {
  width: 210px;
  filter: none;
}

.auth-signup .login-form {
  gap: 14px;
}

.auth-signup .login-form label span {
  display: none;
}

.auth-signup .login-form label {
  gap: 0;
}

.auth-signup .login-form input {
  height: 46px;
  padding: 0 14px;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.auth-signup .login-form input::placeholder {
  color: #9ca3af;
  font-size: 14px;
}

.auth-signup .login-form input:focus {
  border-color: #5b7fc4;
  box-shadow: 0 0 0 3px rgba(91, 127, 196, 0.15);
}

.auth-signup .org-picker input {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.auth-signup .org-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #9ca3af;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.auth-signup .org-clear[hidden] {
  display: none;
}

.field-loader {
  position: relative;
}

.field-loader .input-spinner {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  border: 2px solid #d1d5db;
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: field-spin 0.7s linear infinite;
}

.field-loader .input-spinner[hidden] {
  display: none;
}

@keyframes field-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.auth-signup .org-clear:hover {
  color: #374151;
  background: #e5e7eb;
}

.auth-signup .login-form button:hover {
  background: #ffff;
}

.auth-signup .org-results {
  top: 100%;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: none;
}

.auth-signup .org-result {
  color: #374151;
  background: #ffffff;
  font-weight: 400;
  font-size: 14px;
  text-align: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 0;
  padding: 10px 16px;
}

.auth-signup .org-result::before {
  display: none;
}

.auth-signup .org-results .org-result:hover,
.auth-signup .org-results .org-result:focus {
  color: #111827;
  background: #e5e7eb;
  outline: none;
  transform: none;
}

.auth-signup .auth-switch {
  margin-top: 20px;
  color: #6b7280;
}

.auth-signup .auth-switch a {
  color: #5b7fc4;
  font-weight: 700;
}

.auth-signup .resend-code #resendCodeMessage {
  color: #6b7280;
}

.auth-signup .resend-code button {
  color: #5b7fc4;
}

.auth-signup .resend-code button:disabled {
  color: #9ca3af;
}

.auth-signup .login-error {
  background: #fff1f0;
  border-color: #ffdad6;
  color: #b42318;
}

.auth-signup .login-notice {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.auth-signup .demo-credentials {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #374151;
}

.auth-signup .demo-credentials span {
  color: #374151;
}

.auth-signup .demo-credentials code {
  color: #1d4ed8;
}

/* ===== Login page — clean white theme ===== */
.login-page.auth-login {
  background: #ffffff;
  color: #1f2937;
}

.auth-login .login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-login .login-shell::after {
  display: none;
}

.auth-login .auth-info-panel {
  display: none;
}

.auth-login .login-card {
  max-width: 500px;
  min-height: auto;
  padding: 52px 44px 44px;
  background: #ffffff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 6px rgba(0, 0, 0, 0.04);
  backdrop-filter: none;
  align-content: start;
}

.auth-login h1,
.auth-login .lead {
  display: none;
}

.auth-login .login-brand {
  justify-self: center;
  margin-bottom: 36px;
}

.auth-login .login-brand .brand-logo {
  width: 210px;
  filter: none;
}

.auth-login .login-form {
  gap: 14px;
}

.auth-login .login-form label span {
  display: none;
}

.auth-login .login-form .show-password-row span {
  display: inline;
  color: #6b7280;
}

.auth-login .login-form label {
  gap: 5;
}

.auth-login .login-form input {
  height: 46px;
  padding: 0 14px;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.auth-login .login-form input::placeholder {
  color: #9ca3af;
  font-size: 14px;
}

.auth-login .login-form input:focus {
  border-color: #5b7fc4;
  box-shadow: 0 0 0 3px rgba(91, 127, 196, 0.15);
}

.auth-login .login-form button {
  height: 46px;
  margin-top: 4px;
  background: #5b7fc4;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-login .login-form button:hover {
  background: #4a6db2;
}

.auth-login .auth-switch {
  margin-top: 20px;
  color: #6b7280;
}

.auth-login .auth-switch a {
  color: #5b7fc4;
  font-weight: 700;
}

.auth-login .login-error {
  background: #fff1f0;
  border-color: #ffdad6;
  color: #b42318;
}

.auth-login .demo-credentials {
  display: none;
}

.auth-login .show-password-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}

.auth-login .show-password-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #5b7fc4;
  cursor: pointer;
  border: none;
  background: none;
  box-shadow: none;
}

@media (max-width: 820px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .auth-info-panel {
    min-height: auto;
    padding: 28px 28px 0;
  }

  .auth-x-logo {
    width: 120px;
  }

  .login-card {
    min-height: auto;
    border-radius: 8px;
  }
}
