@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: url('https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    src: url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Previne scroll horizontal */
}

.login-container {
    width: 35%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-container {
    width: 65%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    box-shadow: -9px 0 8px -5px rgba(0, 0, 0, 0.5);
}

form {
    width: 100%;

    background-color: transparent;
    box-shadow: none; 
    backdrop-filter: none;
    -webkit-backdrop-filter: none; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    margin: 0 auto;
}

.inputBox {
    position: relative;
    margin-bottom: 6px;
    padding: 7px;
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilização para os ícones do Bootstrap */
.inputBox .bi {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #767676;
    font-size: 18px;
    z-index: 1;
    transition: color 0.2s ease;
}

/* Quando o input dentro do inputBox está em foco, altera a cor do ícone */
.inputBox:focus-within .bi {
    color: #069af5;
}

/* Mantém a cor azul quando o input está preenchido (válido) */
.inputBox input:valid ~ .bi {
    color: #069af5;
}

.inputBox input[type="email"],
.inputBox input[type="password"] {
    border: 1px solid #767676;
    border-radius: 5px;
    width: 100%;
    text-align: left;
}

.inputBox input {
    font-family: inherit;
    color: #000;
    border: 1px solid #767676;
    font-size: 14px;
    width: 100%;
    padding: 12px;
    padding-left: 40px; /* Aumentado para dar mais espaço ao ícone em telas touch */
    background-color: transparent;
    border-radius: 5px;
    transition: border-color 0.2s;
}

.inputBox input:focus {
    border: 1px solid #069af5;
    outline: none;
    box-shadow: none;
}

input:-ms-input-placeholder {
    background-color: transparent !important;
}

input:-ms-fill {
    background-color: transparent !important;
}

.inputBox span {
    position: absolute;
    padding: 0 12px;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #767676;
    transition: 0.2s;
    pointer-events: none;
}

.inputBox input:valid + span,
.inputBox input:focus + span {
    color: #069af5;
    transform: translateX(0) translateY(-170%);
    font-size: 0.875em;
    padding: 0 6px;
    background-color: #f4f4f4;
}

/* Quando o campo está preenchido por script/autofill, mantemos o label acima */
.inputBox.filled span {
    color: #069af5;
    transform: translateX(0) translateY(-170%);
    font-size: 0.875em;
    padding: 0 6px;
    background-color: #f4f4f4;
}

/* Ícone azul quando o campo está preenchido */
.inputBox.filled .bi {
    color: #069af5;
}

/* Suporte específico ao autofill (Chrome/Edge/WebKit) */
.inputBox input:-webkit-autofill + span {
    color: #069af5;
    transform: translateX(0) translateY(-170%);
    font-size: 0.875em;
    padding: 0 6px;
    background-color: #f4f4f4;
}

/* Evitar fundo amarelo forte do autofill e manter contraste do texto */
.inputBox input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    -webkit-text-fill-color: #000;
    transition: background-color 9999s ease-out;
}

/* Estilo para o botão "Entrar" */
.botão {
    position: relative;
    font-size: 15px;
    width: 45%;
    min-height: 50px;
    padding: 15px 20px;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #0477be;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: #069af5;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 0 0 transparent;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-transition: all 0.2s ease-in;
    -moz-transition: all 0.2s ease-in;
    transition: all 0.2s ease-in;
}

/* Efeito de brilho */
.botão::before {
    content: '';
    display: block;
    width: 0px;
    height: 86%;
    position: absolute;
    top: 7%;
    left: 0%;
    opacity: 0;
    background: #fff;
    box-shadow: 0 0 50px 30px #fff;
    -webkit-transform: skewX(-20deg);
    -moz-transform: skewX(-20deg);
    -ms-transform: skewX(-20deg);
    -o-transform: skewX(-20deg);
    transform: skewX(-20deg);
    z-index: 1;
}

/* Estilo para o botão "Entrar" quando passar o mouse por cima */
.botão:hover:not(.processing):not(.success):not(.error) {
    background: #069af5;
    color: #fff;
    box-shadow: 0 0 15px 10px rgba(6, 154, 245, 0.4);
    -webkit-transition: all 0.2s ease-out;
    -moz-transition: all 0.2s ease-out;
    transition: all 0.2s ease-out;
}

.botão:hover:not(.processing):not(.success):not(.error)::before {
    -webkit-animation: sh02 0.5s 0s linear;
    -moz-animation: sh02 0.5s 0s linear;
    animation: sh02 0.5s 0s linear;
}

@keyframes sh02 {
    from {
        opacity: 0;
        left: 0%;
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 0;
        left: 100%;
    }
}

.botão:active:not(.processing):not(.success):not(.error) {
    box-shadow: 0 0 0 0 transparent;
    -webkit-transition: box-shadow 0.2s ease-in;
    -moz-transition: box-shadow 0.2s ease-in;
    transition: box-shadow 0.2s ease-in;
}

/* Processando */
.botão.processing {
    background: #51afea;
    color: #fff;
    border-color: #51afea;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(81, 175, 234, 0.5);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 7px;
    z-index: 1;
    transition: width 0.3s ease;
}

@keyframes fillProgress {
    from { width: 0%; }
    to { width: 100%; }
}

/* Texto e SVG */
.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.btn-text {
    transition: opacity 0.3s ease;
    font-weight: 600;
    letter-spacing: 2px;
    color: inherit;
}

.botão.processing .btn-text {
    opacity: 1;
    color: #fff;
}

.botão.success .btn-text,
.botão.error .btn-text {
    opacity: 0;
}

.svg-icon {
    position: absolute;
    width: 32px;
    height: 32px;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s ease, transform 0.3s ease;
    z-index: 3;
}

.botão.success .svg-icon.check,
.botão.error .svg-icon.cross {
    opacity: 1;
    transform: scale(1);
}

/* Sucesso: círculo verde */
.botão.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: #fff;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    animation: successPulse 0.6s ease;
}

/* Erro: círculo vermelho */
.botão.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: #fff;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    animation: errorShake 0.5s ease;
}

/* Animações */
@keyframes successPulse {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* SVG: Vezinho (Check) */
.check-path {
    stroke: white;
    stroke-width: 5;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
}

.botão.success .check-path {
    animation: drawCheck 0.6s ease forwards 0.2s;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

/* SVG: X */
.cross-path1, .cross-path2 {
    stroke: white;
    stroke-width: 5;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
}

.botão.error .cross-path1 {
    animation: drawCross1 0.4s ease forwards 0.2s;
}

.botão.error .cross-path2 {
    animation: drawCross2 0.4s ease forwards 0.3s;
}

@keyframes drawCross1 {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCross2 {
    to { stroke-dashoffset: 0; }
}

/* Estilo para o link "Esqueceu a Senha?" */
.esqueceu-senha {
    margin-top: 25px; /* Aumentado para facilitar o toque */
    text-align: center;
    color: #000;
    width: 100%;
}

.esqueceu-senha a {
    color: #000;
    text-decoration: none;
    padding: 10px; /* Aumenta a área de toque */
    display: inline-block;
    font-size: 16px; /* Tamanho de fonte adequado para mobile */
}

/* Estilo para o link "Esqueceu a Senha?" quando passar o mouse por cima */
.esqueceu-senha a:hover, .esqueceu-senha a:active {
    color: #069af5;
}

h1 {
    color: #000;
    text-align: center;
    margin-top: -10px; /* Reduzido para melhor ajuste */
    font-size: 24px; /* Fonte apropriada para mobile */
}

input {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    padding: auto;
    align-items: center;
}

.footer-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    color: rgb(0, 0, 0);
    font-size: 13px;
    background-color: transparent;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    padding: 20px;
    align-items: center;
    border-radius: 15px;
}

#Nisseyconecta1 {
    display: block;
    margin: -20px auto 60px auto; /* Margem inferior reduzida */
    width: 80%;
    max-width: 350px; /* Reduzido para melhor ajuste em telas pequenas */
    height: auto;
    mix-blend-mode: multiply;
    padding: 0;
    border-radius: 8px;
}

.footer-text {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #000;
    font-size: 12px;
    padding: 15px 0; /* Aumentado para facilitar o toque */
}

.footer-text:hover {
    color: #069af5;
}

/* ========================================
   SISTEMA DE POPUPS - NOTIFICAÇÕES LATERAIS
   Código centralizado para todos os tipos de popup
   ======================================== */

/* Base do popup - slide lateral esquerdo */
.erro-popup {
    position: fixed;
    left: -350px;
    top: 20px;
    min-width: 320px;
    max-width: 350px;
    background: #fee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s ease,
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-20px);
    will-change: left, opacity, transform;
}

/* Cores de fundo para cada tipo */
.erro-popup.success {
    background: #d4f4dd;
}

.erro-popup.info {
    background: #dbeafe;
}

.erro-popup.warning {
    background: #fef3c7;
}

/* Estado visível - desliza para dentro */
.erro-popup.mostrar {
    left: 20px;
    opacity: 1;
    transform: translateX(0);
}

/* Barra colorida lateral baseada no tipo */
.erro-popup::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #dc2626;
}

.erro-popup.success::before {
    background: #059669;
}

.erro-popup.info::before {
    background: #2563eb;
}

.erro-popup.warning::before {
    background: #d97706;
}

/* Conteúdo do popup */
.erro-popup-conteudo {
    display: flex;
    align-items: flex-start;
    padding: 16px 16px 16px 20px;
    gap: 12px;
}

/* Ícone do popup */
.erro-icone {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.erro-icone i {
    font-size: 24px;
    color: #991b1b;
}

.erro-popup.success .erro-icone i {
    color: #065f46;
}

.erro-popup.info .erro-icone i {
    color: #1e40af;
}

.erro-popup.warning .erro-icone i {
    color: #92400e;
}

/* Área de texto */
.erro-popup-texto {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.erro-popup-titulo {
    font-size: 15px;
    font-weight: 600;
    color: #991b1b;
    margin: 0;
    line-height: 1.3;
}

.erro-popup.success .erro-popup-titulo {
    color: #065f46;
}

.erro-popup.info .erro-popup-titulo {
    color: #1e40af;
}

.erro-popup.warning .erro-popup-titulo {
    color: #92400e;
}

.erro-mensagem {
    font-size: 14px;
    color: #7f1d1d;
    line-height: 1.5;
    margin: 0;
}

.erro-popup.success .erro-mensagem {
    color: #064e3b;
}

.erro-popup.info .erro-mensagem {
    color: #1e3a8a;
}

.erro-popup.warning .erro-mensagem {
    color: #78350f;
}

/* Botão de fechar */
.erro-popup-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: rgba(127, 29, 29, 0.5);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.erro-popup-close:hover {
    color: #991b1b;
}

.erro-popup.success .erro-popup-close {
    color: rgba(6, 78, 59, 0.5);
}

.erro-popup.success .erro-popup-close:hover {
    color: #065f46;
}

.erro-popup.info .erro-popup-close {
    color: rgba(30, 58, 138, 0.5);
}

.erro-popup.info .erro-popup-close:hover {
    color: #1e40af;
}

.erro-popup.warning .erro-popup-close {
    color: rgba(120, 53, 15, 0.5);
}

.erro-popup.warning .erro-popup-close:hover {
    color: #92400e;
}

/* Barra de progresso (tempo restante) */
.erro-popup-progress {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.erro-popup-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: currentColor;
    animation: progressBar 3s linear forwards;
}

.erro-popup.error .erro-popup-progress::after {
    animation-duration: 5s;
}

/* Animação da barra de progresso */
@keyframes progressBar {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Responsivo para dispositivos móveis */
@media (max-width: 768px) {
    .erro-popup {
        left: -100%;
        top: 10px;
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        transform: translateX(-20px);
    }
    
    .erro-popup.mostrar {
        left: 10px;
        transform: translateX(0);
    }
    
    .erro-popup-conteudo {
        padding: 14px;
    }
    
    .erro-popup-titulo {
        font-size: 14px;
    }
    
    .erro-mensagem {
        font-size: 13px;
    }
    
    .erro-icone {
        width: 20px;
        height: 20px;
    }
    
    .erro-icone i {
        font-size: 20px;
    }
}

/* Estilos para autenticação 2FA */
.trust-device-box {
    margin: 15px 0;
    padding: 10px;
}

.trust-device-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.trust-device-label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    cursor: pointer;
}

.trust-device-label:hover {
    color: #007bff;
}

.voltar-login {
    margin: 15px 0;
    text-align: center;
}

.voltar-login a {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.voltar-login a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Estilos para autenticação 2FA */
.alteracao-senha-container,
.nova-senha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.alteracao-senha-container .inputBox,
.nova-senha-container .inputBox {
    width: 70%;
    margin-bottom: 15px;
}

/* Garantir que os labels funcionem corretamente nos campos de senha */
.inputBox.nova-senha-box input:valid + span,
.inputBox.nova-senha-box input:focus + span,
.inputBox.confirmar-senha-box input:valid + span,
.inputBox.confirmar-senha-box input:focus + span,
.inputBox.senha-atual-box input:valid + span,
.inputBox.senha-atual-box input:focus + span {
    color: #069af5;
    transform: translateX(0) translateY(-170%);
    font-size: 0.875em;
    padding: 0 6px;
    background-color: #f4f4f4;
    z-index: 5;
}

/* Estilos para indicador de força da senha integrado */
.password-strength-indicator {
    width: 70%;
    margin: 15px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.strength-requirements {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.strength-requirements small {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 8px;
}

.strength-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.strength-requirements li {
    margin: 4px 0;
    padding: 2px 0;
    transition: color 0.3s ease;
    font-size: 12px;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .alteracao-senha-container .inputBox,
    .nova-senha-container .inputBox {
        width: 90%;
    }
    
    .password-strength-indicator {
        width: 90%;
        margin: 10px auto;
        padding: 10px;
    }
    
    .strength-requirements {
        font-size: 12px;
    }
    
    .strength-requirements li {
        font-size: 11px;
    }
}

/* Tablets e smartphones na horizontal */
@media (max-width: 1024px) {
    .login-container {
        width: 50%;
    }
    
    .image-container {
        width: 50%;
    }
    
    .inputBox {
        width: 80%;
    }
    

    .botão {
        width: 53%;
    }
}

/* Tablets na vertical e smartphones grandes */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .login-container {
        width: 100%;
        height: 100vh;
        order: 2;
        justify-content: center;
        padding-top: 0;
    }
    
    .image-container {
        display: none; /* Oculta completamente a imagem em dispositivos móveis */
    }
    
    form {
        padding: 0px;
        height: 100%;
    }
    
    .inputBox {
        width: 85%;
        margin-bottom: 12px;
    }
    
    #Nisseyconecta1 {
        margin-top: 10px;
        margin-bottom: 30px;
    }
    
    h1 {
        margin-top: 0;
        margin-bottom: 20px;
    }
}

/* Smartphones médios */
@media (max-width: 576px) {
    .login-container {
        height: 75vh;
    }
    
    .image-container {
        height: 25vh;
    }
    
    .inputBox {
        width: 90%;
    }
    
    .botão {
        width: 75%;
        font-size: 14px;
        padding: 12px 15px;
        letter-spacing: 1.5px;
    }
    
    #Nisseyconecta1 {
        width: 90%;
        max-width: 250px;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .inputBox input {
        padding: 10px;
        padding-left: 35px;
    }
}

/* Smartphones pequenos */
@media (max-width: 375px) {
    .login-container {
        height: 80vh;
    }
    
    .image-container {
        height: 20vh;
    }
    
    .inputBox {
        width: 95%;
        padding: 5px;
    }
    
    .botão {
        width: 80%;
        font-size: 13px;
        padding: 10px 12px;
        letter-spacing: 1px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .erro-popup {
        max-width: 90%;
    }
    
    .footer-text {
        font-size: 10px;
        padding: 10px 0;
    }
    
    .esqueceu-senha a {
        font-size: 14px;
    }
}

/* Para altura de tela muito pequena (dispositivos na horizontal) */
@media (max-height: 500px) {
    .login-container {
        height: 100vh;
    }
    
    .image-container {
        display: none; /* Garantir que a imagem fique oculta em telas baixas */
    }
    
    #Nisseyconecta1 {
        max-width: 200px;
        margin-bottom: 10px;
    }
    
    h1 {
        margin: 0 0 10px 0;
    }
    
    .inputBox {
        margin-bottom: 5px;
    }
    
    .botão {
        margin-top: 10px;
    }
}

/* Ajustes para dispositivos com notch */
@supports (padding: max(0px)) {
    body, .login-container, .image-container {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}


/* Versão do sistema (fonte: version.py) */
.footer-text .app-version {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    opacity: .6;
}
