/*
 * sso.jromer.ch login theme, "Alpenglow": a live relief map lit by the real sky.
 * Served by the sso-theme sidecar as /_theme/theme.css, injected before </head>.
 *
 * CONCEPT
 *   The page is a topographic sheet of a valley, lit by one light: the sun (at night a stylised
 *   moon) over St. Gallen at the visitor's current time, computed locally in theme.js. Contours
 *   (every fifth an index contour, as on a Swiss national map) warm with height and brighten on
 *   flanks facing the light; summits facing it glow. The card stands in that valley as a lit
 *   object, the map legend: matte panel, a 1px rim that is bright on the edge facing the light,
 *   a cast shadow falling away from it, crop marks, the sheet coordinates beneath, fine grain.
 *   Swiss-style typography: one grotesk, flush left, tight headline, quiet tracked metadata.
 *
 * SKY PHASES (html[data-jr-phase], from solar elevation; ?_t=dawn|day|dusk|night pins one)
 *   night  sun < -8 deg       moonlit silver-blue     hero #93acf5 -> #d9e3ff, focus #b4c8ff
 *   dawn   -8..8 deg, a.m.    rose                    hero #ff8a9f -> #ffcbb0, focus #ffb3c1
 *   day    >= 8 deg           high-key, gold-white    hero #ffcf7a -> #fff0c9, focus #ffd98f
 *   dusk   -8..8 deg, p.m.    alpenglow (no-JS look)  hero #ff7a59 -> #ffc27a, focus #ffb38a
 *   The light enters over the top of the sheet; x follows the real azimuth (a north-up relief
 *   lit from the south reads inverted, which is why maps are lit from the north-west).
 *
 * PALETTE (dark only in every phase; configuration.yml keeps `theme: dark`)
 *   ink-0  #07090d   page, deepest          ink-1  #0b1017   page, base
 *   panel  #0f151d   card fill (at 84 %)    line   #33465a   contour, valley (dusk)
 *   text-1 #eef1f5   primary text           text-2 #a9b4c2   secondary text, labels
 *   error  #ffb4ab on #2a1416, alert rim #ff8076
 *
 * MOTION VOCABULARY
 *   arrival   0-1.1 s: the map draws outward from the card while the light rises; the card
 *             rises 14 px (760 ms), its contents stagger in, the mark's rings draw on. Then calm.
 *   ambient   contour field drifts (noise z at 0.014/s), 30 fps cap; summit point breathes;
 *             the passkey button catches a slow light sweep every 7 s
 *   pointer   fine pointers only: the light leans toward the cursor (lerped, ~28 % weight);
 *             ridges re-light and the card rim and shadow follow. Touch: ambient only.
 *   controls  lift 1 px on hover, sink 1 px with an inner shadow on press; focus = crisp ring
 *             plus a soft halo of the phase light
 *   failure   rim flushes alert-red with one breath of halo; the contours around the card pull
 *             tight and flush coral for ~1.1 s. No shake.
 *   touch     open sheet only (theme.js): a press dents the terrain and its release sends a ring
 *             wave out; when it reaches the card the crop marks catch it (data-jr-wave, 700 ms).
 *             A tap moves the light for 15 s, a fast drag carves a furrow, and every 10.5 s a
 *             glint runs across the lit ridges.
 *   reduced   prefers-reduced-motion: every transition and keyframe off; theme.js draws one
 *             static, fully lit frame and ignores the pointer
 *
 * TYPE SCALE (Geist variable, wght 100-900, self-hosted; system grotesk fallback)
 *   headline 30/1.1 600 -0.025em   eyebrow 11/1 560 +0.16em caps   body 15/1.45 420
 *   label 15 (MUI notch math unchanged)   button 15 600   meta 11 tabular
 *
 * VERSION COUPLING: Authelia 4.39.20
 *   Every selector below that names an Authelia id or a Mui* class was taken from the DOM dump
 *   of 4.39.20 (verify/run.sh). Emotion hashes (css-*, mui-*) are never used. On ANY Authelia
 *   image bump re-run `theme/verify/run.sh up && run.sh check` before the bump ships.
 *   Coupled selectors:
 *     ids      #root #UserSvg #first-factor-stage #second-factor-stage #form-login
 *              #username-textfield(-label) #password-textfield(-label) #remember-checkbox
 *              #sign-in-button #passkey-sign-in-button #language-button #account-menu
 *              #logout-button #switch-user-button #methods-button #register-link
 *              #one-time-password-method #2fa-container, and [id$="-method"] for the
 *              second-factor method panels
 *     classes  .MuiContainer-maxWidthXs .MuiAppBar-root .MuiTypography-h5 .MuiTypography-h6
 *              .MuiTypography-body1 .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline
 *              .MuiInputBase-input .MuiInputLabel-root .Mui-focused .Mui-error .Mui-disabled
 *              .MuiFormHelperText-root .MuiButton-root .MuiButton-contained .MuiButton-text
 *              .MuiIconButton-root .MuiCheckbox-root .Mui-checked .MuiFormControlLabel-label
 *              .MuiDivider-withChildren .MuiDivider-wrapper .MuiLink-root .MuiAlert-root
 *              .MuiAlert-filledError .MuiAlert-filledSuccess .MuiAlert-filledWarning
 *              .MuiAlert-filledInfo .MuiAlert-message .MuiAlert-icon .MuiSnackbar-root (repositioned)
 *              .MuiAvatar-root .MuiGrid-root .MuiMenu-paper .MuiMenuItem-root
 *              .MuiDialog-paper .MuiCircularProgress-root
 *     other    .information-icon (Authelia's FontAwesome info icon, second factor);
 *              the loader's unclassed `span > span` bars under #root .MuiBox-root;
 *              `legend` inside .MuiOutlinedInput-notchedOutline (the notch)
 */

@font-face {
  font-family: "Geist";
  src: url("/_theme/geist-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --jr-ink-0: #07090d;
  --jr-ink-1: #0b1017;
  --jr-panel: rgba(15, 21, 29, 0.84);
  --jr-panel-solid: #10161e;
  --jr-hair: rgba(214, 226, 240, 0.10);
  --jr-hair-strong: rgba(214, 226, 240, 0.22);
  --jr-text-1: #eef1f5;
  --jr-text-2: #a9b4c2;
  /* Phase tokens. Default = dusk, which is also the no-JS look. theme.js sets
     html[data-jr-phase] from the real sky over St. Gallen (or ?_t=). */
  --jr-glow-1: #ff7a59;
  --jr-glow-2: #ffc27a;
  --jr-focus: #ffb38a;
  --jr-hero-text: #1d0f08;
  --jr-rim: 255 179 138;           /* rim light, RGB triplet */
  --jr-tint: 255 122 89;           /* warm spill, RGB triplet */
  /* Light direction from theme.js (unit vector toward the light, y down). Defaults = dusk. */
  --jr-sun-deg: -58;
  --jr-sx: -0.85;
  --jr-sy: -0.53;
  --jr-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --jr-font: "Geist", ui-sans-serif, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
html[data-jr-phase="dawn"] {
  --jr-glow-1: #ff8a9f; --jr-glow-2: #ffcbb0; --jr-focus: #ffb3c1; --jr-hero-text: #26101a;
  --jr-rim: 255 186 200; --jr-tint: 255 132 156;
}
html[data-jr-phase="day"] {
  /* Cool white light on blue-grey slate; gold stays in the accent only. */
  --jr-glow-1: #ffcf7a; --jr-glow-2: #fff0c9; --jr-focus: #ffd98f; --jr-hero-text: #1d1405;
  --jr-rim: 232 240 255; --jr-tint: 190 212 250;
}
html[data-jr-phase="night"] {
  --jr-glow-1: #93acf5; --jr-glow-2: #d9e3ff; --jr-focus: #b4c8ff; --jr-hero-text: #0b1328;
  --jr-rim: 190 208 250; --jr-tint: 120 150 230;
}

/* ------------------------------------------------------------------ page + CSS-only terrain */
html {
  background-color: var(--jr-ink-1);
  /* Works with JS blocked: dusk sky, a warm glow pooling low right where the canvas puts the
     high ground, and a cold vignette top left. The canvas draws contour lines on top. */
  background-image:
    radial-gradient(120% 90% at 92% 108%, rgba(255, 122, 89, 0.20) 0%, rgba(255, 122, 89, 0.06) 38%, transparent 62%),
    radial-gradient(80% 70% at 100% 100%, rgba(255, 194, 122, 0.10) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 0%, rgba(67, 97, 130, 0.22) 0%, transparent 60%),
    linear-gradient(180deg, var(--jr-ink-0) 0%, var(--jr-ink-1) 55%, #0e131b 100%);
  background-attachment: fixed;
  min-height: 100%;
}

html body {
  background: transparent !important;
  color: var(--jr-text-1);
  font-family: var(--jr-font) !important;
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

#root,
#root .MuiTypography-root,
#root .MuiButton-root,
#root .MuiInputBase-input,
#root .MuiInputLabel-root,
#root .MuiFormControlLabel-label,
.MuiSnackbar-root .MuiAlert-root,
.MuiMenu-paper,
.MuiDialog-paper {
  font-family: var(--jr-font) !important;
}

/* Canvas from theme.js: fixed, behind the app, inert. */
.jr-terrain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

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

/* Film grain from theme.js: one static canvas over everything, felt more than seen. */
.jr-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  display: block;
  opacity: 0.045;
  mix-blend-mode: overlay;
}

/* A topographic sheet's own margin detail: scale bar, bottom left. Pure CSS, no JS needed. */
html body::after {
  content: "0 \2003\2003\2003\2003\2003 500 m";
  position: fixed;
  left: clamp(16px, 3vw, 36px);
  bottom: clamp(14px, 2.6vh, 28px);
  z-index: 1;
  padding-top: 9px;
  font: 500 10px/1 var(--jr-font);
  letter-spacing: 0.08em;
  color: rgba(169, 180, 194, 0.55);
  font-variant-numeric: tabular-nums;
  background:
    linear-gradient(90deg, rgba(169, 180, 194, 0.55) 0 50%, transparent 50% 100%) 0 0 / 100% 3px no-repeat,
    linear-gradient(rgba(169, 180, 194, 0.55), rgba(169, 180, 194, 0.55)) 0 3px / 100% 1px no-repeat;
  border-left: 1px solid rgba(169, 180, 194, 0.55);
  border-right: 1px solid rgba(169, 180, 194, 0.55);
  pointer-events: none;
}

/* ------------------------------------------------------------------ top bar */
#root .MuiAppBar-root {
  background: transparent !important;
  box-shadow: none !important;
}

#language-button,
#account-menu {
  border-radius: 999px !important;
  padding: 6px 12px !important;
  color: var(--jr-text-2) !important;
  border: 1px solid var(--jr-hair) !important;
  background: rgba(15, 21, 29, 0.5) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
#account-menu { padding: 3px !important; }
#language-button:hover,
#account-menu:hover {
  color: var(--jr-text-1) !important;
  border-color: var(--jr-hair-strong) !important;
}
#language-button .MuiTypography-root {
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em;
}
#account-menu .MuiAvatar-root {
  background: linear-gradient(135deg, var(--jr-glow-1), var(--jr-glow-2)) !important;
  color: var(--jr-hero-text) !important;
  font-weight: 650 !important;
  width: 30px !important;
  height: 30px !important;
  font-size: 14px !important;
}

/* ------------------------------------------------------------------ the card (map legend) */
#root .MuiContainer-maxWidthXs {
  position: relative;
  max-width: min(440px, calc(100vw - 24px)) !important;
  margin-top: 28px;
  margin-bottom: 56px;
  padding: 30px clamp(20px, 6vw, 36px) 22px !important;
  /* A lit object, not a slab. Layer 1 is the panel (padding box); layer 2 sits under it on the
     border box and IS the 1px border: hairline on the shadowed side, a bright rim on the edge
     facing the light (--jr-sun-deg, from theme.js, follows the light and the cursor). The rim
     layer also bleeds faintly through the panel on that side, which reads as light spill. */
  background:
    linear-gradient(var(--jr-panel), var(--jr-panel)) padding-box,
    linear-gradient(calc(var(--jr-sun-deg) * 1deg),
      rgba(214, 226, 240, 0.07) 0%, rgba(214, 226, 240, 0.09) 52%,
      rgb(var(--jr-rim) / 0.35) 78%, rgb(var(--jr-rim) / 0.95) 100%) border-box;
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid transparent;
  border-radius: 20px;
  /* Cast shadow falls AWAY from the light; a warm spill lands on the lit side. */
  --jr-card-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 0 0 1px rgba(0, 0, 0, 0.32),
    calc(var(--jr-sx) * -22px) calc(var(--jr-sy) * -22px + 18px) 44px -14px rgba(0, 0, 0, 0.7),
    calc(var(--jr-sx) * -70px) calc(var(--jr-sy) * -70px + 30px) 140px 10px rgba(3, 5, 8, 0.55),
    calc(var(--jr-sx) * 46px) calc(var(--jr-sy) * 46px) 120px -30px rgb(var(--jr-tint) / 0.22);
  box-shadow: var(--jr-card-shadow);
  animation: jr-rise 760ms var(--jr-ease-out) 60ms both;
}
/* Failed sign-in: the rim flushes error-red and a red halo breathes once (theme.js also
   tightens the contours around the card). No shake. */
html[data-jr-alert="on"] #root .MuiContainer-maxWidthXs {
  --jr-rim: 255 128 118;
  animation: jr-rise 760ms var(--jr-ease-out) 60ms both, jr-alert 1200ms ease-out both;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #root .MuiContainer-maxWidthXs { background: rgba(15, 21, 29, 0.96); }
}

/* Crop marks just outside the four corners, like registration marks on a printed sheet. */
#root .MuiContainer-maxWidthXs::before {
  content: "";
  position: absolute;
  inset: -11px;
  pointer-events: none;
  --m: rgb(var(--jr-rim) / 0.55);
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 12px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 12px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 1px 12px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 12px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 1px 12px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 12px 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 1px 12px no-repeat;
}

/* The sheet's coordinates (St. Gallen), set under the card's left edge. */
#root .MuiContainer-maxWidthXs::after {
  content: "N 47\00B0 25\2032 \2002 E 9\00B0 22\2032 \2002 670 m";
  position: absolute;
  left: 2px;
  top: calc(100% + 18px);
  font: 500 10.5px/1 var(--jr-font);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: rgba(169, 180, 194, 0.62);
  white-space: nowrap;
  pointer-events: none;
}

/* Grid inside the card: flush left, Swiss style. */
#root .MuiContainer-maxWidthXs > .MuiGrid-root { text-align: left; }

/* Authelia's avatar icon: shrunk to a calm slot. When theme.js runs, the brand mark sits in
   that slot and the icon is hidden. Without JS the stock icon stays (smaller, muted). */
#UserSvg {
  width: 44px !important;
  height: 44px !important;
  opacity: 0.5;
  margin: 0 !important;
}
html[data-jr-theme="on"] #UserSvg { visibility: hidden; }
#root .MuiGrid-root:has(> #UserSvg) {
  display: flex;
  justify-content: flex-start;
  padding-top: 0 !important;
  margin-bottom: 18px;
}

/* Eyebrow + headline */
#root .MuiContainer-maxWidthXs .MuiTypography-h5 {
  font-size: 30px !important;
  line-height: 1.1 !important;
  font-weight: 600 !important;
  letter-spacing: -0.025em !important;
  color: var(--jr-text-1);
  text-align: left;
  margin: 0 0 6px !important;
}
#root .MuiContainer-maxWidthXs .MuiTypography-h5::before {
  content: "Single sign-on";
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  line-height: 1;
  font-weight: 560;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jr-text-2);
  padding-left: 26px;
  background: linear-gradient(90deg, var(--jr-glow-1), var(--jr-glow-2)) 0 50% / 16px 1.5px no-repeat;
}
#root .MuiGrid-root:has(> .MuiTypography-h5) {
  padding-top: 0 !important;
  padding-bottom: 10px !important;
}

#root .MuiContainer-maxWidthXs .MuiTypography-h6 {
  font-size: 17px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  color: var(--jr-text-1);
}
#root .MuiContainer-maxWidthXs .MuiTypography-body1 {
  color: var(--jr-text-2);
  font-size: 15px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ inputs */
#root .MuiOutlinedInput-root {
  border-radius: 12px !important;
  background: rgba(214, 226, 240, 0.035);
  transition: background-color 200ms ease, box-shadow 220ms ease;
}
#root .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline {
  border-color: rgba(214, 226, 240, 0.30) !important;
  border-radius: 12px !important;
  transition: border-color 180ms ease, border-width 180ms ease;
}
#root .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(214, 226, 240, 0.48) !important;
}
#root .MuiOutlinedInput-root:hover { background: rgba(214, 226, 240, 0.055); }
#root .MuiOutlinedInput-root.Mui-focused {
  background: rgb(var(--jr-rim) / 0.045);
  box-shadow: 0 0 0 4px rgb(var(--jr-tint) / 0.16), 0 8px 24px -12px rgb(var(--jr-tint) / 0.5);
}
#root .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--jr-focus) !important;
  border-width: 1.5px !important;
}
#root .MuiOutlinedInput-root.Mui-error .MuiOutlinedInput-notchedOutline {
  border-color: #ff8f84 !important;
}
#root .MuiInputBase-input {
  color: var(--jr-text-1) !important;
  font-size: 15px !important;
  caret-color: var(--jr-glow-2);
  letter-spacing: 0.005em;
}
/* Keep Chrome's autofill from painting a pale box on the dark card. */
#root .MuiInputBase-input:-webkit-autofill,
#root .MuiInputBase-input:-webkit-autofill:hover,
#root .MuiInputBase-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--jr-text-1);
  -webkit-box-shadow: 0 0 0 100px #151c25 inset;
  caret-color: var(--jr-glow-2);
  border-radius: 12px;
  transition: background-color 9999s ease 0s;
}
#root .MuiInputLabel-root {
  color: var(--jr-text-2) !important;
  transition: color 180ms ease, transform 200ms var(--jr-ease-out), max-width 200ms ease !important;
}
#root .MuiInputLabel-root.Mui-focused { color: var(--jr-focus) !important; }
#root .MuiInputLabel-root.Mui-error,
#root .MuiFormHelperText-root.Mui-error { color: #ffb4ab !important; }
#root .MuiFormHelperText-root { color: var(--jr-text-2); }
#root .MuiInputLabel-asterisk { color: inherit; opacity: 0.7; }

#root .MuiInputAdornment-root .MuiIconButton-root {
  color: var(--jr-text-2);
  transition: color 160ms ease, background-color 160ms ease;
}
#root .MuiInputAdornment-root .MuiIconButton-root:hover {
  color: var(--jr-text-1);
  background: rgba(214, 226, 240, 0.06);
}

/* Remember me */
#root .MuiCheckbox-root { color: rgba(214, 226, 240, 0.55) !important; }
#root .MuiCheckbox-root.Mui-checked { color: var(--jr-glow-2) !important; }
#root .MuiFormControlLabel-label {
  color: var(--jr-text-2) !important;
  font-size: 14px !important;
}

/* ------------------------------------------------------------------ buttons */
#root .MuiButton-root {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  border-radius: 12px !important;
  transition:
    transform 200ms var(--jr-ease-out),
    box-shadow 220ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease !important;
}
#root .MuiButton-contained {
  min-height: 48px;
  box-shadow: none !important;
}
#root .MuiButton-contained:hover { transform: translateY(-1px); }
/* Press: the button sinks into the card (down 1px, inner shadow), quicker in than out. */
#root .MuiButton-contained:active {
  transform: translateY(1px) scale(0.99);
  transition-duration: 60ms !important;
}
#sign-in-button:active {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45) !important;
  background: rgba(214, 226, 240, 0.06) !important;
}

/* Password submit: quiet, neutral; the passkey is the path people actually take. */
#sign-in-button {
  background: rgba(214, 226, 240, 0.08) !important;
  color: var(--jr-text-1) !important;
  border: 1px solid rgba(214, 226, 240, 0.18) !important;
}
#sign-in-button:hover {
  background: rgba(214, 226, 240, 0.13) !important;
  border-color: rgba(214, 226, 240, 0.30) !important;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.8) !important;
}

/* Passkey: the hero, lit by the same alpenglow as the summits. */
#passkey-sign-in-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--jr-glow-1) 0%, var(--jr-glow-2) 100%) !important;
  color: var(--jr-hero-text) !important;
  border: 0 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 -1px 0 rgba(0, 0, 0, 0.12) inset,
    0 12px 28px -12px rgb(var(--jr-tint) / 0.7) !important;
}
#passkey-sign-in-button:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 -1px 0 rgba(0, 0, 0, 0.12) inset,
    0 18px 36px -12px rgb(var(--jr-tint) / 0.85) !important;
}
#passkey-sign-in-button:active {
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.28),
    0 6px 14px -10px rgb(var(--jr-tint) / 0.7) !important;
}
#passkey-sign-in-button::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.42) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  /* A slow light sweep every 7 s, like the sun glancing off it; faster on hover. */
  animation: jr-sweep 7s cubic-bezier(0.45, 0, 0.2, 1) 1.6s infinite;
}
#passkey-sign-in-button:hover::after {
  animation: jr-sheen 900ms var(--jr-ease-out) both;
}
#passkey-sign-in-button .MuiButton-startIcon,
#passkey-sign-in-button .MuiButton-startIcon svg {
  color: var(--jr-hero-text) !important;
  fill: currentColor !important;
  opacity: 0.9;
}

#root .MuiButton-root.Mui-disabled {
  opacity: 0.55;
  color: var(--jr-text-1) !important;
}

/* Text buttons (second factor: logout, switch user, methods) */
#root .MuiButton-text {
  color: var(--jr-text-2) !important;
  border-radius: 10px !important;
}
#root .MuiButton-text:hover {
  color: var(--jr-text-1) !important;
  background: rgba(214, 226, 240, 0.06) !important;
}

/* "or" divider */
#root .MuiDivider-withChildren::before,
#root .MuiDivider-withChildren::after {
  border-top-color: rgba(214, 226, 240, 0.12) !important;
}
#root .MuiDivider-wrapper .MuiTypography-root {
  font-size: 11px !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase;
  color: var(--jr-text-2) !important;
}

/* Links */
#root .MuiLink-root {
  color: var(--jr-text-2) !important;
  text-decoration-color: rgba(169, 180, 194, 0.4) !important;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}
#root .MuiLink-root:hover { color: var(--jr-glow-2) !important; }
#root #register-link { color: var(--jr-focus) !important; font-weight: 550; }

/* "Powered by Authelia" footer: kept, set as a quiet colophon. */
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-container:last-child {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 226, 240, 0.08);
  justify-content: center;
}
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-container:last-child > .MuiGrid-root {
  max-width: none !important;
  flex-basis: auto !important;
  width: auto !important;
}
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-container:last-child .MuiLink-root {
  font-size: 12px !important;
  letter-spacing: 0.02em;
}

/* Second-factor method panel (one-time password, WebAuthn, push): Authelia draws it with a
   near-white outline; set it as an inset legend box instead. */
#second-factor-stage .MuiBox-root:has(> [id$="-method"]) {
  border: 1px solid rgba(214, 226, 240, 0.14) !important;
  border-radius: 16px !important;
  background: rgba(214, 226, 240, 0.03);
}
#root .information-icon {
  color: var(--jr-glow-2) !important;
  width: 36px !important;
  height: 36px !important;
}

/* Spinners */
#root .MuiCircularProgress-root { color: var(--jr-glow-2) !important; }

/* ------------------------------------------------------------------ notifications, menus */
/* Authelia anchors its snackbar top-right, exactly where the language pill sits. Bottom-centre
   instead, on every size: it can never cover the pill, and on phones it lands under the thumb. */
.MuiSnackbar-root {
  top: auto !important;
  right: auto !important;
  left: 50% !important;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  transform: translateX(-50%) !important;
  width: max-content;
  max-width: calc(100vw - 24px);
  justify-content: center !important;
}
.MuiSnackbar-root .MuiAlert-root {
  border-radius: 14px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8) !important;
}
.MuiSnackbar-root .MuiAlert-filledError {
  background: rgba(42, 20, 22, 0.94) !important;
  color: #ffd9d4 !important;
  border: 1px solid rgba(255, 143, 132, 0.45);
}
.MuiSnackbar-root .MuiAlert-filledError .MuiAlert-icon { color: #ff8f84 !important; }
.MuiSnackbar-root .MuiAlert-filledSuccess {
  background: rgba(16, 36, 28, 0.94) !important;
  color: #c9f2dc !important;
  border: 1px solid rgba(120, 220, 170, 0.4);
}
.MuiSnackbar-root .MuiAlert-filledWarning {
  background: rgba(40, 30, 12, 0.94) !important;
  color: #ffe2b0 !important;
  border: 1px solid rgba(255, 194, 122, 0.45);
}
.MuiSnackbar-root .MuiAlert-filledInfo {
  background: rgba(16, 26, 40, 0.94) !important;
  color: #d2e3f7 !important;
  border: 1px solid rgba(140, 180, 230, 0.4);
}
.MuiMenu-paper,
.MuiDialog-paper {
  background: #121922 !important;
  color: var(--jr-text-1) !important;
  border: 1px solid var(--jr-hair);
  border-radius: 14px !important;
}
.MuiMenuItem-root:hover { background: rgba(214, 226, 240, 0.06) !important; }

/* ------------------------------------------------------------------ focus rings */
/* Tactile focus: a crisp 2px ring plus a soft halo of the same light, so focus reads as the
   control being lit rather than boxed. */
#root :focus-visible,
.MuiMenu-paper :focus-visible,
.MuiDialog-paper :focus-visible {
  outline: 2px solid var(--jr-focus) !important;
  outline-offset: 3px !important;
}
#root .MuiButton-root:focus-visible {
  box-shadow: 0 0 0 7px rgb(var(--jr-rim) / 0.16), 0 10px 26px -12px rgb(var(--jr-tint) / 0.7) !important;
}
/* Inputs show focus on their own outline + halo; no second ring on the bare <input>. */
#root .MuiInputBase-input:focus-visible { outline: none !important; }
#root .MuiCheckbox-root:has(input:focus-visible) {
  outline: 2px solid var(--jr-focus);
  outline-offset: -4px;
  border-radius: 10px;
}

/* ------------------------------------------------------------------ labels above fields
   The floating label cut into a notched outline is Material's signature; here the label sits
   above the field, always, and the outline closes. MUI's own label element is kept (it is the
   accessible name), only positioned. */
#root .MuiTextField-root { margin-top: 24px; }
#root .MuiTextField-root .MuiInputLabel-root,
#root .MuiTextField-root .MuiInputLabel-root.MuiInputLabel-shrink {
  transform: translate(2px, -24px) scale(1) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em;
  max-width: 100% !important;
}
#root .MuiTextField-root .MuiOutlinedInput-notchedOutline legend {
  max-width: 0.01px !important;
  padding: 0 !important;
}
#root .MuiTextField-root .MuiOutlinedInput-input {
  padding-top: 13px !important;
  padding-bottom: 13px !important;
}

/* ------------------------------------------------------------------ Authelia's loading state
   The first thing every visitor sees (~0.3 s): its six white bars take the phase light and
   the label becomes quiet tracked caps. */
#root .MuiBox-root > span:not([class]) > span:not([class]) {
  background: linear-gradient(180deg, var(--jr-glow-2), var(--jr-glow-1)) !important;
  border-radius: 2px;
}
#root .MuiBox-root:has(> span:not([class]) > span:not([class])) ~ .MuiBox-root .MuiTypography-root {
  font-size: 11px !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  color: var(--jr-text-2) !important;
}

/* ------------------------------------------------------------------ brand mark (theme.js) */
.jr-brand {
  position: absolute;
  z-index: 2;
  display: none;
  align-items: center;
  gap: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--jr-text-1);
}
.jr-brand--on { display: flex; animation: jr-fade 700ms var(--jr-ease-out) 120ms both; }
.jr-brand__glyph { width: 40px; height: 40px; flex: none; overflow: visible; }
.jr-brand__word {
  font: 600 19px/1 var(--jr-font);
  letter-spacing: -0.02em;
}
.jr-brand__tld { color: var(--jr-glow-2); font-weight: 500; }
.jr-ring--1 { stroke: #5b6f86; }
.jr-ring--2 { stroke: #8b9db1; }
.jr-ring--3 { stroke: var(--jr-glow-1); }
.jr-summit { fill: var(--jr-glow-2); }
.jr-ring {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  animation: jr-draw 900ms var(--jr-ease-out) both;
}
.jr-ring--2 { animation-delay: 80ms; }
.jr-ring--3 { animation-delay: 160ms; }
.jr-summit {
  transform-origin: 25.6px 18.8px;
  animation: jr-breathe 4.8s ease-in-out 1.2s infinite;
}

/* ------------------------------------------------------------------ entrance choreography */
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-root,
#form-login > .MuiGrid-container > .MuiGrid-root {
  animation: jr-fade-up 620ms var(--jr-ease-out) both;
}
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-root:nth-child(1) { animation-delay: 80ms; }
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-root:nth-child(2) { animation-delay: 140ms; }
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-root:nth-child(3) { animation-delay: 200ms; }
#root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-root:nth-child(4) { animation-delay: 420ms; }
#form-login > .MuiGrid-container > .MuiGrid-root:nth-child(1) { animation-delay: 220ms; }
#form-login > .MuiGrid-container > .MuiGrid-root:nth-child(2) { animation-delay: 280ms; }
#form-login > .MuiGrid-container > .MuiGrid-root:nth-child(3) { animation-delay: 340ms; }
#form-login > .MuiGrid-container > .MuiGrid-root:nth-child(4) { animation-delay: 400ms; }
#form-login > .MuiGrid-container > .MuiGrid-root:nth-child(5) { animation-delay: 440ms; }
#form-login > .MuiGrid-container > .MuiGrid-root:nth-child(6) { animation-delay: 480ms; }

@keyframes jr-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
@keyframes jr-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes jr-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes jr-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
/* A ring wave from a press on the sheet reaches the card: the registration marks catch it. */
html[data-jr-wave="on"] #root .MuiContainer-maxWidthXs::before {
  animation: jr-wave 700ms ease-out both;
}
@keyframes jr-wave {
  0% { filter: none; transform: none; }
  22% { filter: brightness(2.2); transform: scale(1.012); }
  100% { filter: none; transform: none; }
}
@keyframes jr-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.6); }
}
@keyframes jr-sweep {
  0% { left: -60%; opacity: 0.55; }
  16% { left: 120%; opacity: 0.55; }
  100% { left: 120%; opacity: 0; }
}
@keyframes jr-alert {
  0% { box-shadow: 0 0 0 1px rgba(255, 128, 118, 0), 0 0 0 0 rgba(255, 110, 100, 0), var(--jr-card-shadow); }
  18% { box-shadow: 0 0 0 1px rgba(255, 128, 118, 0.9), 0 0 46px 6px rgba(255, 110, 100, 0.28), var(--jr-card-shadow); }
  100% { box-shadow: 0 0 0 1px rgba(255, 128, 118, 0), 0 0 0 0 rgba(255, 110, 100, 0), var(--jr-card-shadow); }
}
@keyframes jr-sheen {
  from { left: -60%; }
  to { left: 120%; }
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 420px) {
  #root .MuiContainer-maxWidthXs {
    margin-top: 4px;
    border-radius: 18px;
    padding: 22px 20px 16px !important;
  }
  #root .MuiGrid-root:has(> #UserSvg) { margin-bottom: 12px; }
  #root .MuiContainer-maxWidthXs .MuiTypography-h5::before { margin-bottom: 9px; }
  #root .MuiContainer-maxWidthXs > .MuiGrid-root > .MuiGrid-container:last-child { margin-top: 12px; padding-top: 10px; }
  #root .MuiContainer-maxWidthXs .MuiTypography-h5 { font-size: 27px !important; }
  #root .MuiContainer-maxWidthXs::before { inset: -7px; }
  html body::after { display: none; }
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  #root .MuiButton-contained:hover,
  #root .MuiButton-contained:active { transform: none; }
}
