Hook to /panel/login "template" to customize or add HTML, from plugin

I’m trying to customize the /panel login.
I know I can do that from config.php with a tiny line of config code and a panel.css file, to do things like change colors or fonts, etc.

// config.php
return[
    'panel' => [
        'css' => 'assets/css/panel.css'
    ]
]

But now I would want to add custom template code to the panel (specifically the /panel/login) page.
And I’d like to do this in a dynamic way, not add a CSS file, but add a template code, for example some HTML to include a custom div or something.

Let’s say the content of a field in the site panel. For the sake of an example if I want to add a customizable button color:

<style>

k-login-button.k-button {
–-theme-color-back: <?= $site->loginColorBack() ?>;
}

</style>

How would I include/inject/hook that into the panel login page, and do it from a plugin?
Any hook I tried did not do anything.

Any tips or direction welcome. Thanks!

You would have to overwrite the k-login-view component. But then you also need to ensure that your new component always works when upgrading to a new Kirby version (with potential changes to the default k-login-view).

That looks like something I would prefer to avoid.
For now I used simply a CSS loaded in panel and static files and rules.

If not overwriting the k-login-view, is that the kind of thing that I could do by editing the page.render hook? Like checking if the current page is “login” and then replacing the element with my CSS followed by the element? Is that something that could work :thinking:
I tried something like that but scraped it because I did not manage to make it work. I should dig in the direction again maybe.