/* Font-Face */
@font-face {
    font-family: 'Roboto';
    src: url('/static/a_home/fonts/Roboto/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
}
@font-face {
    font-family: 'Roboto';
    src: url('/static/a_home/fonts/Roboto/Roboto-Bold.ttf') format('truetype');
    font-weight: 700;
}

/* Base Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f9fafc;
    color: #00203f;
    margin: 0;
    padding: 0;
}

/* Login Page Wrapper */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem 1rem;
}

/* Background Pattern */
.login-bg-pattern {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='pattern' width='40' height='40' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Crect width='100%25' height='100%25' fill='none'/%3E%3Ccircle cx='20' cy='20' r='1' fill='%2300203F' fill-opacity='0.05'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23pattern)'/%3E%3C/svg%3E");
    opacity: 0.8;
    z-index: -1;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 450px;
    z-index: 1;
}

/* Login Card */
.login-card {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 32, 63, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 32, 63, 0.15);
}

/* Logo Section */
.login-logo-section {
    padding: 2rem 0;
    text-align: center; /* This helps, but the rules below for .login-logo are more robust */
    background: linear-gradient(135deg, #00203f, #00305f);
}

.login-logo {
    height: 60px;
    width: auto;
    display: block; /* Adicionado para permitir margens automáticas */
    margin-left: auto; /* Adicionado para centralizar */
    margin-right: auto; /* Adicionado para centralizar */
}

/* Login Content */
.login-content {
    padding: 2.5rem 2rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #00203f;
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-subtitle {
    font-size: 1rem;
    color: #4A5568;
    margin-bottom: 2rem;
    text-align: center;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #00203f;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #a0aec0;
}
.form-input {
    width: 100%;
    height: 48px;
    padding: 0.75rem 3rem 0.75rem 3rem; /* padding-right 3rem para espaço do botão */
    font-size: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #00203f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    display: block; /* Garante que não seja flex */
    -webkit-appearance: none; /* Remove estilos padrão do navegador */
    appearance: none; /* Remove estilos padrão do navegador */
}

.form-input:focus {
    outline: none !important;
    border: 1px solid #00203f !important; /* Borda azul escura */
    box-shadow: none !important; /* Remove qualquer sombra */
    -webkit-box-shadow: none !important; /* Remove sombra no Safari/Chrome */
}
.form-input::placeholder {
    color: #a0aec0;
}
input.form-input:focus {
    outline: none !important;
    border: 1px solid #00203f !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}
.password-toggle-btn {
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: #a0aec0 !important;
    cursor: pointer !important;
    padding: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10; /* Aumentado para garantir que fique acima do input */
    width: auto !important;
    height: auto !important;
    outline: none !important;
}

.password-toggle-btn:hover {
    color: #00203f !important;
}

.password-toggle-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.password-toggle-btn i {
    font-size: 1rem !important; /* Adjust icon size as needed */
}

/* Password header with forgot password link */
.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: #00203f;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #004080;
    text-decoration: underline;
}

/* Checkbox Style */
.form-checkbox {
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 30px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #00203f;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #00203f;
    border-color: #00203f;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 0.875rem;
    color: #4A5568;
    margin-left: 0.25rem;
}

/* Button Styles */
.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(90deg, #00203f, #004080);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.btn-login:hover {
    background: linear-gradient(90deg, #002b54, #004d99);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 32, 63, 0.15);
}

.btn-login:active {
    transform: translateY(0);
}

/* Sign Up Link */
.signup-link-container {
    text-align: center;
    margin-top: 0.5rem;
}

.signup-link-container p {
    font-size: 0.875rem;
    color: #4A5568;
    margin: 0;
}

.signup-link {
    color: #00203f;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: #004080;
    text-decoration: underline;
}

/* Error Message */
.login-error {
    display: flex;
    align-items: center;
    background-color: #FEF2F2;
    border-left: 4px solid #EF4444;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.error-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #EF4444;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.login-error p {
    font-size: 0.875rem;
    color: #B91C1C;
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .login-content {
        padding: 2rem 1.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .form-input {
        /* Adjusted padding-right from 1rem to 3rem to match non-responsive style for icon space */
        padding: 0.7rem 3rem 0.7rem 2.75rem !important; 
    }
    
    .password-toggle-btn {
        right: 0.75rem !important; /* Ajustado para telas menores */
    }
    
    .input-icon {
        left: 0.75rem;
        width: 1.1rem;
        height: 1.1rem;
    }
    
    .login-logo {
        height: 50px;
    }
}

/* Animation for form elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.form-group:nth-child(1) {
    animation-delay: 0.2s;
}

.form-group:nth-child(2) {
    animation-delay: 0.4s;
}

.form-group:nth-child(3) {
    animation-delay: 0.6s;
}

.btn-login {
    animation: fadeInUp 0.5s 0.8s ease forwards;
    opacity: 0;
}

.signup-link-container {
    animation: fadeInUp 0.5s 1s ease forwards;
    opacity: 0;
}

/* Social Login Section */
.social-login-section {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s 0.9s ease forwards;
    opacity: 0;
}

.social-login-section .btn {
    height: 44px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border-color: #e2e8f0;
    color: #4A5568;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.social-login-section .btn:hover {
    background-color: #f8f9fa;
    border-color: #cbd5e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.social-login-section .fab {
    font-size: 1.1rem;
    color: #4285F4;
}

/* Bootstrap utility classes for proper positioning */
.ms-2 {
    margin-left: 0.5rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-center {
    justify-content: center !important;
}

/* Ensure focus styles for inputs, especially password, remove unwanted outlines/shadows and set the correct border */
input.form-input:focus, 
input[type="password"].form-input:focus,
input[type="email"].form-input:focus,
input[type="text"].form-input:focus {
    outline: none !important; /* Removes the default browser outline (often blue/purple) */
    border: 1px solid #00203f !important; /* Sets a specific dark blue border */
    box-shadow: none !important; /* Removes any focus shadow */
    -webkit-box-shadow: none !important; /* Remove sombra no Safari/Chrome */
    outline-offset: 0 !important; /* Remove offset do outline */
}

/* Remove qualquer estilo de foco padrão do navegador */
input.form-input:focus-visible {
    outline: none !important;
}

/* Garante que o container do input de senha esteja posicionado corretamente */
.form-group .input-with-icon {
    position: relative !important;
    width: 100% !important;
}

/* Adiciona estilos específicos para prevenir interferências externas */
input[type="password"].form-input::-webkit-outer-spin-button,
input[type="password"].form-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove qualquer possível highlight roxo do navegador */
input.form-input:-webkit-autofill,
input.form-input:-webkit-autofill:hover, 
input.form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    box-shadow: 0 0 0px 1000px white inset !important;
    border: 1px solid #e2e8f0 !important;
}

input.form-input:-webkit-autofill:focus {
    border: 1px solid #00203f !important;
}