/* ── DataHarvester Authelia Theme v2 ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

/* ── Background ── */
html, body {
  background: #03060f !important;
  font-family: 'JetBrains Mono', monospace !important;
}

/* Grid overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Scanlines */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,.05) 2px, rgba(0,0,0,.05) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* Pink-purple radial glow at centre, pulses slowly */
#root::before {
  content: '';
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 900px; height: 650px;
  background: radial-gradient(ellipse,
    rgba(160,0,200,.07) 0%,
    rgba(99,102,241,.04) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bg-pulse 5s ease-in-out infinite;
}
@keyframes bg-pulse {
  0%,100% { opacity: .7; transform: translate(-50%,-50%) scale(1); }
  50%      { opacity: 1;  transform: translate(-50%,-50%) scale(1.12); }
}

/* ────────────────────────────────────────────────────────────────────────────
   LOGO  —  gray cold start → neon ignition at 6 s → repeating flicker
   ──────────────────────────────────────────────────────────────────────────── */
img[alt="Authelia"],
img[alt="Logo"],
header img,
.logo img,
.logo {
  width: 480px !important;
  max-width: 88vw !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto 6px !important;
  /* warmup once (9 s), then flicker repeats forever (starts at 9 s) */
  animation:
    logo-warmup 9s cubic-bezier(.4,0,.2,1) forwards,
    logo-flicker 10s 9s infinite !important;
}

/* Cold gray → neon-tube warm-up sequence */
@keyframes logo-warmup {
  /* ── 0–6 s : cold, desaturated ── */
  0%, 65% {
    filter: invert(1) grayscale(1) brightness(0.55);
    opacity: .72;
  }
  /* ── 6 s : first ignition spark ── */
  67% { filter: invert(1) grayscale(.6) brightness(2.2) drop-shadow(0 0 8px #ff9ef7);  opacity: 1;   }
  69% { filter: invert(1) grayscale(1)  brightness(0.4);                                opacity: .6;  }  /* dip */
  /* ── second spark, stronger ── */
  71% { filter: invert(1) grayscale(.3) brightness(1.9)
              drop-shadow(0 0 14px #ff6ef7) drop-shadow(0 0 30px #f000e0);             opacity: 1;   }
  73% { filter: invert(1) grayscale(.9) brightness(0.5);                               opacity: .75; }  /* dip */
  /* ── third spark — colour visible ── */
  75% { filter: invert(1) grayscale(.1) brightness(1.6)
              drop-shadow(0 0 12px #ff6ef7) drop-shadow(0 0 32px #f000e0)
              drop-shadow(0 0 55px #c000b0);                                            opacity: 1;   }
  /* ── settling, building glow ── */
  80% { filter: invert(1) brightness(.9)
              drop-shadow(0 0 8px #ff6ef7) drop-shadow(0 0 22px #f000e0)
              drop-shadow(0 0 45px #c000b0);                                            opacity: .92; }
  /* ── brief pre-full-brightness dim ── */
  87% { filter: invert(1) brightness(.35) drop-shadow(0 0 4px #ff6ef7);               opacity: .55; }
  /* ── FULL NEON — stays here (forwards fill) ── */
  100% {
    filter: invert(1)
            drop-shadow(0 0 8px #ff6ef7)
            drop-shadow(0 0 22px #f000e0)
            drop-shadow(0 0 55px #c000b0)
            drop-shadow(0 0 100px #9000a0);
    opacity: 1;
  }
}

/* Repeating neon flicker after warm-up */
@keyframes logo-flicker {
  0%, 87% {
    opacity: 1;
    filter: invert(1) drop-shadow(0 0 8px #ff6ef7) drop-shadow(0 0 22px #f000e0)
            drop-shadow(0 0 55px #c000b0) drop-shadow(0 0 100px #9000a0);
  }
  89% { opacity: .28; filter: invert(1) drop-shadow(0 0 2px #ff6ef7); }
  90% { opacity: 1;
        filter: invert(1) drop-shadow(0 0 8px #ff6ef7) drop-shadow(0 0 22px #f000e0)
                drop-shadow(0 0 55px #c000b0) drop-shadow(0 0 100px #9000a0); }
  93% { opacity: 1; }
  94% { opacity: .5;  filter: invert(1) drop-shadow(0 0 2px #ff6ef7); }
  95%, 100% {
    opacity: 1;
    filter: invert(1) drop-shadow(0 0 8px #ff6ef7) drop-shadow(0 0 22px #f000e0)
            drop-shadow(0 0 55px #c000b0) drop-shadow(0 0 100px #9000a0);
  }
}

/* ── AppBar / Header ── */
header, .MuiAppBar-root {
  background: transparent !important;
  box-shadow: none !important;
}

/* ── Card — terminal window ── */
.MuiPaper-root {
  background: #070d1b !important;
  border: 1px solid #1e2f4a !important;
  border-radius: 10px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow:
    0 0 0 1px rgba(99,102,241,.1),
    0 0 50px rgba(160,0,200,.07),
    0 50px 120px rgba(0,0,0,.85),
    inset 0 1px 0 rgba(255,255,255,.03) !important;
}

/* Terminal chrome bar with macOS-style traffic-light dots */
.MuiPaper-root::before {
  content: 'secure terminal · session encrypted';
  display: block;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .12em;
  color: #2e4560;
  background:
    radial-gradient(circle 5px at 18px 20px, #ff5f56 100%, transparent 0),
    radial-gradient(circle 5px at 35px 20px, #ffbd2e 100%, transparent 0),
    radial-gradient(circle 5px at 52px 20px, #27c93f 100%, transparent 0),
    linear-gradient(180deg, #0d1b30 0%, #091018 100%);
  border-bottom: 1px solid #162030;
  pointer-events: none;
  flex-shrink: 0;
}

/* Pink neon stripe at the very top of the card */
.MuiPaper-root::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    #7000a0 15%,
    #f000e0 45%,
    #ff6ef7 60%,
    #f000e0 75%,
    transparent 100%);
  box-shadow: 0 0 14px #ff6ef7, 0 0 35px #f000e0, 0 0 60px #9000a0;
  pointer-events: none;
  z-index: 10;
}

/* ── Typography ── */
.MuiTypography-root,
.MuiFormLabel-root,
.MuiInputLabel-root {
  font-family: 'JetBrains Mono', monospace !important;
  color: #c8d8ee !important;
}

/* Page/card heading → terminal green prompt */
.MuiTypography-h5,
.MuiTypography-h6 {
  color: #34d399 !important;
  font-size: .82rem !important;
  letter-spacing: .2em !important;
  text-transform: uppercase !important;
  font-weight: 500 !important;
}
.MuiTypography-h5::before,
.MuiTypography-h6::before {
  content: '$ ';
  color: #6366f1;
  font-weight: 300;
}

/* ── Input fields ── */
.MuiOutlinedInput-root {
  background: #020710 !important;
  font-family: 'JetBrains Mono', monospace !important;
  border-radius: 4px !important;
}
.MuiOutlinedInput-input {
  color: #d4e2f4 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .88rem !important;
  caret-color: #818cf8 !important;
}
.MuiInputLabel-root {
  font-size: .7rem !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  color: #7090b8 !important;
}
.MuiOutlinedInput-notchedOutline {
  border-color: #131e30 !important;
  transition: border-color .15s, box-shadow .15s !important;
}
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: #2a3e5a !important;
}
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99,102,241,.12), 0 0 20px rgba(99,102,241,.07) !important;
}
/* Kill autofill yellow flash */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #d4e2f4 !important;
  -webkit-box-shadow: 0 0 0 1000px #020710 inset !important;
}

/* ── Submit button ── */
.MuiButton-contained {
  background: transparent !important;
  border: 1px solid #4a4ec0 !important;
  color: #818cf8 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .7rem !important;
  letter-spacing: .22em !important;
  text-transform: uppercase !important;
  border-radius: 4px !important;
  padding: 13px 24px !important;
  box-shadow: none !important;
  position: relative !important;
  overflow: hidden !important;
  transition: color .2s, border-color .2s, box-shadow .2s !important;
}
.MuiButton-contained::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #5254c0, #818cf8);
  transform: translateX(-101%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  z-index: 0;
}
.MuiButton-contained:hover::before { transform: translateX(0); }
.MuiButton-contained:hover {
  color: #fff !important;
  border-color: #818cf8 !important;
  box-shadow: 0 0 28px rgba(99,102,241,.45), 0 0 60px rgba(99,102,241,.18) !important;
}
.MuiButton-contained > span,
.MuiButton-contained > .MuiButton-label {
  position: relative;
  z-index: 1;
}

/* ── Secondary / text buttons ── */
.MuiButton-outlined,
.MuiButton-text {
  border-color: #1a2a3e !important;
  color: #5a7090 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .68rem !important;
  letter-spacing: .06em !important;
}
.MuiButton-text:hover { color: #a0b8d0 !important; }

/* ── Checkbox ── */
.MuiCheckbox-root            { color: #1a2a3e !important; }
.MuiCheckbox-root.Mui-checked { color: #6366f1 !important; }

/* ── Icon buttons (password toggle, etc.) ── */
.MuiIconButton-root {
  color: #3d5570 !important;
  transition: color .15s, background .15s !important;
}
.MuiIconButton-root:hover {
  color: #c8d8ee !important;
  background: rgba(99,102,241,.08) !important;
}

/* ── Links ── */
a {
  color: #5a62d8 !important;
  text-decoration: none !important;
  transition: color .15s, text-shadow .15s !important;
}
a:hover {
  color: #ff6ef7 !important;
  text-shadow: 0 0 8px #ff6ef7, 0 0 20px #f000e0 !important;
}

/* ── Alerts ── */
.MuiAlert-root {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .72rem !important;
  border-radius: 4px !important;
}
.MuiAlert-standardError,
.MuiAlert-filledError {
  background: rgba(239,68,68,.07) !important;
  border: 1px solid rgba(239,68,68,.18) !important;
  color: #f87171 !important;
}
.MuiAlert-standardSuccess,
.MuiAlert-filledSuccess {
  background: rgba(52,211,153,.07) !important;
  border: 1px solid rgba(52,211,153,.18) !important;
  color: #34d399 !important;
}

/* ── Dividers ── */
.MuiDivider-root { border-color: #0e1a28 !important; }

/* ── Footer / caption — pink neon flicker ── */
footer,
.MuiTypography-caption {
  color: #ff6ef7 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .62rem !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
  text-shadow:
    0 0 6px #ff6ef7,
    0 0 14px #ff6ef7,
    0 0 30px #f000e0,
    0 0 55px #c000b0 !important;
  animation: neon-flicker 9s 11s infinite !important;
}
@keyframes neon-flicker {
  0%,90%  { opacity: 1; text-shadow: 0 0 6px #ff6ef7, 0 0 14px #ff6ef7, 0 0 30px #f000e0, 0 0 55px #c000b0; }
  91%     { opacity: .35; text-shadow: none; }
  92%     { opacity: 1;   text-shadow: 0 0 6px #ff6ef7, 0 0 14px #ff6ef7, 0 0 30px #f000e0, 0 0 55px #c000b0; }
  94%     { opacity: .5;  text-shadow: none; }
  95%,100%{ opacity: 1;   text-shadow: 0 0 6px #ff6ef7, 0 0 14px #ff6ef7, 0 0 30px #f000e0, 0 0 55px #c000b0; }
}
