/* ===========================================================================
   Authelia — 2001 skin.
   Injected into auth.2001a.us by NPM host 45 (sub_filter). Same-origin CSS,
   so the existing CSP (style-src 'self') needs no change.

   Source design: ~/stacks/design/2001/mockups/login-3col
   Assets:        /authelia/bg.png  (retrieved from the old Authentik flow)
   =========================================================================== */

:root {
  --ah-bg: #05060a;
  --ah-ink: #e9e6df;
  --ah-dim: #9a958a;
  --ah-mute: #6e6a61;
  --ah-gold: #e8c37a;
  --ah-amber: #ffb347;
  --ah-hal: #ff2b2b;
  --ah-hal-deep: #3a0505;
  --ah-line: rgba(232, 195, 122, .22);
  --ah-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html, body { background: var(--ah-bg) !important; }
body {
  color: var(--ah-ink) !important;
  font-family: var(--ah-mono) !important;
  -webkit-font-smoothing: antialiased;
}

/* Authelia's own header/logo is replaced by the injected brand block. */
header { display: none !important; }
#root img[alt*="logo" i] { display: none !important; }
#root h5 { display: none !important; }
#root > div:last-child > div:last-child .flex.flex-col.items-stretch > .w-full.p-2 { display: none !important; }

/* three-column shell: form | photo | photo */
#root > div:last-child {
  display: grid !important;
  grid-template-columns: minmax(380px, 34%) 1fr 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
  background: var(--ah-bg);
}

#root > div:last-child > div:last-child {
  grid-column: 1;
  grid-row: 1;
  min-height: 100vh;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 320px clamp(24px, 4vw, 72px) 48px !important;
}

#root > div:last-child > div:last-child > div {
  margin: 0 !important;
  max-width: 380px;
  width: 100%;
  padding: 0 !important;
}

#root > div:last-child::before,
#root > div:last-child::after {
  content: "";
  grid-row: 1;
  background-color: #000;
  background-image:
    linear-gradient(180deg,
      rgba(5, 6, 10, .10) 0%,
      rgba(5, 6, 10, .55) 55%,
      rgba(5, 6, 10, .94) 100%),
    url('/authelia/bg.png');
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.05) brightness(.82);
}
#root > div:last-child::before { grid-column: 2 / 4; background-position: center; }
#root > div:last-child::after { content: none; }

/* form */
#form-login { width: 100%; }
#form-login input {
  background: transparent !important;
  border: 1px solid var(--ah-line) !important;
  border-radius: 8px !important;
  color: var(--ah-ink) !important;
  font: 14px var(--ah-mono) !important;
}
#form-login input:focus {
  border-color: var(--ah-gold) !important;
  box-shadow: 0 0 0 3px rgba(232, 195, 122, .12) !important;
}
#form-login label {
  color: var(--ah-dim) !important;
  font-size: 11px !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
}
#sign-in-button {
  background: rgba(232, 195, 122, .06) !important;
  color: var(--ah-gold) !important;
  border: 1px solid var(--ah-gold) !important;
  border-radius: 8px !important;
  letter-spacing: .24em !important;
  text-transform: uppercase !important;
  font: 13px var(--ah-mono) !important;
}
#sign-in-button:hover,
#sign-in-button:focus-visible {
  background: var(--ah-gold) !important;
  color: #0a0a10 !important;
}
#form-login button:not(#sign-in-button):not(#remember-checkbox) {
  background: transparent !important;
  border: 1px solid var(--ah-line) !important;
  color: var(--ah-ink) !important;
}
#form-login [role="separator"] { background: var(--ah-line) !important; }
#remember-checkbox { border-color: var(--ah-line) !important; }

#root h1, #root h2, #root h3, #root p, #root span, #root label { color: var(--ah-ink) !important; }
#root a { color: var(--ah-gold) !important; }
#root [role="alert"], #root .text-destructive { color: #ff5b5b !important; }

/* injected brand / quote / info */
#ah-brand {
  position: fixed;
  left: clamp(24px, 4vw, 72px);
  top: clamp(28px, 7vh, 88px);
  width: min(30vw, 360px);
  z-index: 5;
}
#ah-brand .ah-eye {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #ffd24a 0 24%, var(--ah-hal) 25% 62%, var(--ah-hal-deep) 63% 100%);
  box-shadow: 0 0 18px rgba(255, 43, 43, .75), 0 0 42px rgba(255, 43, 43, .28);
  transform-origin: center;
  animation: ah-pulse 6s cubic-bezier(.2, .7, .2, 1) infinite;
}
#ah-brand .ah-eye::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 43, 43, .35), transparent 70%);
  animation: ah-glow 6s cubic-bezier(.2, .7, .2, 1) infinite;
}
@keyframes ah-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.35); }
}
@keyframes ah-glow {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: .8; transform: scale(1.15); }
}
#ah-brand .ah-kicker {
  display: block;
  margin: 14px 0 10px;
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ah-dim) !important;
}
#ah-brand h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.06;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ah-gold) !important;
  font-weight: 600;
}
#ah-brand .ah-sub {
  margin: 14px 0 0;
  color: var(--ah-dim) !important;
  letter-spacing: .04em;
}

#ah-quote {
  position: fixed;
  left: 34%;
  width: 33%;
  bottom: 6vh;
  padding: 0 2.4vw;
  z-index: 5;
}
#ah-quote blockquote {
  margin: 0;
  font-size: clamp(18px, 1.7vw, 28px);
  line-height: 1.3;
  color: var(--ah-ink) !important;
  text-wrap: balance;
}
#ah-quote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ah-amber) !important;
}

#ah-info {
  position: fixed;
  right: clamp(18px, 2vw, 36px);
  bottom: clamp(18px, 3vh, 38px);
  width: min(28vw, 320px);
  padding: 16px 18px;
  border: 1px solid var(--ah-line);
  border-radius: 10px;
  background: rgba(14, 14, 20, .86);
  z-index: 5;
}
#ah-info h2 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ah-amber) !important;
}
#ah-info ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  color: var(--ah-dim) !important;
}

/* static scanlines; no animation, no backdrop-filter */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: repeating-linear-gradient(180deg,
    rgba(255, 255, 255, .022) 0 1px,
    transparent 1px 3px);
  opacity: .35;
}

@media (prefers-reduced-motion: reduce) {
  #ah-brand .ah-eye,
  #ah-brand .ah-eye::after { animation: none; }
}

/* mobile: brand, form, then the two photos, then the quote/info */
@media (max-width: 980px) {
  #root > div:last-child {
    grid-template-columns: 1fr;
  }
  #root > div:last-child > div:last-child {
    grid-row: 1;
    min-height: auto;
    padding: 24px 24px 48px !important;
  }
  #root > div:last-child::before {
    grid-column: 1;
    grid-row: 2;
    min-height: 46vh;
  }
  #root > div:last-child::after { content: none; }

  #ah-brand {
    position: static;
    width: auto;
    padding: 32px 24px 8px;
  }
  #ah-brand h1 { max-width: none; }
  #ah-quote, #ah-info {
    position: static;
    width: auto;
  }
  #ah-quote { padding: 24px; }
  #ah-info { margin: 0 24px 32px; }
  body::after { display: none; }
}
