/*
 * AtendeCidadão — Monte Sião
 * Modernização da tela de login do GLPI 11.
 * Tudo escopado em body.welcome-anonymous: não afeta a interface logada.
 * Cores amostradas do brasão: azul #0048a8 / #0090c0, verde #00a848, ouro #ffd800.
 */

:root {
    --ms-azul: #0048a8;
    --ms-azul-esc: #012a63;
    --ms-azul-prof: #001b45;
    --ms-ciano: #0090c0;
    --ms-verde: #00a848;
    --ms-ouro: #ffd800;
    --ms-tinta: #16324f;
    --ms-cinza: #5b6b7b;
    --ms-borda: #e2e8f0;
    --ms-radius: 20px;
}

/* ---------- fundo da página ---------- */
body.welcome-anonymous {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(0,144,192,.16), transparent 60%),
        radial-gradient(1000px 700px at 110% 120%, rgba(0,72,168,.14), transparent 55%),
        linear-gradient(180deg, #f4f7fb 0%, #eaf0f7 100%);
}

body.welcome-anonymous .page-anonymous > .flex-fill {
    padding: 1.5rem !important;
    margin-top: 0 !important;
}

/* esconde o logotipo padrão do GLPI acima do card */
body.welcome-anonymous .glpi-logo { display: none !important; }
body.welcome-anonymous .container-tight > .text-center:first-child { display: none; }

/* ---------- o card vira um painel largo split ---------- */
body.welcome-anonymous .container-tight {
    max-width: 960px !important;
    width: 100%;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

body.welcome-anonymous .main-content-card {
    border: 0 !important;
    border-radius: var(--ms-radius) !important;
    overflow: hidden;
    box-shadow: 0 30px 60px -25px rgba(1,27,69,.45), 0 12px 24px -18px rgba(1,27,69,.35);
    background: #fff;
}

/* neutraliza a barrinha colorida de paleta no topo do card */
body.welcome-anonymous .main-content-card::before,
body.welcome-anonymous .main-content-card::after { display: none !important; }

body.welcome-anonymous .main-content-card > .card-header { display: none !important; }
body.welcome-anonymous .main-content-card > .card-body { padding: 0 !important; }

/* a row que contém formulário (col-md-5) + painel (col-auto) */
body.welcome-anonymous .card-body > form > .row.justify-content-center {
    margin: 0 !important;
    min-height: 580px;
    flex-wrap: nowrap;
    align-items: stretch;
}

/* texto de topo institucional (se houver) */
body.welcome-anonymous .rich_text_container { display: none; }

/* ====================================================== */
/*  PAINEL HERO (esquerda) — renderizado pelo display_login */
/* ====================================================== */
body.welcome-anonymous .row.justify-content-center > .col-auto {
    order: 1;
    flex: 1 1 46%;
    max-width: 46%;
    padding: 0 !important;
    display: flex;
}

.ms-hero {
    position: relative;
    isolation: isolate;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 2.75rem;
    color: #fff;
    text-align: left;
    overflow: hidden;
    background:
        linear-gradient(150deg, var(--ms-azul-prof) 0%, var(--ms-azul-esc) 42%, var(--ms-azul) 78%, var(--ms-ciano) 130%);
}

/* textura tricô — nó à identidade da cidade (Capital Nacional da Moda Tricô) */
.ms-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: .10;
    background-image:
        repeating-linear-gradient(45deg,  rgba(255,255,255,.6) 0 2px, transparent 2px 9px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,.6) 0 2px, transparent 2px 9px);
    background-size: 13px 13px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,0) 70%);
}

/* silhueta da Serra da Mantiqueira no rodapé do painel */
.ms-hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 130px;
    z-index: -1;
    background: no-repeat bottom / cover
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 130' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' fill-opacity='0.06' d='M0 90 L70 55 L140 85 L210 40 L290 78 L360 44 L440 82 L520 52 L600 84 L600 130 L0 130 Z'/%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M0 108 L90 78 L170 100 L250 70 L340 98 L430 72 L520 96 L600 74 L600 130 L0 130 Z'/%3E%3C/svg%3E");
}

.ms-hero__logo {
    width: min(320px, 78%);
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.25));
}

.ms-hero__title {
    font-size: 1.9rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 0;
    text-wrap: balance;
}

.ms-hero__title .ms-accent {
    display: inline-block;
    background: linear-gradient(90deg, var(--ms-ouro), #ffe873);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ms-hero__sub {
    font-size: 1.02rem;
    line-height: 1.5;
    margin: 0;
    color: rgba(255,255,255,.86);
    max-width: 34ch;
}

.ms-hero__divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.35), transparent);
    border: 0;
    margin: .25rem 0;
}

.ms-cta__label {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.7);
    margin: 0 0 .7rem;
}

.ms-cta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.ms-cta__btn {
    flex: 1 1 0;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border: 1.5px solid rgba(255,255,255,.55);
    color: #fff;
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(2px);
    transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.ms-cta__btn:hover {
    background: #fff;
    color: var(--ms-azul-esc);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px -12px rgba(0,0,0,.5);
}
.ms-cta__btn:focus-visible {
    outline: 3px solid var(--ms-ouro);
    outline-offset: 2px;
}
.ms-cta__btn svg { width: 18px; height: 18px; flex: none; }

.ms-hero__foot {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 1.25rem;
    font-size: .78rem;
    color: rgba(255,255,255,.6);
}

/* ====================================================== */
/*  FORMULÁRIO (direita)                                   */
/* ====================================================== */
body.welcome-anonymous .row.justify-content-center > .col-md-5 {
    order: 2;
    flex: 1 1 54%;
    max-width: 54%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.9rem 2.9rem !important;
    background: #fff;
}

/* cabeçalho do formulário */
body.welcome-anonymous .col-md-5 > .card-header {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin-bottom: 1.6rem !important;
    display: block;
}
body.welcome-anonymous .col-md-5 > .card-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ms-tinta);
    text-align: left !important;
    margin: 0;
}
body.welcome-anonymous .col-md-5 > .card-header h2::after {
    content: "Use suas credenciais para acessar a plataforma.";
    display: block;
    font-size: .92rem;
    font-weight: 500;
    color: var(--ms-cinza);
    margin-top: .35rem;
}

/* rótulos e campos */
body.welcome-anonymous .col-md-5 .form-label {
    font-weight: 600;
    font-size: .86rem;
    color: var(--ms-tinta);
    margin-bottom: .35rem;
}
body.welcome-anonymous .col-md-5 .form-control {
    border: 1.5px solid var(--ms-borda);
    border-radius: 11px;
    padding: .72rem .9rem;
    font-size: .98rem;
    background: #fbfcfe;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
body.welcome-anonymous .col-md-5 .form-control:hover { border-color: #cbd6e4; }
body.welcome-anonymous .col-md-5 .form-control:focus {
    border-color: var(--ms-azul);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,72,168,.14);
    outline: none;
}

/* wrapper de senha com botão mostrar/ocultar (injetado pelo JS) */
body.welcome-anonymous .ms-pass-wrap { position: relative; }
body.welcome-anonymous .ms-pass-toggle {
    position: absolute;
    right: .55rem; top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border: 0; background: transparent;
    color: var(--ms-cinza);
    cursor: pointer;
    border-radius: 8px;
}
body.welcome-anonymous .ms-pass-toggle:hover { color: var(--ms-azul); background: rgba(0,72,168,.07); }
body.welcome-anonymous .ms-pass-wrap .form-control { padding-right: 3rem; }

/* botão entrar */
body.welcome-anonymous .col-md-5 .btn-primary {
    background: linear-gradient(135deg, var(--ms-azul) 0%, var(--ms-ciano) 100%) !important;
    border: 0 !important;
    border-radius: 11px !important;
    padding: .8rem 1rem !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .01em;
    box-shadow: 0 12px 22px -12px rgba(0,72,168,.7);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
body.welcome-anonymous .col-md-5 .btn-primary:hover { color: #fff !important; }
body.welcome-anonymous .col-md-5 .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 16px 28px -12px rgba(0,72,168,.75);
}
body.welcome-anonymous .col-md-5 .btn-primary:focus-visible {
    outline: 3px solid var(--ms-ouro);
    outline-offset: 2px;
}

/* "lembrar-me" */
body.welcome-anonymous .col-md-5 .form-check-input:checked {
    background-color: var(--ms-azul);
    border-color: var(--ms-azul);
}
body.welcome-anonymous .col-md-5 .form-check-label span { color: var(--ms-cinza); font-size: .9rem; }

/* fonte de autenticação (dropdown) — mantém discreto */
body.welcome-anonymous .col-md-5 select { border-radius: 11px; }

/* esqueci a senha */
body.welcome-anonymous .forgot_password a {
    color: var(--ms-azul);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
}
body.welcome-anonymous .forgot_password a:hover { text-decoration: underline; }
body.welcome-anonymous .form-footer { margin-top: .4rem; }

/* FAQ e rodapé */
body.welcome-anonymous .btn-outline-secondary { border-radius: 11px; }
body.welcome-anonymous .page-anonymous .text-muted { color: #8a99a8 !important; font-size: .8rem; }

/* assinatura TrustIT no rodapé */
body.welcome-anonymous a.ms-signature {
    color: var(--ms-cinza);
    text-decoration: none;
    font-size: .82rem;
    letter-spacing: .01em;
    transition: color .15s ease;
}
body.welcome-anonymous a.ms-signature strong { color: var(--ms-azul); font-weight: 800; }
body.welcome-anonymous a.ms-signature:hover { color: var(--ms-azul); }

/* ====================================================== */
/*  RESPONSIVO                                             */
/* ====================================================== */
@media (max-width: 900px) {
    body.welcome-anonymous .container-tight { max-width: 460px !important; }
    body.welcome-anonymous .card-body > form > .row.justify-content-center {
        flex-direction: column;
        flex-wrap: wrap;
        min-height: 0;
    }
    body.welcome-anonymous .row.justify-content-center > .col-auto,
    body.welcome-anonymous .row.justify-content-center > .col-md-5 {
        flex: 1 1 100%;
        max-width: 100%;
    }
    /* hero (com os CTAs de cadastro) no topo; formulário abaixo */
    body.welcome-anonymous .row.justify-content-center > .col-auto { order: 0; }
    body.welcome-anonymous .row.justify-content-center > .col-md-5 { order: 1; }
    .ms-hero {
        padding: 2rem 1.75rem;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }
    .ms-hero__sub { max-width: none; }
    .ms-hero__logo { width: min(240px, 70%); }
    .ms-hero__title { font-size: 1.5rem; }
    .ms-hero__foot { display: none; }
    body.welcome-anonymous .row.justify-content-center > .col-md-5 { padding: 2rem 1.6rem !important; }
    body.welcome-anonymous .col-md-5 > .card-header h2 { text-align: center !important; }
    body.welcome-anonymous .col-md-5 > .card-header h2::after { text-align: center; }
}

@media (max-width: 380px) {
    .ms-cta { flex-direction: column; }
}

/* respeita quem prefere menos animação */
@media (prefers-reduced-motion: reduce) {
    body.welcome-anonymous * { transition: none !important; }
}
