/* Inter, the same font as the Grafana card (bundled, OFL) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/-/thmxs/fonts/Inter-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/-/thmxs/fonts/Inter-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/-/thmxs/fonts/Inter-SemiBold.woff2') format('woff2'); }
body.login-page, body.login-page main.content * { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif !important; }
body.login-page input::placeholder { color: #a3adbd !important; opacity: 1; }
body.login-page #sign-in-form button[type='submit'] .gl-button-text, body.login-page .btn-confirm .gl-button-text { font-weight: 600 !important; }
body.login-page .form-text a, body.login-page #sign-in-form .form-text a { font-weight: 400 !important; }

/* Thomaxis sign-in look for GitLab (devise pages only: body.login-page). Same design as the Thomaxis app. */
body.login-page {
  --tx-ink: #1d293d; --tx-muted: #748095; --tx-canvas: #f4f7fc; --tx-paper: #fff; --tx-line: #e3e8f1; --tx-blue: #3568e8;
  background: var(--tx-canvas) !important; background-image: none !important; color: var(--tx-ink);
  font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
body.login-page::before, body.login-page::after { display: none !important; }
body.login-page .footer-container { display: none !important; }
html:has(body.login-page) { height: 100%; }
body.login-page { min-height: 100vh !important; }
body.login-page > .gl-grow.gl-flex.gl-flex-wrap { align-content: center !important; align-items: center !important; justify-content: center !important; }
body.login-page > .gl-grow.gl-flex.gl-flex-wrap > :not(.container.gl-self-center) { display: none !important; }
body.login-page .container.gl-self-center { width: 100%; max-width: 440px; margin: auto !important; padding: 28px 0; }

/* card */
body.login-page main.content > .gl-my-5 {
  margin: 0 !important; padding: 34px; background: var(--tx-paper);
  border: 1px solid var(--tx-line); border-radius: 24px; box-shadow: 0 16px 64px -36px #2c466331;
}
body.login-page .bar { width: 100% !important; max-width: none !important; margin: 0 !important; }

/* heading row: page title on the left, T + Thomaxis on the right */
body.login-page main.content .col-sm-12.gl-text-center {
  display: flex; align-items: center; gap: 6px; padding: 0 !important; margin: 0 0 8px !important; text-align: left !important;
}
body.login-page main.content .col-sm-12.gl-text-center h1 {
  order: 1; margin: 0 auto 0 0 !important; font-size: 0 !important; line-height: 1.2;
}
body.login-page main.content .col-sm-12.gl-text-center h1::before {
  content: 'Sign in'; font-size: 27px; font-weight: 600; letter-spacing: -0.9px; color: var(--tx-ink);
}
body[data-page='passwords:new'] main.content .col-sm-12.gl-text-center h1::before { content: 'Forgot password'; }
body[data-page='passwords:edit'] main.content .col-sm-12.gl-text-center h1::before { content: 'Reset password'; }
body[data-page^='confirmations:'] main.content .col-sm-12.gl-text-center h1::before { content: 'Confirm email'; }
body[data-page^='unlocks:'] main.content .col-sm-12.gl-text-center h1::before { content: 'Unlock account'; }
body[data-page='sessions:create'] main.content .col-sm-12.gl-text-center h1::before { content: 'Verification'; }
/* "GitLab | T Thomaxis": GitLab logo (same size as the T) and a thin separator, before the T */
body.login-page main.content .col-sm-12.gl-text-center::before {
  content: ''; order: 2; flex-shrink: 0; width: 39px; height: 28px; margin-right: 4px;
  background: url('/-/thmxs/gitlab-logo.svg') left center / 28px 28px no-repeat,
              linear-gradient(var(--tx-line), var(--tx-line)) right center / 1px 20px no-repeat;
}
body.login-page main.content .col-sm-12.gl-text-center img {
  order: 3; width: 28px !important; height: 28px !important; margin: 0 !important; object-fit: contain; visibility: visible !important;
}
body.login-page main.content .col-sm-12.gl-text-center::after {
  content: 'Thomaxis'; order: 4; font-size: 17px; font-weight: 650; letter-spacing: -0.6px; color: var(--tx-ink); white-space: nowrap;
}

/* fields */
body.login-page .gl-form-group { margin-bottom: 18px; }
body.login-page .col-form-label, body.login-page .gl-form-group label { padding: 0 0 7px !important; font-size: 12px !important; font-weight: 550 !important; color: var(--tx-ink) !important; }
body.login-page .gl-form-input, body.login-page input.form-control {
  height: 44px !important; border-radius: 9px !important; border: 1px solid #dce2ec !important; box-shadow: none !important;
  background: var(--tx-paper) !important; color: var(--tx-ink) !important; padding-inline: 13px !important; font-size: 13px !important;
}
body.login-page .gl-form-input:focus, body.login-page input.form-control:focus { border-color: #4285f4 !important; box-shadow: 0 0 0 3px #4285f41c !important; outline: none !important; }
body.login-page .gl-form-password-input { position: relative; }
body.login-page .gl-form-password-input button {
  top: 50% !important; transform: translateY(-50%); height: 32px !important; border: 0 !important; background: transparent !important; box-shadow: none !important;
}
body.login-page .form-text a, body.login-page .gl-link { color: var(--tx-ink) !important; font-size: 12px; text-underline-offset: 3px; }
body.login-page .custom-control-label { font-size: 12px; color: var(--tx-ink); }
/* "Forgot your password?" on the label row, like the Thomaxis card */
body.login-page #sign-in-form .gl-form-group { position: relative; }
body.login-page #sign-in-form .gl-form-group .form-text { position: absolute; top: 0; right: 0; margin: 0 !important; }
body.login-page #sign-in-form label[for='user_login'] { font-size: 0 !important; }
body.login-page #sign-in-form label[for='user_login']::before { content: 'Email or username'; font-size: 12px; }
body.login-page #sign-in-form .gl-mb-3:has(#user_remember_me) { display: none; }
body.login-page #sign-in-form button[type='submit'] { margin-top: 4px; }

/* buttons */
body.login-page .btn:not(.gl-form-password-input button) { height: 43px; border-radius: 9px !important; font-size: 13px !important; font-weight: 500; }
body.login-page .btn-confirm {
  background: var(--tx-blue) !important; border-color: var(--tx-blue) !important; color: #fff !important; box-shadow: 0 3px 7px -4px #3568e8aa !important;
}
body.login-page .btn-confirm:hover { background: #2856c9 !important; border-color: #2856c9 !important; }
body.login-page .btn-default {
  background: var(--tx-paper) !important; color: var(--tx-ink) !important; border: 1px solid #dce2ec !important; box-shadow: none !important;
}
body.login-page .btn-default:hover { border-color: #9badd0 !important; }

/* forgot password: shorter hint */
body[data-page='passwords:new'] .form-text.gl-text-subtle { font-size: 0 !important; margin-top: 6px; }
body[data-page='passwords:new'] .form-text.gl-text-subtle::before { content: 'Enter the email of your account.'; font-size: 12px; color: var(--tx-muted); }

/* Same order as the Thomaxis card: description, passkey, "or continue with email", Google / Apple / Microsoft,
   "or use your email", email form. The .bar is a 3-column grid; SSO buttons take one column each. */
body.login-page .bar { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; }
body.login-page .bar > *, body.login-page .bar #js-sign-in-form-app > *, body.login-page .bar::before { grid-column: 1 / -1; order: 7; }
body.login-page .bar::before { content: 'Authorized access only.'; order: 0; margin-bottom: 26px; font-size: 12px; line-height: 1.6; color: var(--tx-muted); }
body[data-page]:not([data-page='sessions:new']) .bar::before { content: none; }
body[data-page]:not([data-page='sessions:new']) main.content .col-sm-12.gl-text-center { margin-bottom: 26px !important; }
body.login-page .bar .js-non-oauth-login, body.login-page .bar #js-sign-in-form-app,
body.login-page .bar .js-oauth-login, body.login-page .bar .tx-sso { display: contents !important; }
body.login-page .bar form[data-testid='passkey-form'] { order: 1 !important; margin: 0 !important; }
body.login-page .bar form[data-testid='passkey-form'] .btn svg { display: none !important; }
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text { font-size: 0 !important; display: inline-flex; align-items: center; gap: 8px; }
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text::before { content: ''; width: 16px; height: 16px; background: url('/-/thmxs/providers/key-round.svg') center / contain no-repeat; }
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text::after { content: 'Sign in with a passkey'; font-size: 13px; }
body.login-page .bar form[data-testid='passkey-form']::after {
  content: 'Or continue with email'; display: block; margin: 24px 0; text-align: center; text-transform: uppercase; font-size: 11px; color: var(--tx-muted);
  background: linear-gradient(var(--tx-line), var(--tx-line)) left center / calc(50% - 92px) 1px no-repeat,
              linear-gradient(var(--tx-line), var(--tx-line)) right center / calc(50% - 92px) 1px no-repeat;
}
/* SSO buttons: real OAuth forms (configured providers) and links to the provider site (not configured yet) */
body.login-page .bar .js-oauth-login > form, body.login-page .bar .tx-sso > a { grid-column: auto !important; margin: 0 !important; }
body.login-page .bar .js-oauth-login > :not(form) { display: none !important; }
body.login-page .bar .js-oauth-login form[action*='google_oauth2'], body.login-page .bar .tx-sso .tx-google { order: 2 !important; }
body.login-page .bar .js-oauth-login form[action*='openid_connect'], body.login-page .bar .tx-sso .tx-apple { order: 3 !important; }
body.login-page .bar .js-oauth-login form[action*='azure_activedirectory_v2'], body.login-page .bar .tx-sso .tx-microsoft { order: 4 !important; }
body.login-page .js-oauth-login .btn, body.login-page .tx-sso > a {
  display: flex !important; align-items: center; justify-content: center; gap: 6px; width: 100%;
  height: 41px !important; border-radius: 9px !important; font-size: 12px !important; font-weight: 500 !important; text-decoration: none !important;
  background: var(--tx-paper) !important; color: var(--tx-ink) !important; border: 1px solid var(--tx-line) !important; box-shadow: none !important;
}
body.login-page .js-oauth-login .btn:hover, body.login-page .tx-sso > a:hover { border-color: #9badd0 !important; }
body.login-page .js-oauth-login .btn img { display: none !important; }
body.login-page .js-oauth-login .btn::before, body.login-page .tx-sso > a::before { content: ''; width: 20px; height: 20px; flex-shrink: 0; background: center / contain no-repeat; }
body.login-page .js-oauth-login form[action*='google_oauth2'] .btn::before, body.login-page .tx-sso .tx-google::before { background-image: url('/-/thmxs/providers/google.svg'); }
body.login-page .js-oauth-login form[action*='azure_activedirectory_v2'] .btn::before, body.login-page .tx-sso .tx-microsoft::before { background-image: url('/-/thmxs/providers/microsoft.svg'); }
body.login-page .js-oauth-login form[action*='openid_connect'] .btn::before, body.login-page .tx-sso .tx-apple::before { background-image: url('/-/thmxs/providers/apple.svg'); }
/* "or use your email" (GitLab's divider when a provider is configured, ours otherwise) */
body.login-page .bar > [data-testid='divider'] { order: 6 !important; display: flex !important; align-items: center; gap: 12px; margin: 22px 0 16px !important; font-size: 0; color: var(--tx-muted); }
body.login-page .bar > [data-testid='divider']::after { content: 'or use your email'; order: 2; font-size: 11px; white-space: nowrap; }
body.login-page .bar > [data-testid='divider'] hr { order: 1; flex: 1; border: 0; border-top: 1px solid var(--tx-line) !important; margin: 0; }
body.login-page .bar > [data-testid='divider'] hr:last-child { order: 3; }
body.login-page .bar > [data-testid='divider'] ~ [data-testid='divider'] { display: none !important; }

@media (max-width: 480px) {
  body.login-page .container.gl-self-center { padding: 20px 18px; }
  body.login-page main.content > .gl-my-5 { padding: 28px 24px; }
}

/* pixel match with the Grafana card */
body.login-page .gl-form-password-input button svg { width: 14px !important; height: 14px !important; }

/* Same typography metrics as Grafana's card (letter-spacing 0.01071em, line-heights) */
body.login-page main.content > .gl-my-5, body.login-page main.content > .gl-my-5 *, body.login-page main.content > .gl-my-5 *::before, body.login-page main.content > .gl-my-5 *::after { letter-spacing: 0.14994px; line-height: 1.57143; }
body.login-page main.content > .gl-my-5 input { letter-spacing: normal !important; }
body.login-page main.content > .gl-my-5 label, body.login-page main.content > .gl-my-5 label * { line-height: 1.25 !important; }
body.login-page #sign-in-form .form-text, body.login-page #sign-in-form .form-text a { line-height: 1.4 !important; }
body.login-page #sign-in-form button[type='submit'] .gl-button-text { line-height: 30px !important; }
body.login-page main.content .col-sm-12.gl-text-center h1, body.login-page main.content .col-sm-12.gl-text-center h1::before { line-height: 1.2 !important; }
body.login-page .bar::before { line-height: 1.6 !important; }
body.login-page main.content > .gl-my-5 label::before { line-height: 1.25 !important; }
/* vertical rhythm of Grafana's card */
body.login-page .bar > [data-testid='divider'] { margin-bottom: 16px !important; }
body.login-page #sign-in-form .gl-form-group:first-of-type { margin-bottom: 18px !important; }
/* label: 7px padding + 4px wrapper margin, like Grafana */
body.login-page #sign-in-form .col-form-label, body.login-page #sign-in-form .gl-form-group > label { padding-bottom: 11px !important; }
/* passkey: icon 16px, 8px, text (the hidden original label must not add a second gap) */
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text { gap: 0 !important; margin: 0 !important; padding: 0 !important; }
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text::before { margin-right: 8px; }
/* Grafana's eye / eye-slash icons */
body.login-page .gl-form-password-input button svg { display: none !important; }
body.login-page .gl-form-password-input button { width: 16px !important; min-width: 16px !important; height: 16px !important; padding: 0 !important; right: 12px !important; }
body.login-page .gl-form-password-input button::before { content: ''; display: block; width: 16px; height: 16px; background: url('/-/thmxs/providers/eye.svg') center / 16px 16px no-repeat; }
body.login-page .gl-form-password-input button[aria-label*='Hide']::before { background-image: url('/-/thmxs/providers/eye-slash.svg'); }
/* hidden original labels (font-size 0) must not add letter-spacing width; the visible text is the pseudo-element */
body.login-page main.content .col-sm-12.gl-text-center h1,
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text,
body.login-page #sign-in-form label[for='user_login'],
body.login-page .bar > [data-testid='divider'],
body[data-page='passwords:new'] .form-text.gl-text-subtle,
body[data-page='passwords:new'] label[for='user_email'] { letter-spacing: 0 !important; }
body.login-page main.content .col-sm-12.gl-text-center h1::before { letter-spacing: -0.9px !important; }
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text::after,
body.login-page #sign-in-form label[for='user_login']::before,
body.login-page .bar > [data-testid='divider']::after,
body[data-page='passwords:new'] .form-text.gl-text-subtle::before { letter-spacing: 0.14994px !important; }
body.login-page .bar form[data-testid='passkey-form'] .btn .gl-button-text::before { transform: translate(0, 0.5px); }

/* ===== Forgot password: same card as Grafana's ===== */
body.login-page main.content .col-sm-12.gl-text-center h1, body.login-page main.content .col-sm-12.gl-text-center h1::before { white-space: nowrap !important; }
body[data-page='passwords:new'] .bar form > .form-group:empty, body[data-page='passwords:new'] .bar form > .devise-errors:empty { display: none !important; }
body[data-page='passwords:new'] .bar form > .form-group { margin: 0 !important; }
body[data-page='passwords:new'] label[for='user_email'] { display: block; margin: 0 !important; padding: 0 0 11px !important; font-size: 12px !important; font-weight: 550 !important; line-height: 1.25 !important; letter-spacing: 0.14994px !important; color: var(--tx-ink) !important; }
body[data-page='passwords:new'] .form-text.gl-text-subtle { margin: 6px 0 0 !important; line-height: 1.5714 !important; }
body[data-page='passwords:new'] .form-text.gl-text-subtle::before { line-height: 1.5714; }
body[data-page='passwords:new'] .bar form > button[type='submit'] { margin-top: 22px !important; }
body[data-page='passwords:new'] .bar form > button[type='submit'] .gl-button-text { font-size: 0 !important; letter-spacing: 0 !important; line-height: 30px !important; }
body[data-page='passwords:new'] .bar form > button[type='submit'] .gl-button-text::before { content: 'Send reset email'; font-size: 13px; font-weight: 600; letter-spacing: 0.14994px; color: #fff; }
body[data-page='passwords:new'] .bar > p.gl-text-center { margin: 14px 0 0 !important; font-size: 13px !important; line-height: 30px !important; color: var(--tx-ink) !important; }
body[data-page='passwords:new'] .bar > p.gl-text-center a { font-size: 13px !important; color: var(--tx-blue) !important; text-decoration: none; }
body[data-page='passwords:new'] .bar form > button[type='submit'] { display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
body[data-page='passwords:new'] .bar form > button[type='submit'] .gl-button-text { margin: 0 !important; padding: 0 !important; }
body[data-page='passwords:new'] .bar form > button[type='submit'] .gl-button-text { display: flex !important; align-items: center !important; height: 43px !important; }
