:root {
    --siaz-azul: #3157a3;
    --siaz-azul-escuro: #1f4e95;
    --siaz-laranja: #ff6600;
    --siaz-texto: #172033;
    --siaz-texto-suave: #68758a;
    --siaz-borda: #d8e1ef;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--siaz-texto);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    background:
        linear-gradient(rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.93)),
        linear-gradient(to right, rgba(49, 87, 163, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(49, 87, 163, 0.045) 1px, transparent 1px);
    background-size: auto, 72px 72px, 72px 72px;
}

.login-page {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 42px 18px 78px;
    overflow: hidden;
    isolation: isolate;
}

/* Fundo decorativo azul */
.login-hero {
    position: absolute;
    z-index: -2;
    top: 0;
    right: 0;
    left: 0;
    height: 43%;
    min-height: 270px;

    background-image:
        linear-gradient(
            rgba(31, 78, 149, 0.44),
            rgba(49, 87, 163, 0.50)
        ),
        url("../img/s/fundologin.png");

    background-repeat: no-repeat, no-repeat;

    /*
    | A primeira posição é do degradê.
    | A segunda baixa somente a imagem de fundo,
    | evitando cortar as cabeças em monitores grandes.
    */
    background-position:
        center center,
        center 18%;

    background-size:
        auto,
        cover;
}

.login-hero::after {
    position: absolute;
    right: -8%;
    bottom: -70px;
    left: -8%;
    height: 145px;
    content: "";
    background: #ffffff;
    border-top-left-radius: 50% 100%;
    border-top-right-radius: 50% 100%;
}

/* Card central */
.login-area {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    margin: auto;
}

.login-card {
    width: 100%;
    padding: 34px 32px 31px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(49, 87, 163, 0.12);
    border-radius: 23px;
    box-shadow: 0 18px 42px rgba(31, 78, 149, 0.15);
}

.login-card-topo {
    margin-bottom: 26px;
    text-align: center;
}

.login-card-logo {
    display: block;
    width: 145px;
    max-width: 78%;
    height: auto;
    margin: 0 auto 14px;
    object-fit: contain;
}

.login-card-topo h1 {
    margin: 0 0 8px;
    color: var(--siaz-azul-escuro);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.login-card-topo p {
    margin: 0;
    color: var(--siaz-texto-suave);
    font-size: 0.94rem;
    line-height: 1.5;
}

/* Formulário */
.login-card .form-label {
    margin-bottom: 8px;
    color: var(--siaz-texto);
    font-size: 0.95rem;
    font-weight: 700;
}

.login-card .form-control {
    height: 52px;
    padding: 11px 15px;
    color: var(--siaz-texto);
    font-size: 0.96rem;
    border: 1px solid var(--siaz-borda);
    border-radius: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card .form-control::placeholder {
    color: #9aa7b8;
}

.login-card .form-control:focus {
    border-color: var(--siaz-azul);
    box-shadow: 0 0 0 0.2rem rgba(49, 87, 163, 0.14);
}

.login-links {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 22px;
}

.login-links a {
    color: var(--siaz-azul);
    font-size: 0.91rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-links a:hover {
    color: var(--siaz-laranja);
}

.btn-login-siaz {
    width: 100%;
    height: 52px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    border: 0;
    border-radius: 13px;
    background: var(--siaz-azul);
    box-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-login-siaz:hover,
.btn-login-siaz:focus {
    color: #ffffff;
    background: var(--siaz-laranja);
    box-shadow: none;
}

.btn-login-siaz:focus-visible {
    outline: 3px solid rgba(255, 102, 0, 0.22);
    outline-offset: 2px;
}

.login-alerta-erro {
    padding: 12px 14px;
    margin: -6px 0 19px;
    color: #b42318;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    background: #fff5f5;
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 12px;
}

/* ZiX permanece preparado, mas está comentado no PHP */
.login-zix-area {
    position: absolute;
    right: -150px;
    bottom: -10px;
    width: 205px;
    pointer-events: none;
}

.login-zix {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 18px rgba(31, 78, 149, 0.2));
}

/* Rodapé */
.login-rodape {
    position: absolute;
    right: 16px;
    bottom: 23px;
    left: 16px;
    color: #7b8794;
    font-size: 0.88rem;
    text-align: center;
}

.login-rodape strong {
    color: var(--siaz-azul);
}

/* Modal de bloqueio */
.login-modal-bloqueado {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
}

.login-modal-bloqueado .modal-header {
    color: #ffffff;
    text-align: center;
    background: linear-gradient(90deg, #c62828, #e53935);
    border: 0;
}

.login-modal-bloqueado .modal-body {
    padding: 31px 28px 18px;
    text-align: center;
}

.login-modal-bloqueado .modal-footer {
    justify-content: center;
    padding: 9px 20px 28px;
    border: 0;
}

.login-modal-icone {
    margin-bottom: 15px;
    color: #ff477d;
    font-size: 3.1rem;
    line-height: 1;
}

/* Tablet */
@media (max-width: 991px) {
    .login-page {
        padding-top: 36px;
        padding-bottom: 72px;
    }

    .login-hero {
        height: 39%;
        min-height: 245px;
    }

    .login-area {
        max-width: 420px;
    }

    .login-card {
        padding: 32px 29px 29px;
    }
}

/* Celular */
@media (max-width: 576px) {
    .login-page {
        justify-content: flex-start;
        padding: 78px 14px 72px;
    }

    .login-hero {
        height: 34%;
        min-height: 220px;
    }

    .login-hero::after {
        bottom: -58px;
        height: 120px;
    }

    .login-area {
        max-width: 100%;
        margin-top: 38px;
    }

    .login-card {
        padding: 28px 20px 25px;
        border-radius: 19px;
    }

    .login-card-logo {
        width: 130px;
        margin-bottom: 12px;
    }

    .login-card-topo {
        margin-bottom: 23px;
    }

    .login-card-topo h1 {
        font-size: 1.48rem;
    }

    .login-card-topo p {
        font-size: 0.89rem;
    }

    .login-card .form-control {
        height: 50px;
        font-size: 0.94rem;
    }

    .btn-login-siaz {
        height: 50px;
    }

    .login-rodape {
        bottom: 17px;
        font-size: 0.82rem;
    }
}

/* Telas muito baixas */
@media (max-height: 680px) and (min-width: 577px) {
    .login-page {
        justify-content: flex-start;
        padding-top: 42px;
    }

    .login-hero {
        height: 33%;
        min-height: 210px;
    }

    .login-area {
        margin-top: 54px;
    }

    .login-card {
        padding-top: 27px;
        padding-bottom: 25px;
    }

    .login-card-logo {
        width: 125px;
        margin-bottom: 9px;
    }

    .login-card-topo {
        margin-bottom: 18px;
    }
}