/* Estilos para as páginas de autenticação - Melhorias */

.auth-container {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 900px; /* Alterado de max-width para width fixa */
    margin: 0 auto;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Banner lateral do formulário */
.auth-banner {
    background: linear-gradient(135deg, #45B7E5, #0070C0);
    position: relative;
    overflow: hidden;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
}

.auth-banner-shape {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.auth-banner-shape:before {
    content: '';
    position: absolute;
    top: -25px;
    left: -25px;
    width: 120px;
    height: 120px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    z-index: 1;
}

.auth-banner-logo {
    position: relative;
    z-index: 2;
}

.auth-features {
    font-size: 0.95rem;
    text-align: left;
}

.auth-features i {
    color: #8fd3f4;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h2 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.auth-form {
    position: relative;
}

/* Estilização dos campos de formulário */
.form-floating > .form-control {
    padding-left: 1rem;
    height: calc(3.5rem + 2px);
    line-height: 1.5;
}

.form-floating > label {
    padding: 1rem;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* Posicionamento do botão toggle de senha */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 13px;
    z-index: 10;
    background: transparent;
    border: none;
    padding: 0;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-floating .toggle-password {
    top: 16px;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.toggle-password:focus {
    outline: none;
    box-shadow: none;
}

/* Botão de login */
.auth-btn {
    padding: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.auth-btn:active {
    transform: translateY(2px);
}

/* Separador de texto */
.auth-separator {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    height: 20px;
    position: relative;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e0e0e0;
}

.auth-separator span {
    padding: 0 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Botões de login social */
.social-login {
    margin-bottom: 1.5rem;
}

.social-login .btn {
    position: relative;
    padding: 10px;
    transition: all 0.3s ease;
}

.social-login .btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Alertas */
.alert {
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    display: flex !important;
    align-items: center;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Links de recuperação e cadastro */
.auth-footer a {
    color: #3498db;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    color: #1a5276;
    text-decoration: underline !important;
}

/* Checkbox personalizado */
.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.form-check-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilos para os alertas de feedback */
.auth-alert {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s;
}

.auth-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.auth-alert i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animações para menu de autenticação */
.auth-active {
    animation: fadeInRight 0.5s forwards;
}

.text-fade-in {
    animation: fadeIn 0.5s forwards;
}

.avatar-fade-in {
    animation: pulseAvatar 0.5s forwards;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseAvatar {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Estilização para menu não logado e logado */
.auth-links .nav-link.btn-login,
.auth-links .nav-link.btn-signup {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Feedback visual para autenticação */
.user-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #28a745;
    margin-left: 6px;
    position: relative;
}

.user-status:after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(40, 167, 69, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(0.8); opacity: 0; }
}

/* Regras específicas para visibilidade dos menus de autenticação */
.auth-links.hidden,
.user-links.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
    clip: rect(0, 0, 0, 0) !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
}

/* Garantir que os links do usuário logado apareçam corretamente */
.user-links:not(.hidden) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    pointer-events: auto !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Estilos para etapas de progresso */
.step {
    z-index: 2;
    cursor: pointer;
    position: relative;
}

.step-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.step.active .step-icon {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.step-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.step.active .step-text {
    color: var(--accent-color);
    font-weight: bold;
}

.progress-line {
    top: 17px;
    height: 3px;
    width: 100%;
    background: #e9ecef;
    z-index: 1;
}

/* Estilos para seções de formulário */
.form-section {
    animation: fadeIn 0.5s ease;
}

/* Estilos para formulários de autenticação e cadastro */

/* Estilos para campos de formulário */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

/* Estilos para feedback de validação */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    background-position: right calc(0.375em + 0.1875rem) center;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    background-position: right calc(0.375em + 0.1875rem) center;
}

/* Ajustes para feedback de validação */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
    position: relative;
    z-index: 5;
}

/* Evitar acúmulo de mensagens de feedback */
.form-group .invalid-feedback + .invalid-feedback,
.input-group + .invalid-feedback + .invalid-feedback,
.form-control + .invalid-feedback + .invalid-feedback {
    display: none;
}

/* Posicionamento adequado para feedback em grupos de inputs */
.input-group + .invalid-feedback {
    margin-top: 0.25rem;
}

/* Feedback visível apenas quando necessário */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback,
.input-group.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Estilo para o estado de verificação */
.input-checking {
    background-color: #f8f9fa;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiM2Yzc1N2QiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTEyIDJDNi41IDIgMiA2LjUgMiAxMnM0LjUgMTAgMTAgMTAgMTAtNC41IDEwLTEwUzE3LjUgMiAxMiAyeiI+PGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGZyb209IjAgMTIgMTIiIHRvPSIzNjAgMTIgMTIiIGR1cj0iMS41cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz48L3BhdGg+PC9zdmc+');
    background-repeat: no-repeat;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    background-position: right calc(0.375em + 0.1875rem) center;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Media queries para responsividade em páginas de autenticação */
@media (max-width: 992px) {
    .auth-container {
        width: 90%; /* Reduzir largura para telas menores */
        max-width: 800px;
    }
    
    .auth-banner {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        width: 95%;
        max-width: 600px;
        flex-direction: column;
    }
    
    .auth-banner {
        border-radius: 15px 15px 0 0;
        padding: 1.5rem;
        min-height: auto;
    }
    
    .auth-banner-content {
        padding: 1rem 0;
    }
    
    .auth-banner h1 {
        font-size: 1.75rem;
    }
    
    .auth-form-container {
        padding: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .social-login .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Melhorias para botões em dispositivos móveis */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary:active,
.btn-primary:focus {
    transform: translateY(1px);
}

/* Aumentar área de toque em dispositivos móveis */
@media (max-width: 768px) {
    .btn-lg {
        padding: 12px 15px;
        font-size: 1.1rem;
        min-height: 56px; /* Altura mínima para facilitar o toque */
    }
    
    /* Remoção de atraso de clique em dispositivos móveis */
    .btn {
        touch-action: manipulation;
    }
    
    /* Estilo específico para o botão de login */
    #login-submit-btn {
        width: 100%;
        margin: 8px 0;
        -webkit-tap-highlight-color: transparent; /* Remove efeito de toque no iOS */
    }
}

@media (max-width: 576px) {
    .auth-container {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    
    .auth-banner {
        border-radius: 0;
        padding: 1.25rem;
    }
    
    .auth-banner-logo img {
        height: 40px;
    }
    
    .auth-form-container {
        padding: 1.25rem;
    }
    
    .form-floating > .form-control {
        height: calc(3.2rem + 2px);
    }
    
    .auth-btn {
        width: 100%;
    }
    
    .auth-separator {
        margin: 1rem 0;
    }
    
    /* Ajuste para passos do registro */
    .step-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .step-text {
        font-size: 0.75rem;
    }
    
    .progress-line {
        top: 15px;
    }
}

/* Garantir que alertas com d-none fiquem realmente ocultos */
.alert.d-none, 
#login-success.d-none, 
#login-error.d-none, 
#login-info.d-none {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Garantir que alertas com d-flex fiquem realmente visíveis */
.alert.d-flex,
#login-success.d-flex, 
#login-error.d-flex, 
#login-info.d-flex {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
