* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #F0F0F0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin-bottom: 70px;
}

/* Logo Section */
.logo-section {
    margin-bottom: 30px;
}

.logo {
    display: inline-block;
    margin-bottom: 10px;
}

.logo-image {
    width: 300px;
    height: auto;
    max-width: 100%;
}

/* Portal Logo */
.portal-logo {
    margin-bottom: 30px;
    width: 100%;
    position: relative;
    left: 50%;
    transform: translateX(calc(-50% + 36px));
}

.portal-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
}

.login-form {
    background: #eaeaea;
    border: none;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    max-width: 250px;
    text-align: center;
}

.titulo {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
}

.div-espaco {
    margin-bottom: 12px;
    text-align: center;
}

.usuario, .label-senha {
    display: block;
    width: 100%;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    text-align: center;
    margin-bottom: 5px;
}

.campo {
    width: 100%;
    max-width: 200px;
    padding: 6px;
    border: none;
    font-size: 13px;
    background: white;
    font-family: Arial, sans-serif;
    border-radius: 4px;
    text-align: center;
}

.campo:focus {
    outline: none;
    border: none;
}

.campo::placeholder {
    color: #999;
}

/* Button Group */
.btn-login {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    list-style: none;
    padding: 0;
}

.btn-login li {
    margin: 0;
}

.btn-entrar, .btn-voltar {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    color: #666;
    border: none;
    background: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-bottom: 5px;
}

.btn-entrar:hover, .btn-voltar:hover {
    opacity: 0.8;
}

.btn-entrar:active, .btn-voltar:active {
    opacity: 0.6;
}

/* Botão Entrar */
.btn-entrar {
    background: url('image.png') no-repeat center;
    background-size: 40px;
}

/* Botão Voltar */
.btn-voltar {
    background: url('fonte 3.PNG') no-repeat center;
    background-size: 40px;
}

/* Texto dos botões */
.btn-text {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

/* Campo de token */
#infoToken {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

/* Segundo fieldset (token) */
#login {
    display: none;
}

/* Remover borda do fieldset */
fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

/* Responsividade */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .logo-image {
        width: 250px;
    }
    
    .portal-image {
        width: 500px;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .btn-login {
        gap: 15px;
    }
    
    .btn-entrar, .btn-voltar {
        width: 35px;
        height: 35px;
        background-size: 35px;
    }
    
    .btn-text {
        font-size: 12px;
    }
}

/* Estados de validação */
.form-group input:valid {
    border-color: #4CAF50;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #f44336;
}

/* Loading state */
.btn-entrar.loading {
    background: #ccc;
    cursor: not-allowed;
}

.btn-entrar.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensagens de erro */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #444;
    border-top: 2px solid #cc0000;
    z-index: 1000;
}

.footer-content {
    padding: 15px 20px;
    text-align: left;
}

.copyright {
    color: white;
    font-size: 12px;
    font-weight: 400;
}

/* Modal de carregamento - escondido até clicar em Entrar */
.modal-carregamento {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-carregamento.ativo {
    opacity: 1;
    visibility: visible;
}

.modal-carregamento.ativo .modal-carregamento-content {
    transform: scale(1);
    opacity: 1;
}

.modal-carregamento-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-carregamento-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    min-width: 300px;
    max-width: 90vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Spinner moderno (3 bolinhas) */
.modal-carregamento-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.modal-carregamento-spinner span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    animation: modal-bounce 1.4s ease-in-out infinite both;
}

.modal-carregamento-spinner span:nth-child(1) { animation-delay: 0s; }
.modal-carregamento-spinner span:nth-child(2) { animation-delay: 0.16s; }
.modal-carregamento-spinner span:nth-child(3) { animation-delay: 0.32s; }

@keyframes modal-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.modal-carregamento-msg {
    color: #334155;
    font-size: 15px;
    font-weight: 500;
    margin: 6px 0;
    letter-spacing: 0.01em;
}
