/* Git Fentz fixed dark palette. */
:root,
:root.gl-dark,
:root.ui-neutral,
:root.aura-tinted-themes.ui-neutral,
:root.aura-tinted-themes .ui-neutral-scope {
  color-scheme: dark;

  /* Base, subtle, elevated, and primary text tokens. */
  --gl-color-neutral-950: #171717;
  --gl-color-neutral-900: #202535;
  --gl-color-neutral-800: #2b3242;
  --gl-color-neutral-50: #d6d6d6;

  --gl-background-color-default: #171717;
  --gl-background-color-subtle: #202535;
  --gl-background-color-section: #2b3242;
  --gl-background-color-strong: #2b3242;
  --gl-background-color-overlap: #121a2e;

  /* Application chrome and selected navigation. */
  --body-background-color: #222630;
  --gl-application-chrome-background-color: #222630;
  --super-sidebar-theme-color: #222630;
  --super-sidebar-theme-accent-color: #bdc9fc;
  --super-sidebar-accent-foreground-color: #bdc9fc;
  --gl-nav-item-selected-foreground-color-default: #bdc9fc;

  /* Primary and interactive text. */
  --gl-text-color-default: #d6d6d6;
  --gl-text-color-heading: #d6d6d6;
  --gl-text-color-strong: #d6d6d6;
  --gl-text-color-link: #bdc9fc;
}

/* The instance is intentionally locked to the Git Fentz theme. */
#appearance,
#application-theme {
  display: none !important;
}

/* Keep repository file-list surfaces monochrome. */
.gl-dark .project-last-commit.info-well,
.gl-dark .tree-holder table.tree-table {
  background-color: #202020 !important;
}

.gl-dark .project-last-commit.info-well,
.gl-dark .tree-holder table.tree-table tbody tr,
.gl-dark .tree-holder table.tree-table tbody tr td,
.gl-dark .tree-holder table.tree-table tbody tr th {
  border-color: #343434 !important;
}

.gl-dark .tree-holder table.tree-table thead tr th[scope="col"],
.gl-dark .tree-holder table.tree-table tbody tr.tree-item.selected td {
  background-color: #2a2a2a !important;
}

.gl-dark .tree-holder table.tree-table tbody tr.tree-item:hover:not(.tree-truncated-warning) td,
.gl-dark .tree-holder table.tree-table tbody tr.tree-item:hover:not(.tree-truncated-warning) th {
  background-color: #292929 !important;
  border-color: #444 !important;
}

/* Only the sign-in screen uses a true-black page background. */
body.login-page,
body.login-page > .gl-h-full {
  background-color: #000 !important;
}

/* Compact, single-row login actions. */
body.login-page .js-non-oauth-login > div {
  display: block;
}

body.login-page form[data-testid="sign-in-form"] {
  display: block;
}

body.login-page button[data-testid="sign-in-button"] {
  width: calc(50% - 0.375rem) !important;
}

body.login-page form[data-testid="passkey-form"] {
  width: calc(50% - 0.375rem) !important;
  margin-top: -2rem !important;
  margin-left: calc(50% + 0.375rem);
}

body.login-page form[data-testid="passkey-form"] button {
  width: 100%;
}

/* Present field labels as subtle prompts inside their inputs. */
body.login-page form[data-testid="sign-in-form"] .form-group {
  position: relative;
}

body.login-page label[for="user_login"],
body.login-page label[for="user_password"] {
  position: absolute;
  top: 0.6rem;
  left: 0.8rem;
  z-index: 2;
  margin: 0;
  color: #d6d6d6;
  font-size: 0 !important;
  font-weight: 400;
  line-height: 1;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 120ms ease;
}

body.login-page label[for="user_login"]::after {
  content: "Account";
  font-size: 0.875rem;
}

body.login-page label[for="user_password"]::after {
  content: "Password";
  font-size: 0.875rem;
}

body.login-page .form-group:has(input:focus) label[for="user_login"],
body.login-page .form-group:has(input:focus) label[for="user_password"],
body.login-page .form-group:has(input:valid) label[for="user_login"],
body.login-page .form-group:has(input:valid) label[for="user_password"] {
  opacity: 0;
}

/* Share one recovery row between Remember me and the password link. */
body.login-page form[data-testid="sign-in-form"] > .gl-mb-3 {
  width: max-content;
  margin-top: -1rem !important;
  margin-bottom: 0.75rem !important;
  z-index: 3;
}

body.login-page form[data-testid="sign-in-form"] a[href="/users/password/new"],
body.login-page form[data-testid="sign-in-form"] a[href="/users/confirmation/new"] {
  position: relative;
  top: 1rem;
}

/* Use a quiet neutral field border instead of GitLab's blue focus ring. */
body.login-page input.form-control:focus,
body.login-page input.form-control:focus-visible,
body.login-page .input-group:focus-within {
  border: 1px solid #6b6b6b !important;
  outline: none !important;
  box-shadow: none !important;
}
