/* ==========================================================================
   Instituto Fernanda Schneider - Customização da Tela de Login
   ========================================================================== */

/* Reset e configurações base */
body.o_web_client {
    overflow: hidden;
}

/* Wrapper principal do login */
.ifs-login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* ==========================================================================
   Lado Esquerdo - Imagem de Fundo
   ========================================================================== */
.ifs-login-left {
    flex: 1;
    position: relative;
    background: url('/instituto_fernanda_schneider/static/src/img/banner.PNG');
    background-size: cover;
    background-position: left;
    background-repeat: no-repeat;
    justify-content: center;
}

.ifs-login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(158, 80, 80, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ifs-login-brand {
    text-align: center;
    color: #fff;
    max-width: 500px;
}

.ifs-login-logo {
    max-width: 200px;
    max-height: 150px;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.ifs-login-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.ifs-login-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Lado Direito - Formulário de Login
   ========================================================================== */
.ifs-login-right {
    width: 500px;
    min-width: 400px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.ifs-login-form-container {
    width: 100%;
    max-width: 380px;
}

/* Header do formulário */
.ifs-login-form-header {
    text-align: center;
    margin-bottom: 35px;
}

.ifs-form-logo {
    max-width: 150px;
    max-height: 80px;
    margin-bottom: 25px;
}

.ifs-form-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.ifs-form-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Body do formulário */
.ifs-login-form-body {
    margin-bottom: 25px;
}

.ifs-login-form-body .card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ifs-login-form-body .card-body {
    padding: 0 !important;
}

/* Estilos dos campos de input */
.ifs-login-form-body .mb-3,
.ifs-login-form-body .form-group {
    margin-bottom: 20px !important;
}

.ifs-login-form-body label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.ifs-login-form-body .form-control,
.ifs-login-form-body input.ifs-input {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.ifs-login-form-body .form-control:focus,
.ifs-login-form-body input.ifs-input:focus {
    border-color: #8d3f2d;
    box-shadow: 0 0 0 3px rgba(141, 63, 45, 0.15);
    background-color: #fff;
    outline: none;
}

.ifs-login-form-body .form-control::placeholder,
.ifs-login-form-body input.ifs-input::placeholder {
    color: #adb5bd;
}

/* Botão de login */
.ifs-login-form-body .btn-primary,
.ifs-login-form-body .ifs-btn-login {
    background: linear-gradient(135deg, #8d3f2d 0%, #6f3223 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px 24px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(141, 63, 45, 0.3) !important;
}

.ifs-login-form-body .btn-primary:hover,
.ifs-login-form-body .ifs-btn-login:hover {
    background: linear-gradient(135deg, #6f3223 0%, #5a281c 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(141, 63, 45, 0.4) !important;
}

.ifs-login-form-body .btn-primary:active,
.ifs-login-form-body .ifs-btn-login:active {
    transform: translateY(0);
}

/* Links do formulário */
.ifs-login-form-body a {
    color: #8d3f2d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ifs-login-form-body a:hover {
    color: #6f3223;
    text-decoration: underline;
}

/* Footer do formulário */
.ifs-login-form-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.ifs-db-manager {
    display: inline-block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 15px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ifs-db-manager:hover {
    color: #8d3f2d;
}

.ifs-powered-by {
    font-size: 0.8rem;
    color: #adb5bd;
}

/* Esconder botão de Entrar como Superusuário */
.ifs-login-form-body button[name="redirect"][value="/web/become"],
.ifs-login-form-body .btn-link,
.oe_login_buttons .btn-link {
    display: none !important;
}

/* ==========================================================================
   Seletor de Base de Dados
   ========================================================================== */
.ifs-login-form-body .o_database_list,
.ifs-login-form-body select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.ifs-login-form-body select:focus {
    border-color: #8d3f2d;
    box-shadow: 0 0 0 3px rgba(141, 63, 45, 0.15);
    background-color: #fff;
    outline: none;
}

/* ==========================================================================
   Mensagens de Erro e Alerta
   ========================================================================== */
.ifs-login-form-body .alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.ifs-login-form-body .alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
}

.ifs-login-form-body .alert-success {
    background-color: #f0fdf4;
    color: #166534;
}

/* ==========================================================================
   Responsividade
   ========================================================================== */
@media (max-width: 991px) {
    .ifs-login-wrapper {
        flex-direction: column;
    }
    
    .ifs-login-left {
        min-height: 200px;
        flex: none;
    }
    
    .ifs-login-title {
        font-size: 1.8rem;
    }
    
    .ifs-login-subtitle {
        font-size: 1rem;
    }
    
    .ifs-login-right {
        width: 100%;
        min-width: auto;
        flex: 1;
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .ifs-login-left {
        min-height: 150px;
    }
    
    .ifs-login-logo {
        max-width: 120px;
        margin-bottom: 15px;
    }
    
    .ifs-login-title {
        font-size: 1.5rem;
    }
    
    .ifs-login-subtitle {
        font-size: 0.9rem;
    }
    
    .ifs-login-overlay {
        padding: 20px;
    }
    
    .ifs-form-title {
        font-size: 1.5rem;
    }
    
    .ifs-login-form-container {
        max-width: 100%;
    }
}

/* ==========================================================================
   Esconder elementos padrão do Odoo
   ========================================================================== */
.ifs-login-wrapper ~ .container,
.ifs-login-wrapper + .container {
    display: none !important;
}

/* Ajustar o card padrão do Odoo dentro do wrapper */
.ifs-login-form-body .o_database_list {
    border: none !important;
    box-shadow: none !important;
}

/* Esconder footer padrão do Odoo se existir */
.ifs-login-form-body .text-center.small {
    display: none;
}

/* Checkbox "Lembrar-me" */
.ifs-login-form-body .form-check {
    margin-top: 15px;
}

.ifs-login-form-body .form-check-input:checked {
    background-color: #8d3f2d;
    border-color: #8d3f2d;
}

.ifs-login-form-body .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(141, 63, 45, 0.15);
}

/* ==========================================================================
   Ajustes específicos para Odoo 17
   ========================================================================== */

/* Esconder container padrão quando usando layout customizado */
.ifs-login-wrapper ~ .container.d-none,
.d-none.container {
    display: none !important;
}

/* Esconder seletor de base de dados */
.ifs-login-form-body .o_database_bloc,
.ifs-login-form-body .mb-3:has(input[name="db"]),
.ifs-login-form-body > form > .mb-3:first-child:has(.input-group) {
    display: none !important;
}

/* Esconder link de gerenciar banco de dados */
.ifs-db-manager,
a[href="/web/database/manager"] {
    display: none !important;
}

.ifs-login-form-body .form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    width: 100%;
}

.ifs-login-form-body .o_database_bloc select:focus,
.ifs-login-form-body .form-select:focus {
    border-color: #8d3f2d;
    box-shadow: 0 0 0 3px rgba(141, 63, 45, 0.15);
    background-color: #fff;
    outline: none;
}

/* Botão de selecionar base de dados */
.ifs-login-form-body .btn-secondary,
.ifs-login-form-body .o_database_bloc .btn {
    background-color: #8d3f2d !important;
    border-color: #8d3f2d !important;
    color: #fff !important;
    border-radius: 10px !important;
}

.ifs-login-form-body .btn-secondary:hover,
.ifs-login-form-body .o_database_bloc .btn:hover {
    background-color: #6f3223 !important;
    border-color: #6f3223 !important;
}

/* Links de esqueci senha e reset */
.ifs-login-form-body .o_login_auth,
.ifs-login-form-body .text-center a,
.ifs-login-form-body .mb-3 a,
.ifs-login-form-body a.btn-link {
    color: #8d3f2d !important;
}

.ifs-login-form-body .o_login_auth:hover,
.ifs-login-form-body .text-center a:hover,
.ifs-login-form-body .mb-3 a:hover {
    color: #6f3223 !important;
}

/* Esconder cabeçalho e rodapé padrão do Odoo */
.ifs-login-wrapper ~ header,
.ifs-login-wrapper ~ footer {
    display: none !important;
}

/* Garantir que o wrapper ocupe toda a tela */
#wrapwrap:has(.ifs-login-wrapper) {
    height: 100vh;
    overflow: hidden;
}

#wrapwrap:has(.ifs-login-wrapper) > header,
#wrapwrap:has(.ifs-login-wrapper) > footer {
    display: none !important;
}

/* Animação suave no logo */
.ifs-login-logo {
    animation: fadeInUp 0.8s ease-out;
}

.ifs-login-title {
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.ifs-login-subtitle {
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.ifs-login-form-container {
    animation: fadeIn 0.8s ease-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
