/* Corrige o customlogin no GLPI 11. Gerado pela role identidade_glpi, nao edite. */

/* O formulario ocupa a largura do cartao de login. */
html.stcl-enabled.stcl-login-enabled body.welcome-anonymous
.page-anonymous form .row > .col-md-5 {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

html.stcl-enabled.stcl-login-enabled body.welcome-anonymous
.page-anonymous form .btn-primary {
    color: #ffffff !important;
    --tblr-btn-color: #ffffff;
    --tblr-btn-hover-color: #ffffff;
}

/* O main do GLPI 11 e bloco, e sem flex o cartao gruda no topo. */
html.stcl-enabled.stcl-login-enabled body.welcome-anonymous main.page-anonymous {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

html.stcl-enabled.stcl-login-enabled body.welcome-anonymous main.page-anonymous > .flex-fill {
    flex: 0 0 auto !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}

/* O customlogin poe o rodape no main; ele segue a largura e o lado do cartao. */
html.stcl-enabled.stcl-login-enabled body.welcome-anonymous #stcl-login-footer {
    width: min(calc(100% - 2rem), var(--stcl-card-width));
    margin: 0 auto;
}

html.stcl-enabled.stcl-login-enabled.stcl-login-align-left body.welcome-anonymous #stcl-login-footer {
    margin-left: clamp(1rem, 4vw, 5rem);
    margin-right: auto;
}

html.stcl-enabled.stcl-login-enabled.stcl-login-align-right body.welcome-anonymous #stcl-login-footer {
    margin-right: clamp(1rem, 4vw, 5rem);
    margin-left: auto;
}

/* O logo do menu ganha fundo proprio, porque o do cliente pode sumir na barra. */
body:not(.welcome-anonymous) .navbar-brand .glpi-logo,
body:not(.welcome-anonymous) aside.sidebar a.navbar-brand span.glpi-logo {
    --logo: none !important;
    content: none !important;
    display: block !important;
    width: 180px !important;
    height: 54px !important;
    background: transparent url('/plugins/customlogin/asset.php?key=navbar_logo&v=2') center / 160px auto no-repeat !important;
    border-radius: 6px;
}

body.navbar-collapsed .navbar-brand .glpi-logo {
    width: 44px !important;
    background: transparent url('/plugins/customlogin/asset.php?key=navbar_logo_collapsed&v=2') center / contain no-repeat !important;
}

/* Catálogo de serviços: ícone de 56px no lugar dos 100px do GLPI, para o título ter espaço no cartão */
a.card > .card-body > .d-flex > img.max-width-unset {
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px;
    flex-shrink: 0;
}
a.card > .card-body > .d-flex > .ms-4 {
    margin-left: .9rem !important;
    min-width: 0;
}
a.card > .card-body .card-title {
    overflow-wrap: break-word;
    hyphens: auto;
}

/* GLPI 11: entre 768px e 991px a barra de navegação (secondary-bar) fica fixa a 79px do topo, mas o
   cabeçalho só fica fixo a partir de 992px; ao rolar, ele some e deixa um vão. Nessa faixa a barra cola no topo. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .secondary-bar.sticky-md-top {
        top: 0 !important;
    }
}
