/*
 * Mega Gestor — Tema Authelia V2 / 30.10.2026
 * Camada 100% visual. Nao altera envio, campos, metodo TOTP, sessao ou auth.
 * Mantem os componentes reais do Authelia; nenhum formulario eh recriado.
 * Compativel com o CSS V1 injetado pelo Nginx em /unitvauth/.
 */
:root {
  color-scheme: dark;
  --mega-aside: clamp(305px, 29vw, 400px);
  --mega-navy: #0a0e27;
  --mega-surface: #121633;
  --mega-panel: #191e40;
  --mega-ink: #f3f0ff;
  --mega-muted: #aeb4d0;
  --mega-purple: #895ced;
  --mega-lilac: #ae8cff;
}
html, body, #root { min-height: 100%; }
html { background: var(--mega-navy) !important; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--mega-ink) !important;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif !important;
  background:
    radial-gradient(ellipse 38% 38% at 74% 36%, rgba(118,68,230,.22), transparent 85%),
    radial-gradient(ellipse 38% 46% at 97% 100%, rgba(38,64,166,.15), transparent 92%),
    linear-gradient(140deg, #0c0e29 0%, #111532 49%, #090e24 100%) !important;
}

/* Painel lateral de marca: identidade visual proxima ao menu do Mega Gestor */
body::before {
  content: '';
  position: fixed;
  box-sizing: border-box;
  z-index: 0;
  inset: 0 auto 0 0;
  width: var(--mega-aside);
  pointer-events: none;
  border-right: 1px solid rgba(139,91,245,.62);
  background:
    linear-gradient(180deg, rgba(100,62,210,.0), rgba(112,70,220,.10) 100%),
    radial-gradient(circle at 5% 78%, rgba(136,84,238,.19), transparent 51%),
    #0a0d28;
  box-shadow: 12px 0 50px rgba(3,5,17,.16);
}
/* Nome + logo; somente decorativo, nunca altera identidade da conta. */
body::after {
  content: 'MEGA GESTOR';
  position: fixed;
  z-index: 2;
  top: 32px;
  left: 31px;
  height: 54px;
  width: calc(var(--mega-aside) - 50px);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding-left: 68px;
  background: url('mega-gestor-mark.svg') left center / 54px 54px no-repeat;
  pointer-events: none;
  color: #f5f0ff;
  font-size: 17px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .11em;
  text-shadow: 0 1px 18px rgba(153,99,244,.16);
}
html::before {
  content: 'Seu espaço,\A mais seguro.';
  white-space: pre-line;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  position: fixed;
  z-index: 2;
  top: 27%;
  left: 33px;
  width: calc(var(--mega-aside) - 64px);
  pointer-events: none;
  color: #f3f0ff;
  font-size: clamp(27px, 2.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -.035em;
  font-weight: 800;
}
html::after {
  content: 'Acesse o Mega Gestor com segurança.\A Sua conta e os monitores protegidos\A pela autenticação em duas etapas.';
  white-space: pre-line;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  position: fixed;
  z-index: 2;
  top: calc(27% + 121px);
  left: 35px;
  width: calc(var(--mega-aside) - 70px);
  pointer-events: none;
  color: #afb6d5;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 400;
}
#root {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  color: var(--mega-ink) !important;
  min-height: 100vh;
}
@media (min-width: 930px) {
  #root {
    width: calc(100% - var(--mega-aside));
    margin-left: var(--mega-aside);
  }
  /* Cartao de login: pseudo-elemento decorativo ATRAS dos controles reais. */
  #root::before {
    content: '';
    position: fixed;
    z-index: -1;
    top: 50%;
    left: calc(var(--mega-aside) + (100vw - var(--mega-aside)) / 2);
    transform: translate(-50%, -50%);
    width: min(526px, calc(100vw - var(--mega-aside) - 44px));
    height: min(650px, calc(100vh - 90px));
    min-height: 500px;
    box-sizing: border-box;
    border: 1px solid rgba(140, 103, 244, .34);
    border-radius: 24px;
    background: linear-gradient(158deg, rgba(30,30,68,.96), rgba(17,23,52,.97));
    box-shadow: 0 30px 90px rgba(3, 5, 24, .42), inset 0 1px 0 rgba(206,190,255,.07), 0 0 65px rgba(96,67,207,.08);
    pointer-events: none;
  }
  #root::after {
    content: '●  ACESSO PROTEGIDO';
    position: fixed;
    z-index: -1;
    bottom: 32px;
    left: 37px;
    color: #c2a9ff;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .12em;
    pointer-events: none;
  }
}
/* Authelia recente: componentes proprios com data-slot (nao MUI). */
#root input[data-slot='floating-input'],
#root #username-textfield,
#root #password-textfield {
  color: #f7f4ff !important;
  background-color: #222949 !important;
  border: 1px solid #536084 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
#root input[data-slot='floating-input']:focus,
#root #username-textfield:focus,
#root #password-textfield:focus {
  border-color: #ba97ff !important;
  box-shadow: 0 0 0 3px rgba(133,93,223,.22) !important;
  outline: none !important;
}
#root input[data-slot='floating-input'][aria-invalid='true'] {
  border-color: #fa829d !important;
  box-shadow: 0 0 0 3px rgba(227,84,125,.16) !important;
}
#root input[data-slot='floating-input'] + label {
  color: #c4c9e2 !important;
}
#root input[data-slot='floating-input']:focus + label {
  color: #d3bfff !important;
}
#root button#sign-in-button,
#root button[data-slot='button'][data-variant='default'] {
  color: #fff !important;
  background-color: #8159eb !important;
  background-image: linear-gradient(105deg, #754fe0, #9867ef) !important;
  border: 1px solid rgba(190,161,255,.35) !important;
  border-radius: 10px !important;
  box-shadow: 0 9px 26px rgba(114,72,222,.27) !important;
  font-weight: 740 !important;
  text-transform: none !important;
  min-height: 44px;
}
#root button#sign-in-button:hover,
#root button[data-slot='button'][data-variant='default']:hover {
  background-image: linear-gradient(110deg, #865cf2, #ad84ff) !important;
  box-shadow: 0 12px 29px rgba(114,72,222,.36) !important;
}
#root button#reset-password-button,
#root button#register-button {
  color: #cbb5ff !important;
}
#root #remember-checkbox {
  accent-color: #926af3 !important;
  border-color: #8d80bc !important;
}
#root [data-slot='checkbox'][data-state='checked'] {
  background-color: #875de9 !important;
  border-color: #a884ff !important;
}
/* Estilos de formulario — seletores para variantes atuais de Material UI. */
#root .MuiPaper-root, #root .MuiCard-root {
  color: var(--mega-ink) !important;
  background: transparent !important;
  box-shadow: none !important;
}
#root .MuiTypography-root, #root .MuiFormLabel-root, #root .MuiFormControlLabel-label {
  color: #f3f0ff;
}
#root .MuiTypography-h4, #root .MuiTypography-h5, #root .MuiTypography-h6,
#root h1, #root h2, #root h3 {
  color: #f4f0ff !important;
  font-weight: 760 !important;
  letter-spacing: -.025em !important;
}
#root .MuiTypography-colorTextSecondary, #root .MuiFormHelperText-root {
  color: #aeb7d6 !important;
}
#root .MuiAvatar-root {
  background: linear-gradient(150deg, #7150d8, #a17cf6) !important;
  color: white !important;
  box-shadow: 0 0 0 5px rgba(136,91,235,.12), 0 12px 38px rgba(100,70,210,.24);
}
#root .MuiInputBase-root,
#root .MuiOutlinedInput-root,
#root .MuiFilledInput-root {
  background-color: #212849 !important;
  color: #f6f3ff !important;
  border-radius: 10px !important;
}
#root .MuiInputBase-input,
#root input[type='text'], #root input[type='email'], #root input[type='password'],
#root input[type='number'], #root input[type='tel'] {
  color: #f8f6ff !important;
  caret-color: #b393ff !important;
}
#root .MuiOutlinedInput-notchedOutline,
#root .MuiOutlinedInput-root fieldset {
  border-color: #515b83 !important;
  border-radius: 10px !important;
}
#root .MuiOutlinedInput-root:hover fieldset,
#root .MuiFilledInput-root:hover {
  border-color: #9877ee !important;
}
#root .MuiOutlinedInput-root.Mui-focused fieldset,
#root .Mui-focused .MuiOutlinedInput-notchedOutline,
#root .MuiInputBase-root:focus-within fieldset,
#root fieldset:focus-within {
  border-color: #b497ff !important;
  box-shadow: 0 0 0 3px rgba(135,90,233,.16) !important;
}
#root .MuiInputLabel-root { color: #bec5e1 !important; }
#root .MuiInputLabel-root.Mui-focused { color: #c6afff !important; }
#root input::placeholder { color: #abb4d2 !important; opacity: 1; }
#root button[type='submit'],
#root .MuiButton-contained,
#root [class*='MuiButton-contained'] {
  background: linear-gradient(105deg, #7650df, #9466f0) !important;
  background-color: #815ce9 !important;
  color: #fff !important;
  border: 1px solid rgba(187,151,255,.45) !important;
  border-radius: 10px !important;
  box-shadow: 0 9px 24px rgba(116,76,216,.26) !important;
  font-weight: 750 !important;
  letter-spacing: .015em !important;
  text-transform: none !important;
  min-height: 44px;
}
#root button[type='submit']:hover,
#root .MuiButton-contained:hover,
#root [class*='MuiButton-contained']:hover {
  background: linear-gradient(110deg, #895ff2, #ad86ff) !important;
  box-shadow: 0 13px 28px rgba(112,69,220,.35) !important;
}
#root .MuiButton-text, #root .MuiButton-outlined, #root a {
  color: #cbb6ff !important;
}
#root a:hover { color: #ebdcff !important; }
#root .MuiCheckbox-root.Mui-checked, #root .MuiRadio-root.Mui-checked,
#root .MuiSwitch-switchBase.Mui-checked { color: #a987ff !important; }
#root .MuiSvgIcon-colorPrimary { color: #c5aeff !important; }
#root .MuiDivider-root { border-color: rgba(157,136,225,.28) !important; }
#root .MuiAlert-standardError, #root .MuiAlert-filledError {
  color: #ffe4ed !important;
  background: #542039 !important;
  border: 1px solid #b44578 !important;
}
#root .MuiAlert-standardSuccess, #root .MuiAlert-filledSuccess {
  color: #d6fff2 !important;
  background: #124a49 !important;
  border: 1px solid #278f78 !important;
}
#root .MuiCircularProgress-root { color: #aa86ff !important; }
#root :focus-visible { outline: 2px solid #c6a5ff !important; outline-offset: 3px; }
@media (max-width: 929px) {
  :root { --mega-aside: 0px; }
  html::before, html::after, body::before, body::after { display: none !important; }
  #root { width: 100% !important; margin-left: 0 !important; }
}
@media (max-width: 600px) {
  #root { padding: 0 6px; }
  #root .MuiPaper-root, #root .MuiCard-root { border-radius: 14px !important; }
}
@media (prefers-reduced-motion: reduce) {
  #root .MuiButton-contained, #root .MuiInputBase-root { transition: none !important; }
}
