/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* BODY */
body {
    background-color: #27408B;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    transition: background-color 0.3s ease;
    
    position: relative;
    z-index: 1;
}

/* LOGIN CONTAINER */
.login-container {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 32px 24px;
    text-align: center;
}

/* LOGO */
.logo-area {
    margin-bottom: 32px;
    padding: 15px 0;
}

.logo-placeholder {
    width: 300px;
    height: 80px;
    margin: 0 auto;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a4da4 0%, #1e6dc7 100%);
}

.logo-img {
    max-width: 100%;
    max-height: 80px;
}

/* INPUTS */
.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #FFA500;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: #1e6dc7;
    font-size: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e1f0fa;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #f9fdff;
    color: #022b49;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: #0a4da4;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(10, 77, 164, 0.1);
}

.input-group input::placeholder {
    color: #9bb7d4;
}

/* OPTIONS ROW - SEMPRE LADO A LADO */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* força itens na mesma linha */
    width: 100%;
    margin: 25px 0 20px;
    font-size: 0.9rem;
    gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; /* impede quebra de linha */
    color: #FFA500;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0a4da4;
    cursor: pointer;
}

.forgot-password {
    white-space: nowrap; /* impede quebra de linha */
    text-align: right;
    color: #FFA500;
    text-decoration: none;
    font-weight: 600;
}

.forgot-password:hover {
    color: #00FF00;
    text-decoration: underline;
}

/* BOTÕES */
.access-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0a4da4 0%, #1e6dc7 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.access-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(10, 77, 164, 0.4);
}

.biometric-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    display: none;
}

/* DIVISOR */
.or-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #999;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.or-divider span {
    padding: 0 10px;
    font-size: 0.8rem;
}

/* SELO SEGURANÇA */
.security-seal {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 8px;
    color: #FFA500;
    font-size: 0.8rem;
    border-top: 1px solid #cde4f5;
    padding-top: 20px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal h2 {
    color: #0a4da4;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #0a4da4 0%, #1e6dc7 100%);
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

/* BOTÃO PWA - ATUALIZADO */
.pwa-install-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(135deg, #0a4da4 0%, #1e6dc7 100%);
    border: none;
    border-radius: 40px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(10, 77, 164, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 9999;
}

.pwa-install-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(10, 77, 164, 0.5);
    background: linear-gradient(135deg, #0a4da4 0%, #2980b9 100%);
}

.pwa-install-button.hidden {
    display: none;
}

/* Ícone do botão */
.pwa-install-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
    animation: bounce 2s infinite ease-in-out;
}

/* Container do texto */
.pwa-install-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

/* Título principal */
.pwa-install-title {
    font-weight: 700;
    font-size: 16px;
    font-family: 'Segoe UI', 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Subtítulo */
.pwa-install-subtitle {
    font-size: 11px;
    opacity: 0.9;
    font-family: 'Segoe UI', 'Ubuntu', sans-serif;
    font-weight: 400;
    letter-spacing: 0.3px;
}


/* Estilo para informação de versão */
.site-version {
    text-align: center;
    font-size: 9px;
    color: #999;
    margin-top: 5px;
    padding: 5px;
    font-family: monospace;
}

.site-version span {
    display: inline-block;
    margin: 0 0px;
}

.site-version .version-number {
    color: #27408B;
    font-weight: bold;
}


/* Animação suave para a seta */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

/* TELA DE CARREGAMENTO */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2f4e, #27408B);
    display: flex !important; /* ALTERADO: adicionado !important para garantir visibilidade imediata */
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 1 !important; /* ALTERADO: adicionado !important */
    visibility: visible !important; /* ALTERADO: adicionado !important */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#site-content {
    position: relative;
    z-index: 2; 
    background: transparent;
    /* >>> LINHAS ADICIONADAS <<< */
    opacity: 0 !important; /* ALTERADO: adicionado !important */
    visibility: hidden !important; /* ALTERADO: adicionado !important */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* >>> BLOCO ADICIONADO <<< */
/* Quando o loading estiver oculto, mostra o conteúdo */
#loading-screen.hidden + #site-content {
    opacity: 1 !important; /* ALTERADO: adicionado !important */
    visibility: visible !important; /* ALTERADO: adicionado !important */
}

#loading-screen.hidden {
    opacity: 0 !important; /* ALTERADO: adicionado !important */
    visibility: hidden !important; /* ALTERADO: adicionado !important */
}

.loader-content {
    text-align: center;
    padding: 20px;
    animation: fadeInUp 1s ease;
}

.loader-logo {
    max-width: 180px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1); /* Se seu logo for escuro, isso deixa branco */
}

.loader-text {
    color: white;
    font-size: 16px;
    margin-top: 15px;
    letter-spacing: 1px;
    font-weight: 300;
}

/* Spinner animado */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px auto;
}

/* Animações */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Opcional: variações de loader */
.loader-pulse {
    width: 60px;
    height: 60px;
    background-color: white;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}
/* fim da tela de carregamento */

/* */


/* RESPONSIVO */
@media (max-width: 600px) {

/* RESPONSIVO */
@media (max-width: 600px) {

    body {
        padding: 2px;
        background: url('../imagens/banco.avif') no-repeat center center fixed,
                    url('../banco.avif') no-repeat center center fixed;
        background-size: cover;
    }
    
    /* GARANTIR LOADING CORRETO EM MOBILE - ADICIONADO */
    #loading-screen {
        background: linear-gradient(135deg, #1a2f4e, #27408B);
        z-index: 999999;
    }
    
    /* GARANTIR CONTEÚDO OCULTO - ADICIONADO */
    #site-content {
        background: transparent;
    }
    
    .login-container {
        /* HSLA (Matiz, Saturação, Luminosidade + Alpha) */
        /*
        Cor
        0° ou 360° = Vermelho
            30° = Laranja
            60° = Amarelo
            120° = Verde
            180° = Ciano
            240° = Azul
            270° = Roxo
            300° = Magenta
            360° = Vermelho novamente
        
        saturação
        0% = Cinza (sem cor)
        50% = Cor mais suave
        100% = Cor vibrante, pura        
        
        Luminosidade
        0% = Preto total
        50% = Cor "normal" (pura)
        100% = Branco total        
        
        Alpha
        0 = Totalmente transparente
        0.7 = 70% opaco (vê-se 70% da cor, 30% do fundo)
        1 = Totalmente opaco        
        */
        background-color: hsla(240, 100%, 0%, 0.6); /* Azul com 60% opaco */
        padding: 24px 16px;
        max-width: 100%;
    }

    .input-group input {
        padding: 14px 14px 14px 45px;
        font-size: 16px;
    }

    .input-icon {
        left: 12px;
        font-size: 1.1rem;
    }

    .access-button {
        font-size: 1.1rem;
        padding: 15px;
    }

    .biometric-button {
        font-size: 1rem;
        padding: 14px;
    }

    .options-row {
        flex-wrap: nowrap; /* garante lado a lado */
        font-size: 0.9rem;
        gap: 8px;
    }

    .remember-me,
    .forgot-password {
        white-space: nowrap;
        font-size: 0.9rem;
    }

    /* BOTÃO PWA - RESPONSIVO ATUALIZADO */
    .pwa-install-button {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        padding: 10px 20px;
        gap: 12px;
        min-width: 200px;
        justify-content: center;
    }
    
    .pwa-install-button:hover {
        transform: translateX(-50%) translateY(-3px);
    }
    
    .pwa-install-icon {
        font-size: 22px;
    }
    
    .pwa-install-title {
        font-size: 14px;
    }
    
    .pwa-install-subtitle {
        font-size: 10px;
    }
}

/* AUTOFILL */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #f0f8ff inset !important;
    -webkit-text-fill-color: #022b49 !important;
}

/* Para telas muito pequenas - NOVO */
@media (max-width: 360px) {
    .pwa-install-button {
        padding: 8px 16px;
        min-width: 180px;
    }
    
    .pwa-install-icon {
        font-size: 20px;
    }
    
    .pwa-install-title {
        font-size: 13px;
    }
}