/* House theme for the Authelia portal: minyl tokens (Unbounded + Chakra Petch). */

@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/theme/fonts/unbounded-latin.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/theme/fonts/chakra-petch-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/theme/fonts/chakra-petch-500-latin.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/theme/fonts/chakra-petch-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'Chakra Petch'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/theme/fonts/chakra-petch-700-latin.woff2') format('woff2'); }

:root {
  --bg: #0a0908;
  --bg-soft: #110e0b;
  --surface: #171310;
  --surface-2: #1f1a15;
  --surface-3: #2a231c;
  --line: rgba(232, 190, 141, 0.11);
  --line-strong: rgba(232, 190, 141, 0.22);
  --text: #f3ebdf;
  --muted: #a2948a;
  --dim: #6e635a;
  --accent: #e3a55f;
  --accent-deep: #b87432;
  --accent-soft: rgba(227, 165, 95, 0.13);
  --danger: #d97b6c;
  --radius: 14px;
  --radius-sm: 9px;
  --display: 'Unbounded', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Chakra Petch', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html, body {
  background: radial-gradient(1100px 700px at 50% -10%, #1a1511 0%, var(--bg) 55%) fixed !important;
  color: var(--text) !important;
  font-family: var(--sans) !important;
  min-height: 100%;
}

body, button, input, select, textarea, .MuiTypography-root, .MuiButton-root,
.MuiInputBase-root, .MuiFormLabel-root, .MuiFormHelperText-root {
  font-family: var(--sans) !important;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6, .MuiTypography-h1, .MuiTypography-h2, .MuiTypography-h3,
.MuiTypography-h4, .MuiTypography-h5, .MuiTypography-h6 {
  font-family: var(--display) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
  color: var(--text) !important;
}

/* Cards / paper */
.MuiPaper-root, .MuiCard-root, .MuiDialog-paper {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
  color: var(--text) !important;
}

.MuiDivider-root { border-color: var(--line) !important; }

/* Inputs */
.MuiOutlinedInput-notchedOutline { border-color: var(--line-strong) !important; }
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline { border-color: var(--accent-deep) !important; }
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft);
}
.MuiInputBase-input { color: var(--text) !important; }
.MuiFormLabel-root, .MuiInputLabel-root { color: var(--muted) !important; }
.MuiFormLabel-root.Mui-focused, .MuiInputLabel-root.Mui-focused { color: var(--accent) !important; }
.MuiFormHelperText-root { color: var(--dim) !important; }

/* Buttons */
.MuiButton-root {
  font-family: var(--display) !important;
  font-weight: 500 !important;
  text-transform: none !important;
  border-radius: 999px !important;
  letter-spacing: 0 !important;
}
.MuiButton-contained {
  background: var(--accent) !important;
  color: #171310 !important;
}
.MuiButton-contained:hover { background: var(--accent-deep) !important; }
.MuiButton-outlined { border-color: var(--line-strong) !important; color: var(--text) !important; }
.MuiButton-outlined:hover { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.MuiButton-text { color: var(--accent) !important; }

/* Links, alerts, avatars */
a { color: var(--accent) !important; }
a:hover { color: var(--accent-deep) !important; }
.MuiAlert-root {
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
}

/* The generic "unknown user" portrait becomes Moschops. */
.MuiAvatar-root, [class*='avatar' i], [class*='Avatar'] {
  background-image: url('/theme/moschops.jpg') !important;
  background-size: cover !important;
  background-position: center 30% !important;
  background-color: var(--surface-3) !important;
  color: transparent !important;
  border: 1px solid var(--line-strong) !important;
}
.MuiAvatar-root > svg, [class*='avatar' i] > svg { display: none !important; }

/* Selection + scrollbar to match */
::selection { background: var(--accent); color: #171310; }
* { scrollbar-color: var(--surface-3) transparent; }

/* Authelia 4.39 uses Tailwind/shadcn tokens. Override them rather than the
   generated classes, so every component follows the house palette. */
:root, .dark, [data-theme='dark'] {
  --background: #0a0908 !important;
  --foreground: #f3ebdf !important;
  --card: #171310 !important;
  --card-foreground: #f3ebdf !important;
  --popover: #171310 !important;
  --popover-foreground: #f3ebdf !important;
  --primary: #e3a55f !important;
  --primary-foreground: #171310 !important;
  --secondary: #1f1a15 !important;
  --secondary-foreground: #f3ebdf !important;
  --muted: #1f1a15 !important;
  --muted-foreground: #a2948a !important;
  --accent: #2a231c !important;
  --accent-foreground: #f3ebdf !important;
  --destructive: #d97b6c !important;
  --border: rgba(232, 190, 141, 0.11) !important;
  --input: rgba(232, 190, 141, 0.22) !important;
  --ring: #e3a55f !important;
  --radius: 14px !important;
  --custom-icon: #a2948a !important;
  --font-sans: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif !important;
}

/* The portrait of the unnamed account becomes Moschops. */
#UserSvg {
  width: 104px !important;
  height: 104px !important;
  border-radius: 50%;
  background: url('/theme/moschops.jpg') center / cover no-repeat, #1f1a15;
  border: 1px solid rgba(232, 190, 141, 0.22);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}
#UserSvg path { fill: transparent !important; }

/* Slightly more presence for the heading. */
#first-factor-stage h5 { font-family: var(--display) !important; font-weight: 500 !important; }
