:root{
  --bg:#0b0b0d; --bg-grad-1:#1a1a21; --bg-grad-2:#15151b;
  --card:rgba(255,255,255,.04); --stroke:rgba(255,255,255,.08);
  --txt:#e6e6eb; --muted:#a7a7b0;
  --primary:#77158b; --primary-700:#50158b;
  --input-bg:rgba(255,255,255,.03); --input-border:var(--stroke); --input-fg:var(--txt);
  --footer-bg:rgba(11,11,13,0.9); --shadow:0 10px 40px rgba(0,0,0,.45);
  --glass:rgba(26,28,32,.45); --glass-border:rgba(255,255,255,.14); --glass-hover:rgba(255,255,255,.16);
  --glow: 0 0 0px rgba(119,21,139,0.0), 0 0 0px rgba(119,21,139,0.0);
  --footer-h: 120px; /* sincronizado via JS */
}
html[data-theme="light"]{
  --bg:#f5f6f8; --bg-grad-1:#ffffff; --bg-grad-2:#eef1f6;
  --card:rgba(255,255,255,.85); --stroke:rgba(8,12,20,.08);
  --txt:#121316; --muted:#5d616a;
  --primary:#6f2dbd; --primary-700:#58229a;
  --input-bg:#ffffff; --input-border:rgba(8,12,20,.14); --input-fg:#101217;
  --footer-bg:rgba(255,255,255,.9);
  --glass:rgba(255,255,255,.75); --glass-border:rgba(8,12,20,.10); --glass-hover:rgba(8,12,20,.06);
  --glow: 0 0 18px rgba(111,45,189,.25), 0 0 42px rgba(111,45,189,.18);
}

@font-face {
    font-family: 'Monument Extended';
    src: url('../fonts/MonumentExtended-Regular.woff2') format('woff2'),
        url('../fonts/MonumentExtended-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: 'PP Monument Extended';
    src: url('../fonts/PPMonumentExtended-Light.woff2') format('woff2'),
        url('../fonts/PPMonumentExtended-Light.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Monument Extended';
    src: url('../fonts/MonumentExtended-Ultrabold.woff2') format('woff2'),
        url('../fonts/MonumentExtended-Ultrabold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-SemiBold.woff2') format('woff2'),
        url('../fonts/Montserrat-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Regular.woff2') format('woff2'),
        url('../fonts/Montserrat-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}



/* ===== Layout base sem scroll ===== */
html, body { height: 100%; margin: 0; overflow: hidden; }
body{
     font-family: 'Montserrat',system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  background:
    radial-gradient(1200px 800px at 80% 20%, var(--bg-grad-1) 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 70%, var(--bg-grad-2) 0%, transparent 60%),
    var(--bg);
  color:var(--txt);
  transition:background .35s ease, color .35s ease;
}
@media (prefers-reduced-motion:no-preference){
  body{ animation:bgPulse 18s ease-in-out infinite alternate; }
  @keyframes bgPulse{
    0%{ background-position: 0 0, 0 0, 0 0; }
    100%{ background-position: 20px -20px, -30px 30px, 0 0; }
  }
}

/* Área útil = viewport - footer */
main{
  position: relative;
  min-height: calc(100svh - var(--footer-h));
  display:block;
  overflow: hidden; /* garante sem scroll no main */
}
.container-fluid { height: 100%; }
.row.g-0 { height: 100%; }

/* Fundo (imagem/parallax) fixo e sem overflow */
.bg-shapes{
  position: fixed; inset: 0; z-index: 0;
  background:url(../img/bg.jpg) no-repeat center/cover;
  filter:saturate(1.05) contrast(1.05);
  will-change: transform;
}

html[data-theme="light"] .bg-shapes{
  background:#fff;
}

.bg-overlay-grad{
  position: fixed; inset:0; z-index: 0;
  pointer-events:none;
  background:
    radial-gradient(60% 50% at 80% 20%, rgba(0,0,0,.35), transparent 60%),
    radial-gradient(50% 45% at 15% 80%, rgba(0,0,0,.28), transparent 60%);
  mix-blend-mode:multiply;
}

.link-light:focus, .link-light:hover {
    color:#000;
    text-decoration:underline;
}

/* Partículas cobrindo a página inteira */
canvas#fx{
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: .4;
}

/* Camada de conteúdo acima do fundo/partículas */
.content-layer { position: relative; z-index: 1; }

/* Colunas centrais */
.hero, .panel{
  min-height: inherit;
  display: flex;
  padding: clamp(24px, 4vw, 56px);
  max-height: 75%;
  gap: 50px;
  align-items:center;
  justify-content:center;
}



.hero{ justify-content:end; }

.brand{ max-width:520px; position:relative; }
.brand img{
  display:block; max-width:200px; width:100%; height:auto;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.25));
  transform-origin:center;
}

.brand-glow{
  position:absolute; left:-10%; right:-10%; top:-8%; bottom:-8%;
  border-radius:30px; filter:blur(28px);
  box-shadow: var(--glow);
  pointer-events:none;
}

.card-glass{
  width:100%; max-width:520px;
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  /* Perspective/3D disabled */
  transform: none;
  transition: transform .15s ease, background .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.card-glass .card-header{
  border-bottom:1px solid var(--stroke);
  background:transparent; color:var(--txt);
}
.card-glow{
  position:absolute; inset:-1px; border-radius:20px;
  pointer-events:none; opacity:0; transition:opacity .25s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}
.card-glass:hover .card-glow{ opacity:.6; box-shadow: 0 0 42px rgba(119,21,139,.18); }

/* Reveal */
.reveal{ opacity:0; transform: translateY(18px) scale(.98); }
.reveal.is-visible{ opacity:1; transform:none; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }

.form-label{ color: color-mix(in oklab, var(--txt) 85%, transparent);  font-family: 'PP Monument Extended'; font-size:14px; font-weight:bold; }
.form-control{
  background: var(--input-bg); border-color: var(--input-border); color: var(--input-fg);
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .05s ease;
}
.form-control:focus{
  background: var(--input-bg);
  border-color: color-mix(in oklab, var(--primary) 60%, var(--input-border));
  color: var(--input-fg);
  box-shadow: 0 0 0 .2rem color-mix(in oklab, var(--primary) 20%, transparent);
}

.forgot-password {
    color:#5d616a !important;
    font-family:"Montserrat";
    font-size:14px;
}

#login::placeholder, #senha::placeholder {
     font-family: 'PP Monument Extended';
     font-size:13px;
}

html[data-theme="dark"] #login::placeholder,
html[data-theme="dark"] #senha::placeholder {
    color:#5d616a;
}



.input-group:focus-within{ position:relative; }
.input-group:focus-within::after{
  content:""; position:absolute; inset:-1px; border-radius:.5rem;
  border:1px solid color-mix(in oklab, var(--primary) 40%, transparent);
  animation:ripple .6s ease forwards;
}
@keyframes ripple{ from{ opacity:.3 } to{ opacity:0; transform:scale(1.02) } }
.input-group-text{
  background: color-mix(in oklab, var(--input-bg) 85%, #ffffff 15%);
  border-color: var(--input-border);
  color: color-mix(in oklab, var(--input-fg) 75%, #7d8590);
}

.btn-primary{
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-700);
  --bs-btn-hover-border-color: var(--primary-700);
  box-shadow:0 8px 24px color-mix(in oklab, var(--primary) 35%, transparent);
  transition: box-shadow .2s ease, transform .08s ease, filter .2s ease;
  font-size:14px !important;
  font-family: 'Monument Extended';
  text-transform:uppercase;
  letter-spacing:2px;
}
/* Removido o efeito de pressionar (translateY) */
.btn-primary:active{ transform: none; }
.btn-primary.loading{ pointer-events:none; filter:saturate(.8) contrast(.95); background: #77158b73;
    border-color: #77158b73; }
.btn-primary.loading::after{
  content:""; display:inline-block; width:1rem; height:1rem; margin-left:.5rem; border-radius:50%;
  border:2px solid rgba(255,255,255,.7); border-top-color:transparent; animation: spin .7s linear infinite; vertical-align:-2px;
}
@keyframes spin{ to{ transform:rotate(360deg) } }

/* Disabled primary button appearance on guest pages (e.g., Confirm Password) */
#submitBtn:disabled,
.btn-primary:disabled{
  background: #333 !important;
  border-color: #333 !important;
  --bs-btn-bg: #333;
  --bs-btn-border-color: #333;
  box-shadow: none !important;
  filter: none !important;
}

.magnet-wrap{ position:relative; display:inline-block; }
/* Desativado: efeito magnético/transformações do botão */
.magnet{ transition: none; transform: none; will-change: auto; }

.form-check-label.text-secondary{ font-size:14px; color: var(--muted)!important; }
a.link-light{ font-size:14px; color: color-mix(in oklab, var(--txt) 80%, var(--muted)) !important; }
.legal-link { letter-spacing: .03em; opacity: .9; font-size: 11px !important; }
.legal-link:hover { opacity: 1; color:#fff !important; }

/* Footer fixo, sempre visível */
footer{
  position: fixed; left:0; right:0; bottom:0; z-index: 2; /* acima do canvas, abaixo do toggle */
  background: var(--footer-bg);
  backdrop-filter: blur(4px);
  padding:1rem; text-align:center;
  transition: background .35s ease, color .35s ease;
}
.powered{ color: color-mix(in oklab, var(--txt) 85%, transparent); opacity:.9; letter-spacing:.04em; }
.disclaimer{ color:var(--muted); margin:.5rem auto 0; max-width: 960px; font-size: 11px; }

/* Toggle tema (fica acima de tudo) */
.theme-toggle{
  z-index: 3;
  display:inline-flex; align-items:center; gap:10px; padding:8px 12px; border-radius:999px;
  background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(6px);
  box-shadow: var(--shadow); color: var(--txt); cursor:pointer; user-select:none;
  transition: background .2s ease, border-color .2s ease, transform .08s ease;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover{ background: var(--glass-hover); }
.theme-toggle:active{ transform: translateY(1px); }
.theme-toggle i{ font-size:18px; line-height:0; }
.theme-label{ font-size:13px; color: var(--muted); }
.toggle-pass { background:#000;}
html[data-theme="light"] .toggle-pass { background:#ccc; color: #555;}

/* Language toggle (EN/PT) */
.lang-pill{
  width:38px; height:38px; border-radius:50%; display:grid; place-items:center;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--txt);
  text-decoration:none; font-weight:700; font-size:.8rem; line-height:1;
  box-shadow: var(--shadow); cursor:pointer; user-select:none;
  transition: background .2s ease, border-color .2s ease, transform .08s ease;
  letter-spacing:1px;
}
.lang-pill:hover{ background: var(--glass-hover); }
.lang-pill:active{ transform: translateY(1px); }

.header-btns {
  padding: 18px 12px;
  position: relative;
  z-index: 3; /* acima do content-layer (z-index:1) e do canvas (0) */
}

#email {
    font-size:14px;
}

#login.form-control, #senha.form-control {
    font-size:14px !important;
}

.btn-check:checked+.btn, .btn.active, .btn.show, .btn:first-child:active, :not(.btn-check)+.btn:active {
    background:#50158b;
    border-color:#50158b;
}


/* Hover/active com contraste por tema */
html[data-theme="dark"] .theme-toggle:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}
html[data-theme="dark"] .theme-toggle:active{
  background: rgba(255,255,255,.14);
}

html[data-theme="light"] .theme-toggle:hover{
  background: rgba(8,12,20,.06);
  border-color: rgba(8,12,20,.12);
}
html[data-theme="light"] .theme-toggle:active{
  background: rgba(8,12,20,.10);
}

/* Focus visível e acessível */
.theme-toggle:focus-visible{
  outline: 2px solid color-mix(in oklab, var(--primary) 60%, transparent);
  outline-offset: 2px;
  box-shadow: 0 0 0 .15rem color-mix(in oklab, var(--primary) 22%, transparent);
}

@media (hover: none) and (pointer: coarse){
  .theme-toggle:hover{
    background: var(--glass);     /* volta ao estado base */
    border-color: var(--glass-border);
  }
}

.toast-container{ position: fixed; top: 80px; right: 16px; z-index: 4; }

/* Responsivo */
@media (max-width: 991.98px){
  .hero, .panel{ min-height: inherit; justify-content:center; align-items:center; padding:24px 20px; }
  .brand{margin: 10px auto 0px; text-align:center; }
  .brand img{ max-width:200px; }
  .card-glass{ margin: 0 auto; }
}
@media (max-width: 575.98px){
  .hero, .panel{ min-height: auto; padding: 20px 16px; gap:30px; }
  .brand img{ max-width: 110px; }
  .card-glass{ max-width: 100%; }
  .disclaimer{ font-size: .78rem; padding: 0 12px; }
  .theme-label{ display: none; }
  html[data-theme="light"] .theme-toggle:hover {
    background: #fff;
  }
  .header-btns {
    padding: 18px 24px;
  }

  #flag {
    width:34px;
  }
}

@media (min-width:768px) {
    .box-login {
        width:400px;
    }
}

/* ===== Mobile: rolagem normal e rodapé não fixo ===== */
@media (max-width: 575.98px){
  html, body{ height:auto; overflow:auto; }
  main{ min-height:auto; overflow:visible; }

  footer{
    position: relative;
    z-index: 2;
    inset: auto;
    background: var(--footer-bg);
    backdrop-filter: none;
    padding-bottom: 24px;
  }

  .content-layer{ z-index: auto; }

  footer.reveal{ opacity:1; transform:none; }
}
