/* The Eromancer look for the portal's Authelia login page (files.eromancer.com/authelia/).
 *
 * Authelia only has fixed light/dark/grey themes, so this is a stylesheet laid over its "dark" one:
 * bundles/eromancer/portal.nix serves it at /authelia/eromancer-theme.css and adds a <link> to it
 * in the page Authelia sends. The colours are taken from the Eromancer artwork:
 *   red        #d23032   (buttons, accents)
 *   dark red   #c23331   (hover)
 *   navy       #1a1a2c   (cards)
 *   deep navy  #14121e   (page)
 *   black      #030003   (the halftone dots)
 * The selectors are the stable MUI class names Authelia's UI is built from. */

:root {
  --ero-red: #d23032;
  --ero-red-dark: #c23331;
  --ero-red-light: #ee6d6e;
  --ero-navy: #1a1a2c;
  --ero-deep: #14121e;
  --ero-black: #030003;
}

html,
body,
#root {
  background-color: var(--ero-deep) !important;
}

body {
  background-image:
    radial-gradient(ellipse at 50% 120%, rgba(210, 48, 50, 0.55) 0%, rgba(210, 48, 50, 0) 60%),
    linear-gradient(165deg, var(--ero-deep) 0%, var(--ero-navy) 60%, #2a1a26 100%) !important;
  background-attachment: fixed !important;
}

/* halftone dots down both edges, fading towards the middle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, var(--ero-black) 38%, transparent 42%);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 14%, transparent 86%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, transparent 14%, transparent 86%, #000 100%);
}

#root {
  position: relative;
  z-index: 1;
}

/* the login card */
.MuiPaper-root {
  background-color: rgba(26, 26, 44, 0.94) !important;
  border-top: 3px solid var(--ero-red) !important;
}

/* buttons */
.MuiButton-contained,
.MuiButton-containedPrimary {
  background-color: var(--ero-red) !important;
  color: #fff !important;
}

.MuiButton-contained:hover,
.MuiButton-containedPrimary:hover {
  background-color: var(--ero-red-dark) !important;
}

.MuiButton-text,
.MuiButton-outlined {
  color: var(--ero-red-light) !important;
}

/* links */
a,
.MuiLink-root {
  color: var(--ero-red-light) !important;
}

/* form fields: the red replaces Authelia's blue when a field is focused */
.MuiInputLabel-root.Mui-focused {
  color: var(--ero-red-light) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--ero-red) !important;
}

.MuiCheckbox-root.Mui-checked,
.MuiSwitch-switchBase.Mui-checked {
  color: var(--ero-red) !important;
}

.MuiCircularProgress-root,
.MuiLinearProgress-bar {
  color: var(--ero-red) !important;
}

.MuiLinearProgress-bar {
  background-color: var(--ero-red) !important;
}
