/* CSS Moderno para Login Velip */
/* Reset e Base */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 20px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Container Principal */
#site {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

#topo {
    text-align: center;
    margin-bottom: 15px;
}

#topo img {
    max-width: 100%;
    height: auto;
}

/* Container do Login */
#pagina {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-internal-banner {
    width: 100%;
    line-height: 0;
}

.login-internal-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Ajusta o padding do form quando há banner interno */
.has-banner #pagina .login-internal-banner + .newaccount + p + form {
}

/* Conteúdo principal abaixo do banner */
.login-main-content {
    padding: 20px 30px;
    flex-grow: 1;
}

/* Remover padding superior do form se o banner estiver presente, pois o .login-main-content já tem */
#pagina > .login-internal-banner + .newaccount + p + form {
    padding-top: 0;
}

/* Título TWW */
.border_login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    width: 100% !important;
}

.titulo_tww {
    color: white !important;
    margin: 5px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Formulário */
form {
    padding: 0;
}

/* Campos de Input */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    margin: 6px 0;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #FA713A;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(250, 113, 58, 0.1);
}

/* Labels */
label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

/* Container dos campos */
.form-group {
    margin-bottom: 15px;
}

/* Botões */
.bt_login {
    background: linear-gradient(135deg, #FA713A 0%, #F94C07 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    width: 100%;
    margin: 15px 0;
    transition: all 0.3s ease;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(250, 113, 58, 0.3);
}

.bt_login:hover {
    background: linear-gradient(135deg, #FD976F 0%, #FA713A 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 113, 58, 0.4);
}

.bt_login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(250, 113, 58, 0.3);
}

/* Botão Esqueci Senha */
#esqueci_senha {
    background: #f8f9fa;
    color: #6c757d;
    font-size: 13px;
    padding: 8px 18px;
    margin: 8px 0;
    border: 1px solid #dee2e6;
    box-shadow: none;
}

#esqueci_senha:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

/* Divisor */
.divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e8ed;
}

.divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    color: #6c757d;
    font-size: 14px;
}

/* Login Social */
.social-login {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#buttonDiv, .facebook-login-container {
    margin: 0;
    width: 100%;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Permitir que o botão do Google use suas proporções naturais */
#buttonDiv > div, #buttonDiv iframe {
    width: 100% !important;
    max-width: 100% !important;
}

/* Botão do Facebook */
.fb-login-button {
    display: flex !important;
    justify-content: center !important;
    margin: 0;
}

/* Mensagens de Erro/Sucesso */
.erro_msg {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    border: 1px solid #f5c6cb;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.success_msg {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    border: 1px solid #c3e6cb;
}

/* Link Nova Conta */
.newaccount,
.tww-header-box {
    margin-left: -30px;
    margin-right: -30px;
    width: calc(100% + 60px);
}

.newaccount {
    background: #f8f9fa;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    margin-top: -20px;
    margin-bottom: 20px;
}

.newaccount img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.tww-header-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px !important;
    margin-top: -20px !important;
    margin-bottom: 20px !important;
    border-radius: 0 !important;
}

.tww-header-box .titulo_tww {
    color: white !important;
    margin: 5px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.newaccount a {
    color: #FA713A;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.newaccount a:hover {
    color: #F94C07;
    text-decoration: underline;
}

/* Footer */
#footer {
    text-align: center;
    padding: 15px 30px;
    color: #6c757d;
    font-size: 12px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-left: -30px;
    margin-right: -30px;
    width: calc(100% + 60px);
}

/* Responsividade */
@media (max-width: 480px) {
    #site {
        margin: 0;
        width: 100%;
        min-height: 100vh;
    }
    
    #pagina {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
    
    .login-main-content {
        padding: 20px;
    }

    .newaccount, .tww-header-box {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    .newaccount {
        padding: 10px 20px;
        margin-top: -20px;
    }
    .tww-header-box {
        padding: 20px !important;
        margin-top: -20px !important;
    }
    #footer {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        padding: 15px 20px;
    }
}

/* Otimização para notebooks (altura entre 600px e 800px) */
@media (max-height: 800px) and (min-width: 768px) {
    body {
        padding: 10px 0;
    }
    
    #topo {
        margin-bottom: 10px;
    }
    
    #topo img {
        max-height: 60px;
    }
    
    .login-main-content {
        padding: 15px 25px;
    }
    .newaccount, .tww-header-box {
        margin-left: -25px;
        margin-right: -25px;
        width: calc(100% + 50px);
    }
    .newaccount {
        padding: 10px 25px;
        margin-top: -15px;
        margin-bottom: 15px;
    }
    .tww-header-box {
        padding: 15px 25px !important;
        margin-top: -15px !important;
        margin-bottom: 15px !important;
    }
    #footer {
        margin-left: -25px;
        margin-right: -25px;
        width: calc(100% + 50px);
        padding: 10px 25px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"] {
        padding: 8px 12px;
        margin: 4px 0;
        font-size: 14px;
    }
    
    .bt_login {
        padding: 10px 24px;
        margin: 12px 0;
        font-size: 14px;
    }
    
    .divider {
        margin: 12px 0;
    }
    
    .social-login {
        gap: 6px;
    }
        
    .tww-header-box .titulo_tww {
        font-size: 1.2em;
    }
    
    #esqueci_senha {
        padding: 6px 16px;
        margin: 6px 0;
        font-size: 12px;
    }
    .login-internal-banner img {
        max-height: 70px;
    }
}

/* Para telas muito pequenas em altura (< 600px) */
@media (max-height: 600px) and (min-width: 768px) {
    body {
        padding: 5px 0;
    }
    
    #topo {
        margin-bottom: 5px;
    }
    
    #topo img {
        max-height: 50px;
    }
        
    .login-main-content {
        padding: 10px 20px;
    }
    .newaccount, .tww-header-box {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    .newaccount {
        padding: 8px 20px;
        margin-top: -10px;
        margin-bottom: 10px;
    }
    .tww-header-box {
        padding: 10px 20px !important;
        margin-top: -10px !important;
        margin-bottom: 10px !important;
    }
    #footer {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        padding: 8px 20px;
    }

    .form-group {
        margin-bottom: 8px;
    }
    
    .bt_login {
        padding: 8px 20px;
        margin: 8px 0;
    }
    
    #buttonDiv,
    .facebook-login-container,
    .social-login > * {
        min-height: 36px;
    }
    
    .login-internal-banner img {
        max-height: 60px;
    }
}

/* Animação de Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Código de Validação */
#cod_valida {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
}

/* Melhorias para acessibilidade */
input:focus-visible,
button:focus-visible {
    outline: 3px solid #FA713A;
    outline-offset: 2px;
}

/* Transições suaves */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Garantir que os botões de login social tenham altura mínima consistente */
.social-login > * {
    min-height: 40px;
}

/* Ajuste específico para o iframe do Google */
.nsm7Bb-HzV7m-LgbsSe {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
}

/* Forçar largura total no container do Google - apenas no primeiro nível */
#buttonDiv > div:first-child {
    width: 100% !important;
    max-width: 100% !important;
}

/* Garantir que o container pai também use largura total */
#buttonDiv {
    width: 100% !important;
    display: block !important;
}

/* Não interferir com elementos internos do Google para manter funcionalidade */
#buttonDiv iframe {
    min-width: 100%;
}

/* Garantir alinhamento consistente */
.social-login button,
.social-login > div {
    margin: 0;
    width: 100%;
}

/* Wrapper para o botão do Google */
.google-button-wrapper {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.google-button-wrapper #buttonDiv {
    width: 100%;
}

/* Remover ajustes de body.has-internal-banner que eram para banner EXTERNO */
body.has-internal-banner {
}

/* #topo não contém mais o banner do cliente, então os ajustes de margin/height não são mais relevantes aqui para o banner do cliente */
body.has-internal-banner #topo {
    margin-bottom: 15px;
}
body.has-internal-banner #topo img {
}

@media (max-height: 800px) {
    body.has-internal-banner {
    }
    
    body.has-internal-banner #topo img {
    }

    /* Ajustar max-height do banner interno se necessário para telas menores */
    .login-internal-banner {
    }
} 