/* FGM Theme - telas sem login (login, esqueci minha senha, etc.) */

body.welcome-anonymous {
    --tblr-primary: var(--fgm-navy);
    --tblr-primary-rgb: 28, 54, 99;
    --tblr-link-color: var(--fgm-navy-700);
    --tblr-link-color-rgb: 38, 72, 127;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(145, 193, 85, .14), transparent 60%),
        radial-gradient(900px 500px at 100% 110%, rgba(248, 200, 0, .12), transparent 60%),
        #f6f8fc;
    color: #1f2a44;
    font-family: "Inter", system-ui, sans-serif;
}

/* ---------- Painel da marca (lado esquerdo) ---------- */
.fgm-hero {
    display: none;
}

@media (min-width: 992px) {
    .fgm-hero {
        position: fixed;
        inset: 0 auto 0 0;
        width: 52vw;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 56px 64px;
        overflow: hidden;
        color: #fff;
        background:
            radial-gradient(800px 520px at 0% 0%, rgba(38, 72, 127, .9), transparent 70%),
            linear-gradient(155deg, var(--fgm-navy) 0%, var(--fgm-navy-900) 55%, var(--fgm-navy-950) 100%);
        z-index: 0;
    }

    /* Arcos decorativos inspirados no símbolo da FGM */
    /* Dois anéis no canto inferior direito, inspirados no símbolo da FGM */
    .fgm-hero::before,
    .fgm-hero::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        pointer-events: none;
    }
    .fgm-hero::before {
        width: 340px; height: 340px;
        right: -130px; bottom: -130px;
        border: 30px solid var(--fgm-yellow);
        border-left-color: transparent;
        transform: rotate(-35deg);
        opacity: .95;
    }
    .fgm-hero::after {
        width: 500px; height: 500px;
        right: -200px; bottom: -200px;
        border: 26px solid var(--fgm-green);
        border-right-color: transparent;
        border-bottom-color: transparent;
        transform: rotate(-10deg);
        opacity: .9;
    }
    .fgm-hero__grid {
        position: absolute;
        inset: 0;
        background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
        background-size: 22px 22px;
        mask-image: linear-gradient(120deg, #000 0%, transparent 65%);
        -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 65%);
        pointer-events: none;
    }

    .fgm-hero > * { position: relative; z-index: 1; }

    .fgm-hero__logo { width: 210px; height: auto; display: block; }

    .fgm-hero__content { max-width: 560px; }

    .fgm-hero__eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 14px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(255, 255, 255, .14);
        font-size: .8rem;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #dbe5f5;
        backdrop-filter: blur(6px);
    }
    .fgm-hero__eyebrow i { color: var(--fgm-yellow); }

    .fgm-hero__title {
        margin: 22px 0 14px;
        font-family: var(--fgm-font-display);
        font-weight: 800;
        font-size: clamp(2.1rem, 3.1vw, 3rem);
        line-height: 1.05;
        letter-spacing: -.01em;
        color: #fff;
    }
    .fgm-hero__title span { color: var(--fgm-yellow); }

    .fgm-hero__text {
        font-size: 1.05rem;
        line-height: 1.6;
        color: #c9d5ea;
        margin: 0 0 30px;
    }

    .fgm-hero__features {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 14px;
    }
    .fgm-hero__features li {
        display: flex;
        align-items: center;
        gap: 14px;
        font-size: .98rem;
        color: #e8eef8;
    }
    .fgm-hero__features i {
        flex: 0 0 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        font-size: 1.25rem;
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(255, 255, 255, .12);
        color: var(--fgm-green);
    }
    .fgm-hero__features li:nth-child(2) i { color: var(--fgm-yellow); }
    .fgm-hero__features li:nth-child(3) i { color: #9cc2ff; }

    .fgm-hero__footer {
        font-size: .82rem;
        color: #8fa3c6;
    }

    /* Área do formulário ocupa o lado direito */
    body.welcome-anonymous .page-anonymous {
        margin-left: 52vw;
        min-height: 100vh;
        display: flex;
        position: relative;
        z-index: 1;
    }
}

/* ---------- Área do formulário ---------- */
body.welcome-anonymous .page-anonymous > .flex-fill {
    padding: 32px 20px !important;
    margin: 0 !important;
    width: 100%;
}

body.welcome-anonymous .container-tight {
    max-width: 440px !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 auto;
    animation: fgm-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes fgm-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* Logo colorida acima do formulário */
body.welcome-anonymous .glpi-logo {
    --logo: url("/plugins/fgmtheme/img/logo-fgm.png") !important;
    content: var(--logo);
    display: block;
    width: 210px !important;
    height: auto !important;
    margin: 0 auto 28px !important;
}
@media (min-width: 992px) {
    /* No desktop a logo já aparece no painel da marca */
    body.welcome-anonymous .container-tight > .text-center:first-child { display: none; }
}

body.welcome-anonymous .main-content-card {
    border: 1px solid #e6ebf3;
    border-radius: 20px;
    box-shadow: var(--fgm-shadow);
    background: #fff;
    overflow: hidden;
    position: relative;
}
/* Faixa com as três cores da marca no topo do card */
body.welcome-anonymous .main-content-card::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, var(--fgm-navy) 0 40%, var(--fgm-yellow) 40% 70%, var(--fgm-green) 70% 100%);
}
body.welcome-anonymous .main-content-card > .card-header:empty { display: none; }
body.welcome-anonymous .main-content-card > .card-body { padding: 32px 34px 30px; }

body.welcome-anonymous .main-content-card .row { margin: 0; }
body.welcome-anonymous .main-content-card .col-md-5 { width: 100%; flex: 1 1 100%; max-width: 100%; padding: 0; }

body.welcome-anonymous .card-body .card-header {
    border: 0;
    padding: 0;
    margin-bottom: 26px !important;
    display: block;
    text-align: left;
    background: none;
}
body.welcome-anonymous .card-body .card-header h2 {
    margin: 0 !important;
    font-family: var(--fgm-font-display);
    font-weight: 700;
    font-size: 1.65rem;
    color: var(--fgm-navy);
    letter-spacing: -.01em;
}
.fgm-subtitle {
    margin: 6px 0 0;
    color: #6b7896;
    font-size: .95rem;
}

body.welcome-anonymous .form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #34405c;
    margin-bottom: 6px;
}

body.welcome-anonymous .form-control,
body.welcome-anonymous .form-select,
body.welcome-anonymous .select2-container--default .select2-selection--single {
    height: 48px;
    border-radius: 12px !important;
    border: 1.5px solid #dfe5ef;
    background-color: #f8fafd;
    font-size: .98rem;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
body.welcome-anonymous .form-control:hover { border-color: #c7d1e2; }
body.welcome-anonymous .form-control:focus {
    border-color: var(--fgm-navy);
    background-color: #fff;
    box-shadow: var(--fgm-ring);
}

/* Ícones dentro dos campos */
.fgm-field { position: relative; }
.fgm-field > .ti {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #8a97b3;
    pointer-events: none;
    transition: color .15s;
}
.fgm-field:focus-within > .ti { color: var(--fgm-navy); }
.fgm-field .form-control { padding-left: 44px; }
.fgm-field--password .form-control { padding-right: 48px; }
.fgm-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8a97b3;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.2rem;
}
.fgm-toggle:hover { background: var(--fgm-navy-50); color: var(--fgm-navy); }
.fgm-toggle:focus-visible { outline: none; box-shadow: var(--fgm-ring); }

.fgm-capslock {
    display: none;
    margin-top: 8px;
    font-size: .8rem;
    color: #a26a00;
}
.fgm-capslock.is-on { display: flex; align-items: center; gap: 6px; }

body.welcome-anonymous .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 6px;
    border-color: #c7d1e2;
}
body.welcome-anonymous .form-check-input:checked {
    background-color: var(--fgm-navy);
    border-color: var(--fgm-navy);
}
body.welcome-anonymous .form-check-label { color: #4b5873; font-size: .92rem; }

/* Botão principal */
body.welcome-anonymous .btn-primary {
    height: 50px;
    margin-top: 10px;
    border: 0;
    border-radius: 12px;
    font-family: var(--fgm-font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(135deg, var(--fgm-navy-700), var(--fgm-navy) 55%, var(--fgm-navy-900));
    box-shadow: 0 10px 20px -10px rgba(28, 54, 99, .7);
    transition: transform .15s, box-shadow .15s, filter .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
body.welcome-anonymous .btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 14px 24px -12px rgba(28, 54, 99, .8);
}
body.welcome-anonymous .btn-primary:active { transform: translateY(0); }
body.welcome-anonymous .btn-primary:focus-visible { box-shadow: var(--fgm-ring); }
body.welcome-anonymous .btn-primary .ti { transition: transform .15s; }
body.welcome-anonymous .btn-primary:hover .ti { transform: translateX(3px); }

body.welcome-anonymous .forgot_password { margin-top: 14px; }
body.welcome-anonymous .forgot_password a,
body.welcome-anonymous .card-body a:not(.btn) {
    color: var(--fgm-navy-700);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
}
body.welcome-anonymous .card-body a:not(.btn):hover { color: var(--fgm-green-700); text-decoration: underline; }

body.welcome-anonymous .btn-outline-secondary {
    border-radius: 10px;
    border-color: #dfe5ef;
    color: var(--fgm-navy);
}

/* Alertas (senha errada, etc.) */
body.welcome-anonymous .alert {
    border-radius: 12px;
    border: 0;
    box-shadow: var(--fgm-shadow-sm);
}

/* Rodapé discreto */
body.welcome-anonymous .container-tight > .text-center.text-muted {
    margin-top: 22px !important;
    font-size: .75rem;
    color: #97a2b8 !important;
}
body.welcome-anonymous .container-tight > .text-center.text-muted a.copyright { color: #97a2b8; text-decoration: none; }
body.welcome-anonymous .container-tight > .text-center.mt-3:last-child { display: none; }

.fgm-mobile-brand { display: none; }
@media (max-width: 991.98px) {
    body.welcome-anonymous {
        background:
            linear-gradient(180deg, var(--fgm-navy) 0, var(--fgm-navy-900) 220px, #f6f8fc 220px);
    }
    body.welcome-anonymous .glpi-logo {
        --logo: url("/plugins/fgmtheme/img/logo-fgm-white.png") !important;
        width: 190px !important;
    }
    .fgm-mobile-brand {
        display: block;
        text-align: center;
        color: #c9d5ea;
        font-size: .85rem;
        margin: -16px 0 22px;
    }
    body.welcome-anonymous .main-content-card > .card-body { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    body.welcome-anonymous .container-tight { animation: none; }
}

/* Crédito TrustIT no rodapé */
body.welcome-anonymous a.copyright { font-weight: 600; }
body.welcome-anonymous a.copyright:hover { color: var(--fgm-navy) !important; text-decoration: underline !important; }

/* Link para o portal público da Ouvidoria / e-SIC */
.fgm-ouvidoria-link {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 18px; padding-top: 16px; border-top: 1px solid #e6ebf3;
    font-size: .9rem; font-weight: 600; color: var(--fgm-green-700) !important; text-decoration: none;
}
.fgm-ouvidoria-link:hover { color: var(--fgm-navy) !important; }
