/* MD3 Dark + Blue — overrides MUI CSS-in-Js */
/* Must use !important because Authelia injects styles via JS */

body {
    background-color: #1C1B1F !important;
    color: #E6E1E5 !important;
}

/* Card / Paper */
.MuiPaper-root {
    background-color: transparent !important;
    color: #E6E1E5 !important;
    border-radius: 28px !important;
}

.MuiPaper-outlined {
    border-color: rgba(230, 225, 229, 0.12) !important;
}

/* Buttons */
.MuiButton-containedPrimary,
.MuiButton-contained.MuiButton-colorPrimary {
    background-color: #A8C7FA !important;
    color: #1C1B1F !important;
    border-radius: 28px !important;
}

.MuiButton-containedPrimary:hover,
.MuiButton-contained.MuiButton-colorPrimary:hover {
    background-color: #C2DBFF !important;
    color: #001D36 !important;
}

.MuiButton-textPrimary,
.MuiButton-text.MuiButton-colorPrimary {
    color: #A8C7FA !important;
    border-radius: 28px !important;
}

.MuiButton-textPrimary:hover,
.MuiButton-text.MuiButton-colorPrimary:hover {
    background-color: rgba(168, 199, 250, 0.08) !important;
}

.MuiButton-colorSecondary {
    background-color: #A8C7FA !important;
    color: #1C1B1F !important;
    border-radius: 28px !important;
    padding: 8px 24px !important;
}

.MuiButton-colorSuccess {
    background-color: #83D8A3 !important;
    color: #1C1B1F !important;
    border-radius: 28px !important;
}

.MuiButton-colorError {
    background-color: #FFB4AB !important;
    color: #1C1B1F !important;
    border-radius: 28px !important;
}

/* Input fields */
.MuiOutlinedInput-root {
    border-radius: 12px !important;
    color: #E6E1E5 !important;
}

.MuiOutlinedInput-notchedOutline {
    border-color: rgba(230, 225, 229, 0.23) !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
    border-color: rgba(230, 225, 229, 0.5) !important;
}

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

.MuiInputLabel-root {
    color: rgba(230, 225, 229, 0.7) !important;
}

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

/* Typography */
.MuiTypography-root {
    color: #E6E1E5 !important;
}

/* Links */
.MuiLink-root {
    color: #A8C7FA !important;
}

.MuiLink-root:hover {
    color: #C2DBFF !important;
}

/* Icon buttons */
.MuiIconButton-root {
    border-radius: 28px !important;
}

.MuiIconButton-root:hover {
    background-color: rgba(168, 199, 250, 0.08) !important;
}

.MuiSvgIcon-colorPrimary {
    color: #A8C7FA !important;
}

/* Checkbox / Radio / Switch */
.MuiCheckbox-root.Mui-checked,
.MuiRadio-root.Mui-checked {
    color: #A8C7FA !important;
}

.MuiSwitch-colorPrimary.Mui-checked {
    color: #A8C7FA !important;
}

.MuiSwitch-colorPrimary.Mui-checked + .MuiSwitch-track {
    background-color: #A8C7FA !important;
}

/* Dividers */
.MuiDivider-root {
    border-color: rgba(230, 225, 229, 0.08) !important;
}

/* Menus / Popovers */
.MuiPopover-paper {
    background-color: rgba(33, 31, 38, 0.95) !important;
    border-radius: 28px !important;
}

.MuiMenuItem-root {
    color: #E6E1E5 !important;
}

.MuiMenuItem-root:hover {
    background-color: rgba(230, 225, 229, 0.08) !important;
}

/* Dialog */
.MuiDialog-paper {
    background-color: #211F26 !important;
    border-radius: 28px !important;
}

/* Alerts */
.MuiAlert-filledError {
    background-color: rgba(211, 47, 47, 0.85) !important;
}

.MuiAlert-filledSuccess {
    background-color: rgba(46, 125, 50, 0.85) !important;
}

.MuiAlert-filledInfo {
    background-color: rgba(2, 136, 209, 0.85) !important;
}

/* Progress bar */
.MuiLinearProgress-colorPrimary {
    background-color: rgba(168, 199, 250, 0.12) !important;
}

.MuiLinearProgress-barColorPrimary {
    background-color: #A8C7FA !important;
}

/* Avatar */
.MuiAvatar-colorDefault {
    background-color: transparent !important;
    color: #E6E1E5 !important;
}

/* AppBar */
.MuiAppBar-colorPrimary {
    background-color: rgba(33, 31, 38, 0.85) !important;
}

/* List items */
.MuiListItemButton-root.Mui-selected {
    background-color: rgba(168, 199, 250, 0.16) !important;
}

.MuiListItemButton-root:hover:not(.Mui-selected) {
    background-color: rgba(230, 225, 229, 0.08) !important;
}

/* Step indicators */
.MuiStepIcon-root.Mui-active {
    color: #A8C7FA !important;
}

.MuiStepIcon-root.Mui-completed {
    color: #A8C7FA !important;
}

/* Form labels */
.MuiFormControlLabel-label {
    color: #E6E1E5 !important;
}

.MuiFormLabel-root.Mui-focused {
    color: #A8C7FA !important;
}

/* Disabled state */
.MuiButtonBase-root.Mui-disabled {
    color: rgba(230, 225, 229, 0.3) !important;
}

/* OTP circle icon */
.authelia-0 svg circle {
    stroke: #A8C7FA !important;
}

.authelia-0 svg circle[fill="#000"] {
    fill: transparent !important;
    stroke: transparent !important;
}
input[type="tel"][autocomplete="one-time-code"],
input[class*="otpDigitInput"],
input[class*="-otpDigitInput"] {
    background-color: #313036 !important;
    border: 1px solid rgba(230, 225, 229, 0.15) !important;
    color: #E6E1E5 !important;
    border-radius: 12px !important;
    padding: 8px 4px !important;
}

input[type="tel"][autocomplete="one-time-code"]:focus,
input[class*="otpDigitInput"]:focus,
input[class*="-otpDigitInput"]:focus {
    border-color: #A8C7FA !important;
    box-shadow: 0 0 0 2px rgba(168, 199, 250, 0.25) !important;
    outline: none !important;
}

/* Authelia-specific IDs */
#language-button {
    color: #E6E1E5 !important;
}

[id*="language-"].MuiMenuItem-root.Mui-selected {
    background-color: rgba(168, 199, 250, 0.3) !important;
}

[id*="account-menu"] div.MuiPaper-root.MuiPaper-elevation.MuiMenu-paper {
    background-color: rgba(33, 31, 38, 0.95) !important;
    border-radius: 28px !important;
}

button[aria-label="toggle password visibility"] {
    color: #E6E1E5 !important;
}

svg[class*="-icon"] {
    fill: #E6E1E5 !important;
}

[class*="-rememberMe"] .MuiFormControlLabel-label.Mui-disabled {
    color: rgba(230, 225, 229, 0.5) !important;
}
