/* Se carga mediante el plugin plg_system_mba3newsletterlogin.
   Las reglas se limitan al formulario de acceso y no dependen de YOOtheme. */
body:has(form.com-users-login__form) {
  margin: 0;
  min-height: 100vh;
  background: #f2f5f7;
  color: #172b3a;
}

body:has(form.com-users-login__form)::before {
  content: "NEWSLETTER";
  display: flex;
  width: 100%;
  min-height: 85px;
  box-sizing: border-box;
  align-items: center;
  justify-content: flex-end;
  padding: 25px 42px 25px 190px;
  background-color: #214b67;
  background-image: url('/newsletter-assets/assets/logo-mba3-blanco.svg');
  background-position: 42px center;
  background-repeat: no-repeat;
  background-size: 135px auto;
  color: #fff;
  font: 700 26px/1.2 'DejaVu Sans', Arial, sans-serif;
}

body:has(form.com-users-login__form) .tm-header,
body:has(form.com-users-login__form) .tm-toolbar,
body:has(form.com-users-login__form) .tm-top,
body:has(form.com-users-login__form) .tm-top-a,
body:has(form.com-users-login__form) .tm-top-b,
body:has(form.com-users-login__form) .tm-top-c,
body:has(form.com-users-login__form) .tm-main-top,
body:has(form.com-users-login__form) .tm-main-bottom,
body:has(form.com-users-login__form) .tm-bottom,
body:has(form.com-users-login__form) .tm-sidebar,
body:has(form.com-users-login__form) .tm-sidebar-a,
body:has(form.com-users-login__form) .tm-sidebar-b,
body:has(form.com-users-login__form) .tm-footer,
body:has(form.com-users-login__form) .container-header,
body:has(form.com-users-login__form) .container-footer,
body:has(form.com-users-login__form) .uk-breadcrumb,
body:has(form.com-users-login__form) .breadcrumb,
body:has(form.com-users-login__form) .page-header,
body:has(form.com-users-login__form) .com-users-login__description,
body:has(form.com-users-login__form) .com-users-login__registration,
body:has(form.com-users-login__form) .com-users-login__remember,
body:has(form.com-users-login__form) .control-group:has(input[type="checkbox"][name*="remember"]),
body:has(form.com-users-login__form) .control-group:has(input[name*="remember"]),
body:has(form.com-users-login__form) .uk-margin:has(input[name*="remember" i]),
body:has(form.com-users-login__form) .form-check:has(input[name*="remember" i]),
body:has(form.com-users-login__form) .com-users-login__form > p {
  display: none !important;
}

body:has(form.com-users-login__form) #footerfacts22,
body:has(form.com-users-login__form) [id="footer#21"] {
  display: none !important;
}

/* Si la plantilla incluye un control de cierre de sesión, se conserva. */
body:has(form.com-users-login__form) .tm-header:has(a[href*="logout"], form[action*="logout"]),
body:has(form.com-users-login__form) .container-header:has(a[href*="logout"], form[action*="logout"]) {
  position: absolute;
  z-index: 2;
  top: 1rem;
  right: 1.25rem;
  display: block !important;
  background: transparent;
}

body:has(form.com-users-login__form) .tm-header:has(a[href*="logout"], form[action*="logout"]) *:not(:has(a[href*="logout"], form[action*="logout"])):not(a[href*="logout"]):not(form[action*="logout"]),
body:has(form.com-users-login__form) .container-header:has(a[href*="logout"], form[action*="logout"]) *:not(:has(a[href*="logout"], form[action*="logout"])):not(a[href*="logout"]):not(form[action*="logout"]) {
  display: none !important;
}

body:has(form.com-users-login__form) a[href*="logout"],
body:has(form.com-users-login__form) form[action*="logout"] {
  color: #35536a;
  font-size: .875rem;
}

body:has(form.com-users-login__form) .tm-main,
body:has(form.com-users-login__form) main {
  display: grid;
  min-height: calc(100vh - 4rem);
  align-items: center;
  justify-items: center;
  padding: 1rem 1rem 2rem;
}

body:has(form.com-users-login__form) .com-users-login,
body:has(form.com-users-login__form) .com-users-login__form,
body:has(form.com-users-login__form) form.form-validate:has(input[name="username"]):has(input[name="password"]) {
  box-sizing: border-box;
  width: min(100%, 27rem);
  margin: 0 auto;
}

body:has(form.com-users-login__form) .com-users-login,
body:has(form.com-users-login__form) form.form-validate:has(input[name="username"]):has(input[name="password"]) {
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid #dce5eb;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 48px #163b5512;
}

body:has(form.com-users-login__form) .com-users-login h1,
body:has(form.com-users-login__form) .com-users-login h2,
body:has(form.com-users-login__form) .com-users-login__form legend {
  display: none !important;
}

body:has(form.com-users-login__form) form.form-validate:has(input[name="username"]):has(input[name="password"]) .control-group:not(:has(input[name="username"], input[name="password"], button[type="submit"], input[type="submit"], [id*="webauthn" i], [class*="webauthn" i], [name*="webauthn" i], [id*="passkey" i], [class*="passkey" i], [name*="passkey" i])) {
  display: none !important;
}

body:has(form.com-users-login__form) label,
body:has(form.com-users-login__form) .control-label {
  display: block;
  margin: 0 0 .4rem;
  color: #263f52;
  font-size: .9rem;
  font-weight: 650;
}

body:has(form.com-users-login__form) input[name="username"],
body:has(form.com-users-login__form) input[name="password"] {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: .35rem 0 1.1rem;
  padding: .75rem .9rem;
  border: 1px solid #b8c8d3;
  border-radius: .55rem;
  background: #fff;
  color: #172b3a;
  font: inherit;
}

body:has(form.com-users-login__form) input[name="username"]:focus,
body:has(form.com-users-login__form) input[name="password"]:focus,
body:has(form.com-users-login__form) input[name="username"]:focus-visible,
body:has(form.com-users-login__form) input[name="password"]:focus-visible {
  border-color: #087cae;
  outline: 3px solid #1598c833;
  outline-offset: 1px;
}

body:has(form.com-users-login__form) button[type="submit"],
body:has(form.com-users-login__form) input[type="submit"] {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: .5rem;
  padding: .75rem 1rem;
  border: 0;
  border-radius: 5px;
  background: #214b67;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}

body:has(form.com-users-login__form) button[type="submit"]:hover,
body:has(form.com-users-login__form) input[type="submit"]:hover {
  background: #667c85;
}

body:has(form.com-users-login__form) button[type="submit"]:active,
body:has(form.com-users-login__form) input[type="submit"]:active {
  transform: translateY(1px);
}

body:has(form.com-users-login__form) button[type="submit"]:focus-visible,
body:has(form.com-users-login__form) input[type="submit"]:focus-visible,
body:has(form.com-users-login__form) a[href*="logout"]:focus-visible {
  outline: 3px solid #f2ad3d;
  outline-offset: 3px;
}

body:has(form.com-users-login__form) .com-users-login__options {
  display: block !important;
  margin: .75rem 0 0;
  padding: 0;
  border: 0 !important;
  background: transparent;
  list-style: none;
  text-align: center;
}

body:has(form.com-users-login__form) .com-users-login__options li:not(:has(a[href*="view=reset"], a[href*="/reset"])) {
  display: none !important;
}

body:has(form.com-users-login__form) .com-users-login__options a[href*="view=reset"],
body:has(form.com-users-login__form) .com-users-login__options a[href*="/reset"] {
  display: inline-block;
  padding: .35rem .5rem;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #214b67;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .18em;
}

body:has(form.com-users-login__form) :is(button, a)[id*="webauthn" i],
body:has(form.com-users-login__form) :is(button, a)[class*="webauthn" i],
body:has(form.com-users-login__form) :is(button, a)[id*="passkey" i],
body:has(form.com-users-login__form) :is(button, a)[class*="passkey" i] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: #eaf0f1;
  color: #214b67;
}

body:has(form.com-users-login__form) #system-message-container,
body:has(form.com-users-login__form) .alert {
  width: min(100%, 27rem);
  margin: 0 auto 1rem;
}

@media (max-width: 480px) {
  body:has(form.com-users-login__form)::before {
    min-height: 73px;
    padding: 22px 22px 22px 150px;
    background-position: 22px center;
    background-size: 110px auto;
    font-size: 21px;
  }

  body:has(form.com-users-login__form) .tm-main,
  body:has(form.com-users-login__form) main {
    padding: 1rem .75rem;
  }
}
