/* Login page layout — scoped under html.modern; reuses Phase 0 tokens/components. */
html.modern #login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--m-space-4);
  padding: var(--m-space-5);
  background-color: var(--m-app-bg);
  background-image:
    linear-gradient(var(--m-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--m-grid-line) 1px, transparent 1px);
  background-size: 160px 160px;
}
/* White-label login background: when a real bg image is set (…/{id}-loginbg.png),
   show the image instead of the default grid. */
html.modern #login-page[style*="--login-bg"] {
  background-image: var(--login-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
html.modern .login-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: var(--m-space-6);
  text-align: center;
}
html.modern .login-logo-badge {
  width: 96px; height: 96px;
  margin: 0 auto var(--m-space-4);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--m-radius-lg);
  background: color-mix(in srgb, var(--primary-site-color) 12%, transparent);
}
html.modern .login-logo-badge > img { max-width: 70%; max-height: 70%; }
/* The bottom margin carries the gap to the form. It used to live on the
   subtitle that sat under this title; with that removed the title owns it. */
html.modern .login-title {
  font-size: 28px; font-weight: 700; margin: 0 0 var(--m-space-5); color: var(--m-text);
}
html.modern .login-card .form-group { text-align: left; margin-bottom: var(--m-space-4); }
/* Icon sits INSIDE the field at its right edge. The input-group becomes a plain
   relative box so the .form-control spans the full width and the icon overlays it
   (padding-right reserves the space). position:relative needs !important to beat
   theme-custom.css's `.input-group { position: initial !important }` — without a
   positioned container the absolute icon escapes to the viewport edge (scoped to
   #login-page). theme-custom.css also forces the addon background-color with
   !important, so we override it the same way; the addon color token
   (--select-group-addon-color) is already theme-aware, so we leave it. z-index keeps
   the icon above the input's Bootstrap z-index:2 (the opaque fill would otherwise hide
   it), and pointer-events:none lets clicks fall through to the input. */
html.modern #login-page .input-group-icon { display: block; position: relative !important; }
html.modern #login-page .input-group-icon .form-control {
  display: block; float: none; width: 100%;
  padding-right: 40px;
  border-radius: var(--m-radius-sm);
}
html.modern #login-page .input-group-icon .input-group-addon {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; width: auto;
  padding: 0 var(--m-space-3);
  background: transparent !important;
  border: none !important;
  pointer-events: none;
}
/* "Esqueci minha senha" now lives under the button — right-aligned to the button's edge. */
html.modern .login-forgot { display: block; text-align: right; font-size: 13px; margin-top: var(--m-space-3); }
html.modern .login-card .btn-block { margin-top: var(--m-space-3); }
html.modern .login-signup { text-align: center; margin: var(--m-space-4) 0 0; color: var(--m-text-muted); }
html.modern .login-footer { color: var(--m-text-muted); font-size: 12px; margin: 0; }
/* theme toggle */
html.modern .login-theme-toggle {
  position: fixed; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: var(--m-radius-sm);
  border: 1px solid var(--m-card-border); background: var(--m-card-bg);
  color: var(--m-text); cursor: pointer;
}
html.modern .login-theme-toggle:hover { background: rgba(127,127,127,.08); }
