/* Ecrã de autenticação */
body.rota-login {
  overflow: hidden;
}

body.rota-login .topbar,
body.rota-login .sidebar,
body.rota-login .app-footer {
  display: none;
}

body.rota-login .main-container {
  min-height: 100vh;
}

body.rota-login #content {
  position: relative;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

.login-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
  background: var(--color-bg);
  isolation: isolate;
}

/* Concept A: the constellation (js/tres/login.js) fills this layer; without 3D the soft gradient stays. */
.login-fundo {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 46%, #0c2236 0%, #07131f 48%, #040b14 100%);
}

.login-fundo .palco-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* The old square decoration and two-colour bar are gone with the new look; the markup node is inert. */
.login-deco-bottom {
  display: none;
}

.login-stage .login-card {
  transition: opacity .5s ease, transform .5s ease;
}

/* Over the live constellation the card turns to frosted glass (ink on deep blue). */
.login-fundo.com-3d ~ .login-card {
  background: rgba(7, 19, 31, .62);
  border-color: rgba(220, 232, 243, .14);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.login-stage .login-card.leaving {
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
}

.login-clarao {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff, #dce8f3 35%, #07131f 90%);
}

.login-card {
  position: relative;
  width: 380px;
  max-width: calc(100% - 32px);
  padding: 30px 34px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg0);
  box-shadow: 0 12px 34px color-mix(in srgb, var(--color-accent) 15%, transparent);
  z-index: 0;
}

.login-brand {
  display: block;
  text-align: center;
  line-height: 0;
}

.login-brand img {
  width: auto;
  height: 42px;
}

.login-subtitle {
  margin: 10px 0 20px;
  color: var(--color-muted);
  font-size: var(--fs-5);
  text-align: center;
}

.login-card .form-group {
  margin-bottom: 16px;
}

.login-card label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--fs-7);
  font-weight: 600;
}

.login-card input {
  width: 100%;
  height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-fg);
  font: inherit;
}

.login-card input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 90px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-4);
  background: transparent;
  color: var(--color-accent);
  font-size: var(--fs-5);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--color-accent-soft);
}

.login-submit {
  width: 100%;
  height: 40px;
  margin-top: 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 85%, white));
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.login-submit:hover {
  filter: brightness(1.06);
}

.login-card small {
  display: block;
  margin-top: 16px;
  color: var(--color-muted);
  font-size: var(--fs-5);
  line-height: 1.45;
  text-align: center;
}

.login-message {
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.login-message.error {
  background: color-mix(in srgb, var(--color-error) 10%, transparent);
  color: var(--color-error);
  font-size: var(--fs-7);
}

.login-setup h2 {
  margin: 0 0 10px;
  font-size: var(--fs-13);
  text-align: center;
}

.login-setup code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: var(--radius-4);
  background: var(--color-bg);
  font-size: var(--fs-5);
}

@media (max-width: 480px) {
  .login-stage::after,
  .login-deco-bottom {
    display: none;
  }
}

/* Second sign-in step: authenticator code (and first-time enrolment QR). */
.login-totp-titulo { margin: 0 0 6px; font-size: var(--fs-11); text-align: center; }
.login-totp-ajuda { margin: 0 0 12px; color: var(--color-muted); font-size: var(--fs-6); line-height: 1.45; }
.login-totp-qr { display: flex; justify-content: center; margin: 0 0 10px; }
.login-totp-qr img { width: 180px; height: 180px; border-radius: var(--radius-sm); image-rendering: pixelated; }
.login-totp-chave { margin: 0 0 12px; color: var(--color-muted); font-size: var(--fs-7); text-align: center; }
.login-totp-chave code { display: block; margin-top: 4px; font-size: var(--fs-5); user-select: all; }
#totp-codigo { letter-spacing: 0.3em; text-align: center; font-size: var(--fs-9); }
.login-totp-voltar { display: block; margin: 10px auto 0; border: 0; background: none; color: var(--color-muted); font: inherit; font-size: var(--fs-6); cursor: pointer; }
.login-totp-voltar:hover { color: var(--color-fg, inherit); text-decoration: underline; }
