/* Sannetic Matrix rain: official rules from sannetic/SanneticDesign
   (matrix/matrix-rain.css) plus sign-in-page stacking for GitLab. */

/* --- official matrix-rain.css --- */
/* Sannetic Matrix rain: optional full-viewport backdrop.
   Requires sannetic-styleguide.css and matrix-rain.js.
   Negative z-index keeps it under in-flow content and modals;
   pointer events pass through. */
.matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.78;
}

/* Light theme: the rain is decorative only, keep it quiet */
[data-theme="light"] .matrix-rain,
.light .matrix-rain {
  opacity: 0.35;
}

/* Dense content (tables, forms, cards) sits on a solid surface above the rain */
.matrix-rain-shield {
  background: var(--color-bg);
}

/* --- GitLab sign-in page only (this file is injected solely on /users/sign_in) --- */
html.html-devise-layout {
  background-color: #0f172a;
}

html.html-devise-layout:not(.gl-dark) {
  background-color: #f8fafc;
}

html.html-devise-layout:not(.gl-dark) .matrix-rain,
html.html-devise-layout:not(.gl-dark) body.login-page .matrix-rain {
  opacity: 0.35;
}

body.login-page,
body.login-page .gl-grow,
body.login-page .container,
body.login-page main.content,
body.login-page .footer-container,
body.login-page .gl-self-end {
  background-color: transparent !important;
  background-image: none !important;
}

/* Keep the canvas above the page background, below the form */
body.login-page .matrix-rain {
  z-index: 0;
}

body.login-page .gl-grow,
body.login-page .footer-container,
body.login-page > div {
  position: relative;
  z-index: 1;
}

/* Form surface (Sannetic --color-surface / --color-white) */
body.login-page .bar {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

html.html-devise-layout:not(.gl-dark) body.login-page .bar {
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.12), 0 2px 4px -2px rgb(15 23 42 / 0.08);
}

/* Official lockup reads at ~320px wide; GitLab default logo height is too short */
body.login-page img.js-portrait-logo-detection {
  height: auto !important;
  max-height: 120px;
  max-width: 320px;
  width: auto;
}
