/* ============================================================
   Nexus-Studio-Skin fuer die Authelia-Login-Seiten
   (auth.* und auth-admin.*). Wird von Caddy via replace-response
   in die ausgelieferte Authelia-HTML injiziert.
   Rein optisch – aendert KEINE Funktion/Struktur des Portals.
   Palette = Nexus-Studio-Standardtheme "Nacht".
   ============================================================ */
:root {
	--nx-bg: #07090f;
	--nx-text: #dbe2ee;
	--nx-dim: #7b8497;
	--nx-accent: #7c8cff;
	--nx-accent-hi: #94a2ff;
	--nx-border: rgba(255, 255, 255, .09);
	--nx-panel: rgba(255, 255, 255, .045);
	--nx-field: rgba(255, 255, 255, .03);
	--nx-font: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Hintergrund: Nexus-Radial-Gradient auf tiefem Navy --- */
html,
body {
	background: var(--nx-bg) !important;
	color: var(--nx-text) !important;
	font-family: var(--nx-font) !important;
}

body {
	min-height: 100vh;
	background: radial-gradient(1200px 700px at 75% 20%, #0e1430 0%, var(--nx-bg) 55%) !important;
}

/* --- Nexus-Wortmarke oben (fixed -> beeinflusst das Authelia-Layout nicht) --- */
body::before {
	content: "NEXUS";
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
	padding-top: 30px;
	text-align: center;
	font-family: var(--nx-font);
	font-weight: 800;
	font-size: 22px;
	line-height: 1;
	letter-spacing: .34em;
	text-indent: .34em;
	background: linear-gradient(90deg, #dbe2ee 0%, var(--nx-accent) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	pointer-events: none;
	user-select: none;
}

/* --- Karte/Panel (Authelia nutzt MuiPaper; Alert/Snackbar ausgenommen) --- */
.MuiPaper-root:not(.MuiAlert-root):not(.MuiSnackbarContent-root) {
	background: var(--nx-panel) !important;
	background-image: none !important;
	color: var(--nx-text) !important;
	border: 1px solid var(--nx-border) !important;
	border-radius: 16px !important;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .55) !important;
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

/* --- Typografie --- */
.MuiTypography-root {
	color: var(--nx-text) !important;
	font-family: var(--nx-font) !important;
}

/* --- Eingabefelder --- */
.MuiOutlinedInput-root {
	background: var(--nx-field) !important;
	border-radius: 10px !important;
}

.MuiInputBase-input {
	color: var(--nx-text) !important;
}

.MuiOutlinedInput-notchedOutline {
	border-color: var(--nx-border) !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
	border-color: rgba(124, 140, 255, .5) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
	border-color: var(--nx-accent) !important;
}

.MuiInputLabel-root {
	color: var(--nx-dim) !important;
}

.MuiInputLabel-root.Mui-focused {
	color: var(--nx-accent) !important;
}

/* Browser-Autofill an das dunkle Theme anpassen */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--nx-text) !important;
	-webkit-box-shadow: 0 0 0 1000px #11162a inset !important;
	caret-color: var(--nx-text);
}

/* --- Primaer-Button (Sign in / Verify) ---
   Authelia rendert die Buttons als MuiButtonBase (kein MuiButton),
   plus type="submit" beim Login. Icon-Buttons & Checkbox ausgenommen. */
button[type="submit"],
.MuiButtonBase-root:not(.MuiIconButton-root):not(.MuiCheckbox-root) {
	background: var(--nx-accent) !important;
	color: #0b0e1a !important;
	border-radius: 10px !important;
	font-family: var(--nx-font) !important;
	font-weight: 600 !important;
	text-transform: none !important;
	box-shadow: 0 8px 24px rgba(124, 140, 255, .32) !important;
}

button[type="submit"]:hover,
.MuiButtonBase-root:not(.MuiIconButton-root):not(.MuiCheckbox-root):hover {
	background: var(--nx-accent-hi) !important;
}

/* --- Icon-Buttons (z.B. Passwort anzeigen) dezent halten --- */
.MuiIconButton-root {
	color: var(--nx-dim) !important;
	background: transparent !important;
	box-shadow: none !important;
}

.MuiIconButton-root:hover {
	color: var(--nx-text) !important;
	background: rgba(255, 255, 255, .06) !important;
}

/* --- Checkbox ("Angemeldet bleiben") --- */
.MuiCheckbox-root {
	color: var(--nx-dim) !important;
}

.MuiCheckbox-root.Mui-checked {
	color: var(--nx-accent) !important;
}

/* --- Links (Passwort zuruecksetzen, "Powered by Authelia") --- */
a {
	color: var(--nx-accent) !important;
	text-decoration-color: rgba(124, 140, 255, .4);
}

a:hover {
	color: var(--nx-accent-hi) !important;
}

/* --- Spinner: Akzentfarbe, im Button aber dunkel --- */
.MuiCircularProgress-root {
	color: var(--nx-accent) !important;
}

button[type="submit"] .MuiCircularProgress-root,
.MuiButtonBase-root:not(.MuiIconButton-root):not(.MuiCheckbox-root) .MuiCircularProgress-root {
	color: #0b0e1a !important;
}

/* --- Scrollbar dezent an die Palette anpassen --- */
* {
	scrollbar-color: rgba(124, 140, 255, .35) transparent;
}
