:root {
  --auth-bg: #181817;
  --auth-surface: rgba(24, 24, 23, 0.55);
  --auth-surface-hover: rgba(30, 30, 30, 0.62);
  --auth-border: rgba(255, 255, 255, 0.10);
  --auth-border-strong: rgba(255, 255, 255, 0.16);
  --auth-text: rgba(255, 255, 255, 0.88);
  --auth-text-secondary: rgba(255, 255, 255, 0.55);
  --auth-accent: #1783ff;
  --auth-accent-hover: #258eff;
  --auth-radius: 12px;
}

/* Background and base text */
html,
body,
#root {
  background: var(--auth-bg) !important;
  color: var(--auth-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 85% -5%, rgba(23, 131, 255, 0.14), transparent 45%),
    radial-gradient(circle at 10% 5%, rgba(161, 107, 255, 0.10), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(23, 131, 255, 0.08), transparent 50%),
    radial-gradient(circle at 25% 55%, rgba(23, 131, 255, 0.05), transparent 35%),
    radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
}

#root {
  position: relative;
  z-index: 1;
}

/* Header / AppBar */
.MuiAppBar-root {
  background: var(--auth-surface) !important;
  border-bottom: 1px solid var(--auth-border) !important;
  backdrop-filter: blur(24px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
  box-shadow: none !important;
}

.MuiToolbar-root {
  color: var(--auth-text) !important;
}

.MuiTypography-root {
  color: var(--auth-text) !important;
}

.MuiTypography-body1,
.MuiTypography-h5,
.MuiTypography-inherit {
  color: var(--auth-text) !important;
}

/* Main container / login card area */
.MuiContainer-root {
  position: relative;
  z-index: 1;
}

.MuiPaper-root {
  background: var(--auth-surface) !important;
  border: 1px solid var(--auth-border) !important;
  border-radius: var(--auth-radius) !important;
  backdrop-filter: blur(24px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

.MuiPaper-elevation0 {
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

/* Form inputs */
.MuiOutlinedInput-root {
  background: rgba(255, 255, 255, 0.04) !important;
  border-radius: 8px !important;
  border: 1px solid var(--auth-border) !important;
  color: var(--auth-text) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: var(--auth-border-strong) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--auth-accent) !important;
  border-width: 1px !important;
}

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

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

.MuiInputLabel-root,
.MuiInputLabel-outlined {
  color: var(--auth-text-secondary) !important;
}

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

.MuiFormLabel-root,
.MuiFormLabel-colorPrimary {
  color: var(--auth-text-secondary) !important;
}

/* Buttons */
.MuiButton-root {
  border-radius: 8px !important;
  text-transform: none !important;
  font-weight: 600 !important;
}

.MuiButton-containedPrimary {
  background: var(--auth-accent) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.MuiButton-containedPrimary:hover {
  background: var(--auth-accent-hover) !important;
  box-shadow: 0 4px 12px rgba(23, 131, 255, 0.25) !important;
}

.MuiButton-outlinedPrimary {
  border-color: var(--auth-border) !important;
  color: var(--auth-text) !important;
}

.MuiButton-outlinedPrimary:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--auth-border-strong) !important;
}

/* Checkbox */
.MuiCheckbox-root {
  color: var(--auth-text-secondary) !important;
}

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

/* Links */
.MuiLink-root {
  color: var(--auth-accent) !important;
}

.MuiLink-root:hover {
  color: var(--auth-accent-hover) !important;
}

/* Icon buttons */
.MuiIconButton-root {
  color: var(--auth-text-secondary) !important;
}

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

/* Loading spinner */
span[style*="background-color: rgb(0, 0, 0)"] {
  background-color: var(--auth-accent) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--auth-border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Selection */
::selection {
  background: rgba(23, 131, 255, 0.25) !important;
  color: var(--auth-text) !important;
}
