/* Estilos do Modal de Login/Cadastro */

/* Reset e configurações básicas */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.login-modal-overlay.active {
    display: flex;
}

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

/* Container do modal */
.login-modal-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

/* Header do modal */
.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.login-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.login-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.login-modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

/* Body do modal */
.login-modal-body {
    padding: 0 24px 24px;
}

/* Abas */
.login-modal-tabs {
    display: flex;
    margin-bottom: 24px;
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 4px;
}

.login-modal-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.login-modal-tab.active {
    background-color: #ffffff;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-modal-tab:hover:not(.active) {
    color: #374151;
}

/* Formulários */
.login-modal-form {
    display: none;
}

.login-modal-form.active {
    display: block;
}

.login-modal-field {
    margin-bottom: 20px;
}

.login-modal-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.login-modal-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2937;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-modal-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-modal-field input.error {
    border-color: #ef4444;
}

.login-modal-error {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* Botão de submit */
.login-modal-submit {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 16px;
}

.login-modal-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.login-modal-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-modal-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Mensagens */
.login-modal-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
    display: none;
}

.login-modal-message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    display: block;
}

.login-modal-message.error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

/* Botão trigger */
.login-modal-trigger {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-modal-trigger:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
    .login-modal-container {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .login-modal-header {
        padding: 20px 20px 0;
        margin-bottom: 20px;
    }
    
    .login-modal-header h2 {
        font-size: 20px;
    }
    
    .login-modal-body {
        padding: 0 20px 20px;
    }
    
    .login-modal-field input {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

@media (max-width: 480px) {
    .login-modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .login-modal-header {
        padding: 16px 16px 0;
        margin-bottom: 16px;
    }
    
    .login-modal-body {
        padding: 0 16px 16px;
    }
    
    .login-modal-tabs {
        margin-bottom: 20px;
    }
    
    .login-modal-field {
        margin-bottom: 16px;
    }
}

/* Animações adicionais */
.login-modal-field input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #fbbf24;
}

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

/* Estados de loading */
.login-modal-submit.loading .login-modal-submit-text {
    opacity: 0;
}

.login-modal-submit.loading .login-modal-loading {
    display: block;
}

/* Melhorias de acessibilidade */
.login-modal-overlay:focus-within {
    outline: none;
}

.login-modal-field input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.login-modal-tab:focus-visible,
.login-modal-close:focus-visible,
.login-modal-submit:focus-visible,
.login-modal-trigger:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

