/* ============================================================
   THE PALE LODGE — TERMINAL AUTH THEME
   v2.0 — consolidated
   ============================================================ */

/* ── FONTS ─────────────────────────────────────────────────── */
@font-face {
  font-family: 'Share Tech Mono';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/ShareTechMono.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/Rajdhani-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 600;
  src: url('/fonts/Rajdhani-SemiBold.woff2') format('woff2');
}

/* ── CUSTOM PROPERTIES ─────────────────────────────────────── */
:root {
  --c-black:    #050a0e;
  --c-panel:    #0a1520;
  --c-border:   #0d2a3a;
  --c-glow:     #00c8ff;
  --c-dim:      #0a7fa0;
  --c-text:     #9ed8e8;
  --c-bright:   #d6f4ff;
  --c-warn:     #ff4d4d;
  --c-success:  #00ff88;
  --c-muted:    #2a4a5a;
  --font-mono:  'Share Tech Mono', 'Courier New', monospace;
  --font-ui:    'Rajdhani', 'Arial Narrow', sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ── BASE ───────────────────────────────────────────────────── */
html, body {
  margin: 0;
  padding: 0;
  height: 100% !important;
  overflow: hidden !important;
  background-color: var(--c-black) !important;
  background-image:
    linear-gradient(rgba(0,200,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,0.04) 1px, transparent 1px) !important;
  background-size: 40px 40px !important;
  color: var(--c-text);
  font-family: var(--font-mono) !important;
}

/* Scanline overlay */
html body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Suppress body::after */
html body::after {
  display: none !important;
}

/* ── STAGE WRAPPER ──────────────────────────────────────────── */
div#first-factor-stage {
  height: 100vh !important;
  min-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  padding-top: 28px !important;
  padding-bottom: 28px !important;
}

div#first-factor-stage::before,
div#first-factor-stage::after {
  display: none !important;
}

/* ── PANEL ──────────────────────────────────────────────────── */
html body .MuiContainer-root.MuiContainer-maxWidthXs {
  background: var(--c-panel) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 0 !important;
  padding: 40px 32px !important;
  position: relative !important;
  box-shadow: 0 0 0 1px var(--c-border), 0 0 40px rgba(0,200,255,0.08) !important;
}

/* Corner bracket — top-left */
html body .MuiContainer-root.MuiContainer-maxWidthXs::before {
  content: '' !important;
  position: absolute !important;
  top: -1px;
  left: -1px !important;
  width: 18px;
  height: 18px !important;
  border-top: 2px solid var(--c-glow) !important;
  border-left: 2px solid var(--c-glow) !important;
  opacity: 0.7 !important;
  background: none !important;
}

/* Corner bracket — bottom-right */
html body .MuiContainer-root.MuiContainer-maxWidthXs::after {
  content: '' !important;
  position: absolute !important;
  bottom: -1px;
  right: -1px !important;
  width: 18px;
  height: 18px !important;
  border-bottom: 2px solid var(--c-glow) !important;
  border-right: 2px solid var(--c-glow) !important;
  opacity: 0.7 !important;
  background: none !important;
}

/* ── LOGO ───────────────────────────────────────────────────── */
html body img[alt="Logo"] {
  filter: drop-shadow(0 0 10px var(--c-glow)) drop-shadow(0 0 24px rgba(0,200,255,0.25)) !important;
}

/* ── HEADING ────────────────────────────────────────────────── */
html body h5.MuiTypography-h5 {
  font-family: var(--font-ui) !important;
  font-weight: 600 !important;
  letter-spacing: 0.25em !important;
  text-transform: uppercase !important;
  color: var(--c-bright) !important;
  text-align: center !important;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
html body .MuiTypography-root {
  font-family: var(--font-mono) !important;
  color: var(--c-text) !important;
}

/* ── INPUT FIELDS ───────────────────────────────────────────── */
html body .MuiInputBase-root.MuiOutlinedInput-root {
  background: rgba(0,10,20,0.8) !important;
  border-radius: 0 !important;
  font-family: var(--font-mono) !important;
  color: var(--c-bright) !important;
  caret-color: var(--c-glow) !important;
}

html body .MuiInputBase-input {
  font-family: var(--font-mono) !important;
  color: var(--c-bright) !important;
}

html body .MuiOutlinedInput-notchedOutline {
  border-color: var(--c-muted) !important;
  border-radius: 0 !important;
}

html body .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: var(--c-dim) !important;
}

html body .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--c-glow) !important;
  box-shadow: 0 0 8px var(--c-glow), 0 0 20px rgba(0,200,255,0.15) !important;
}

/* ── INPUT LABELS ───────────────────────────────────────────── */
html body .MuiInputLabel-root {
  font-family: var(--font-mono) !important;
  color: var(--c-dim) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

html body .MuiInputLabel-root.Mui-focused {
  color: var(--c-glow) !important;
}

/* ── BUTTON ─────────────────────────────────────────────────── */
html body button.MuiButton-containedPrimary {
  background: transparent !important;
  border: 1px solid var(--c-glow) !important;
  border-radius: 0 !important;
  color: var(--c-glow) !important;
  font-family: var(--font-ui) !important;
  font-weight: 600 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  box-shadow: 0 0 10px rgba(0,200,255,0.1) !important;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s !important;
}

html body button.MuiButton-containedPrimary:hover {
  background: rgba(0,200,255,0.08) !important;
  box-shadow: 0 0 18px rgba(0,200,255,0.3) !important;
  color: var(--c-bright) !important;
}

/* ── CHECKBOX ───────────────────────────────────────────────── */
html body .MuiFormControlLabel-label {
  font-family: var(--font-mono) !important;
  color: var(--c-muted) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

html body .MuiCheckbox-root { color: var(--c-muted) !important; }
html body .MuiCheckbox-root.Mui-checked { color: var(--c-glow) !important; }

/* ── LINKS ──────────────────────────────────────────────────── */
html body button.MuiLink-button,
html body a.MuiLink-root {
  font-family: var(--font-mono) !important;
  color: var(--c-muted) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.1em !important;
  text-decoration: none !important;
}

html body button.MuiLink-button:hover,
html body a.MuiLink-root:hover {
  color: var(--c-glow) !important;
  text-shadow: 0 0 8px var(--c-glow) !important;
}

/* ── LANGUAGE BUTTON ────────────────────────────────────────── */
html body #language-button {
  position: fixed !important;
  top: 2px !important;
  right: 8px !important;
  z-index: 9999 !important;
}

html body #language-button p {
  font-family: var(--font-mono) !important;
  font-size: 0.65rem !important;
  color: var(--c-muted) !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

html body #language-button svg {
  display: none !important;
}

/* ── ERROR STATES ───────────────────────────────────────────── */
html body .MuiAlert-root {
  background: rgba(255,30,30,0.08) !important;
  border: 1px solid var(--c-warn) !important;
  border-radius: 0 !important;
  color: var(--c-warn) !important;
  font-family: var(--font-mono) !important;
}

/* ── CHROME BARS ────────────────────────────────────────────── */
#tpl-header,
#tpl-footer {
  display: flex !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 4px 16px !important;
  font-family: var(--font-mono) !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  background: rgba(5,10,14,0.95) !important;
  z-index: 9998 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#tpl-header {
  top: 0 !important;
  border-bottom: 1px solid var(--c-border) !important;
}

#tpl-footer {
  bottom: 0 !important;
  border-top: 1px solid var(--c-border) !important;
}

.tpl-node    { color: var(--c-muted) !important; }
.tpl-status  { color: var(--c-success) !important; }
.tpl-powered { color: var(--c-muted) !important; }
.tpl-enc     { color: var(--c-muted) !important; }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--c-black); }
::-webkit-scrollbar-thumb { background: var(--c-muted); }
::-webkit-scrollbar-thumb:hover { background: var(--c-dim); }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes flicker {
  0%  { opacity: 1; }
  2%  { opacity: 0.95; }
  4%  { opacity: 1; }
  52% { opacity: 0.97; }
  54% { opacity: 1; }
}

html body { animation: flicker 8s infinite; }

/* ── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── HIDE BUILT-IN POWERED BY ROW ─── */
html body .MuiGrid-root.MuiGrid-grid-xs-4.mui-fiq9q0 {
  display: none !important;
}
