/* CyberLab IPACS — Custom Authelia Theme v5 */

/* ===== FORCE BACKGROUND IMAGE on html ===== */
html {
  background: #000 url('/authelia/custom/bg.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
  min-height: 100vh !important;
}

/* Make body transparent so html bg shows through */
body {
  background: transparent !important;
  background-color: transparent !important;
  min-height: 100vh !important;
}

/* Override MUI CSS variables for background */
:root,
[data-theme="dark"] {
  --mui-palette-background-default: transparent !important;
  --palette-background-default: transparent !important;
}

/* Dark semi-transparent overlay on html */
html::after {
  content: '' !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.45) !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* Everything in body above overlay */
body, #root {
  position: relative !important;
  z-index: 1 !important;
}

/* ===== LOGIN CARD ===== */
.MuiPaper-root,
div[class*="Paper"] {
  background: rgba(8, 12, 28, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(0, 150, 255, 0.2) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7) !important;
}

/* ===== LOGO — size ===== */
img[alt*="logo"],
img[src*="logo"] {
  max-width: 220px !important;
  width: 220px !important;
  height: auto !important;
}

/* ===== BUTTONS ===== */
.MuiButton-containedPrimary,
button[type="submit"],
button.MuiButton-contained {
  background: linear-gradient(135deg, #E8611A 0%, #c44e10 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 15px rgba(232, 97, 26, 0.3) !important;
  transition: all 0.3s ease !important;
}

.MuiButton-containedPrimary:hover,
button[type="submit"]:hover {
  background: linear-gradient(135deg, #f07030 0%, #E8611A 100%) !important;
  box-shadow: 0 6px 20px rgba(232, 97, 26, 0.45) !important;
  transform: translateY(-1px) !important;
}

.MuiButton-text,
.MuiButton-outlined {
  color: #E8611A !important;
}

/* ===== INPUT FIELDS ===== */
.MuiInputBase-root,
.MuiOutlinedInput-root {
  background: rgba(255, 255, 255, 0.07) !important;
  border-radius: 8px !important;
}

.MuiOutlinedInput-notchedOutline {
  border-color: rgba(232, 97, 26, 0.3) !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(232, 97, 26, 0.5) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: #E8611A !important;
}

/* ===== LABELS — orange IPACS, bien positionnes ===== */
.MuiInputLabel-root,
.MuiFormLabel-root {
  color: #E8611A !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
}

.MuiInputLabel-root.Mui-focused {
  color: #f07030 !important;
}

/* Label retracte (quand le champ a du contenu ou est focus) */
.MuiInputLabel-shrink,
label[data-shrink="true"] {
  color: #E8611A !important;
  background-color: rgba(8, 12, 28, 0.95) !important;
  padding: 0 8px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
}

.MuiInputBase-input {
  color: #ffffff !important;
}

/* ===== TEXT ===== */
.MuiTypography-root, p, span, h1, h2, h3, h4, h5, h6 {
  color: #e0e8f0 !important;
}

.MuiTypography-h5, .MuiTypography-h6 {
  color: #ffffff !important;
  font-weight: 600 !important;
}

a, .MuiLink-root { color: #E8611A !important; }
a:hover, .MuiLink-root:hover { color: #f07030 !important; }

/* ===== HIDE AUTHELIA BRANDING ===== */
footer,
[class*="PoweredBy"],
[class*="powered"],
a[href*="authelia.com"],
div:has(> a[href*="authelia.com"]),
p:has(> a[href*="authelia.com"]),
span:has(> a[href*="authelia.com"]) {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
}

/* ===== OTP ===== */
input[autocomplete="one-time-code"],
input[inputmode="numeric"] {
  font-size: 22px !important;
  letter-spacing: 6px !important;
  text-align: center !important;
  font-family: monospace !important;
  font-weight: bold !important;
}

/* ===== MISC ===== */
.MuiCheckbox-root { color: rgba(232, 97, 26, 0.5) !important; }
.MuiCheckbox-root.Mui-checked { color: #E8611A !important; }
.MuiCircularProgress-root { color: #E8611A !important; }
.MuiDivider-root { border-color: rgba(232, 97, 26, 0.15) !important; }
.MuiAlert-root { background: rgba(255, 59, 48, 0.15) !important; border: 1px solid rgba(255, 59, 48, 0.3) !important; border-radius: 8px !important; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #080c1c; }
::-webkit-scrollbar-thumb { background: rgba(232, 97, 26, 0.3); border-radius: 3px; }
::selection { background: rgba(232, 97, 26, 0.3); color: #fff; }
