/* Portal Disploki - identidade visual da Central de Serviços */

/* O mockup não tem ilustração do lado esquerdo do banner, só a saudação */
.scene-left {
    display: none !important;
}

/* O container original força height:100vh e deixa o flexbox encolher o banner
   quando o conteúdo (saudação maior) não cabe, cortando o botão. Deixa esticar. */
.helpdesk-home-container {
    height: auto !important;
    min-height: 100vh;
}

/* O nativo usa 70px de padding-bottom aqui + 70px de padding-top na seção
   de baixo (.tickets-banner) -- os dois somados deixavam um vão enorme
   entre os cards e a tabela de "Chamados em andamento". Aproxima as duas
   seções. */
.tiles-banner {
    padding-bottom: 24px !important;
}

.tickets-banner {
    padding-top: 24px !important;
}

.search-banner {
    flex-shrink: 0;
    /* Layout em coluna: a foto ocupa o banner inteiro (topo) e a saudação
       vira uma faixa fina abaixo, ao invés de dividir o banner em duas
       colunas (foto espremida numa faixa lateral fixa). */
    flex-direction: column !important;
    align-items: stretch !important;
    background: var(--glpi-mainmenu-bg, #0d2b5e) !important;
}

/* O GLPI só mostra a foto do banner (.scene) em janelas com 1600px+ de
   largura por padrão. Aqui a foto é importante pra identidade visual, então
   forço ela a aparecer a partir de telas bem menores também. */
.scene-right {
    /* O CSS nativo do GLPI (.search-banner .scene) usa position:absolute,
       o que tirava a foto do fluxo normal -- ela flutuava por cima da
       saudação e dos cards abaixo ao invés de empurrar tudo pra baixo.
       Precisa virar um item de fluxo normal pra funcionar dentro do
       flex-column do .search-banner. */
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    order: -1;
    width: 100% !important;
    max-width: 100% !important;
    /* Banner oficial (disploki-banner.png) tem proporção ~8.36:1 (1915x229) --
       usa a proporção real da imagem pra não forçar corte de cima/embaixo. */
    aspect-ratio: 1915 / 229;
    height: auto !important;
    max-height: 240px;
    align-items: stretch !important;
}

.scene-right img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
}

@media (max-width: 900px) {
    .scene-right {
        aspect-ratio: 1915 / 229;
        max-height: 110px;
    }
}

/* .container-narrow (a classe nativa desse elemento) centraliza sozinho com
   um max-width diferente do .container-xl usado pelos cards logo abaixo --
   isso fazia a saudação ficar deslocada/desalinhada em relação aos cards
   (o problema de "posicionamento" apontado). Replica os MESMOS breakpoints
   do .container-xl aqui, pra alinhar as duas bordas esquerdas. */
.search-banner-content:has(.pd-hero) {
    /* Faixa fina abaixo do banner, não um bloco alto -- padding reduzido. */
    padding-top: 14px;
    padding-bottom: 14px;
    max-width: 100%;
    width: 100%;
}

@media (min-width: 1200px) {
    .search-banner-content:has(.pd-hero) {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .search-banner-content:has(.pd-hero) {
        max-width: 1320px;
    }
}

.pd-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    color: #fff;
    position: relative;
    z-index: 1;
}

.pd-hero-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.pd-hero-title.pd-hero-title {
    font-size: 1.15rem;
    margin-bottom: 0.1rem;
    color: #fff;
    text-transform: capitalize;
}

.pd-hero-sub {
    font-weight: 600;
    margin-bottom: 0;
    opacity: 0.95;
    font-size: 0.85rem;
}

.pd-hero-desc {
    display: none;
}

.pd-hero-btn.pd-hero-btn {
    background: #fff;
    color: var(--glpi-mainmenu-bg, #1b3d8f);
    border: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pd-hero-btn.pd-hero-btn:hover {
    opacity: 0.9;
    color: var(--glpi-mainmenu-bg, #1b3d8f);
}

/* Cards de tiles: primeiro card (Criar um chamado) em destaque + demais
   agrupados num painel "Acesso rápido", igual ao mockup */
.pd-tiles-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.pd-tile-featured {
    flex: 1 1 380px;
    min-width: 320px;
}

/* Altura só do próprio conteúdo (igual às tiles do "Acesso rápido"),
   não estica pra cobrir a altura toda do painel ao lado. */
.pd-tile-featured .card {
    display: flex;
    width: 100%;
    height: auto;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pd-tile-featured .card-body .d-flex {
    flex-wrap: nowrap;
}

.pd-quick-access {
    flex: 2 1 520px;
    min-width: 420px;
    background: var(--glpi-helpdesk-tiles-section-bg, #f6f8fb);
    border-radius: 12px;
    padding: 1.25rem;
}

.pd-quick-access-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--glpi-mainmenu-bg, #1b3d8f);
}

.pd-quick-access .row {
    margin: 0 -0.375rem;
}

.pd-quick-access .row > div {
    padding: 0.375rem;
}

.pd-quick-access .card {
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Painel de marca na tela de login, com a mesma foto do banner */
.portaldisploki-login-panel {
    position: relative;
    background: linear-gradient(160deg, var(--glpi-mainmenu-bg, #0b2a6b), var(--glpi-mainmenu-bg-hover, #1b3d8f));
    color: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 320px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    gap: 0.5rem;
    overflow: hidden;
    background-image: linear-gradient(180deg, rgba(11, 42, 107, 0.35), rgba(11, 42, 107, 0.92) 75%), url("/plugins/portaldisploki/img/banner.png");
    background-size: cover;
    background-position: center;
}

.portaldisploki-login-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 0.5rem;
}

.portaldisploki-login-panel h3 {
    color: #fff;
    margin-bottom: 0.25rem;
}

.portaldisploki-login-panel p {
    opacity: 0.9;
    margin: 0;
}

@media (max-width: 768px) {
    .pd-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pd-tiles-wrapper {
        flex-direction: column;
    }
}

/* ==========================================================================
   Login em duas colunas (login_redesign.js monta a estrutura, isso estiliza)
   ========================================================================== */

.pd-hidden-field {
    display: none !important;
}

body.welcome-anonymous .flex-fill.d-flex.flex-column.justify-content-center {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
    justify-content: flex-start !important;
}

body.welcome-anonymous .container-tight.py-6 {
    max-width: 100% !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

body.welcome-anonymous .main-content-card {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.pd-login-left {
    flex: 1 1 50%;
    min-width: 320px;
    min-height: 100vh;
    position: relative;
    color: #fff;
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(160deg, rgba(0, 25, 66, 0.55), rgba(0, 32, 77, 0.92)),
        url("/plugins/portaldisploki/img/banner.png");
    background-size: cover;
    background-position: center;
}

.pd-login-logo {
    height: 46px;
}

.pd-login-left-mid h1 {
    color: #fff;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.pd-login-left-mid h1 span {
    color: #5bc2ff;
}

.pd-login-left-mid p {
    opacity: 0.9;
    max-width: 28rem;
    margin-bottom: 2rem;
}

.pd-login-features {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pd-login-feature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    max-width: 110px;
    font-weight: 600;
}

.pd-login-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.pd-login-tagline {
    font-style: italic;
    opacity: 0.85;
    font-size: 1.1rem;
}

.pd-login-right.pd-login-right {
    flex: 1 1 50%;
    min-width: 320px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f4f9fe;
    padding: 3rem 2rem;
}

.pd-login-logo-color {
    height: 42px;
    margin-bottom: 2rem;
}

.pd-login-right .row.justify-content-center {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.pd-login-right .col-md-5 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0;
}

.pd-login-right .card-header.mb-4 {
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    margin-bottom: 1.5rem !important;
}

.pd-login-right .card-header.mb-4 h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0b2a6b;
    margin: 0;
    text-align: left;
}

.pd-login-subtitle {
    color: #5b6b82;
    margin: 0.25rem 0 0;
}

.pd-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #dbe4f3;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    background: #fff;
    position: relative;
}

.pd-input-icon {
    font-size: 1.15rem;
    color: #0d47a1;
    flex: 0 0 auto;
}

.pd-input-col {
    flex: 1 1 auto;
    min-width: 0;
}

.pd-input-wrap label {
    display: block;
    font-weight: 700;
    color: #0b2a6b;
    margin: 0 0 0.1rem;
    font-size: 0.92rem;
}

.pd-input-wrap input {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 0.85rem;
    color: #8792a2;
    background: transparent !important;
    width: 100%;
}

.pd-input-wrap input:focus {
    outline: none;
}

.pd-input-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #8792a2;
    cursor: pointer;
}

.pd-login-btn.pd-login-btn {
    background: #0d47a1;
    border-color: #0d47a1;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-login-btn.pd-login-btn:hover {
    background: #0b3a85;
    border-color: #0b3a85;
}

.pd-login-info {
    margin-top: 1.25rem;
    background: #eef4fc;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #3a4b63;
    align-items: flex-start;
}

.pd-login-info i {
    color: #0d47a1;
    margin-top: 0.1rem;
}

.pd-login-trust {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #8792a2;
}

.pd-login-trust i {
    margin-right: 0.25rem;
    color: #0d47a1;
}

@media (max-width: 900px) {
    .pd-login-left {
        display: none;
    }
}

/* ==========================================================================
   Fundo colorido atrás dos ícones dos cards + botão dentro do card destaque
   ========================================================================== */

.pd-tile-featured .aspect-ratio-1,
.pd-quick-access .aspect-ratio-1 {
    background: #eef2fb;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.pd-quick-access .row > div:nth-child(6n + 1) .aspect-ratio-1 {
    background: #e3edfd;
}

.pd-quick-access .row > div:nth-child(6n + 2) .aspect-ratio-1 {
    background: #e2f7ec;
}

.pd-quick-access .row > div:nth-child(6n + 3) .aspect-ratio-1 {
    background: #f2e8fb;
}

.pd-quick-access .row > div:nth-child(6n + 4) .aspect-ratio-1 {
    background: #fdece0;
}

.pd-quick-access .row > div:nth-child(6n + 5) .aspect-ratio-1 {
    background: #e1f5f5;
}

.pd-quick-access .row > div:nth-child(6n + 6) .aspect-ratio-1 {
    background: #eceef1;
}

.pd-tile-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    color: var(--glpi-mainmenu-bg, #1b3d8f);
    font-weight: 700;
    font-size: 0.9rem;
}
