/* Auth Styles - Sistema de Login/Cadastro */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    padding: 2rem 1rem;
}

.auth-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.auth-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

.auth-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.auth-tab.active {
    background: white;
    color: #8B4513;
    border-bottom: 2px solid #FFA500;
}

.auth-form {
    padding: 2rem;
    display: none;
}

.auth-form.active {
    display: block;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

/* Garante que campos não apareçam com erro por padrão */
.form-input:invalid {
    border-color: #e9ecef !important;
    box-shadow: none !important;
}

.form-input:required {
    border-color: #e9ecef !important;
    box-shadow: none !important;
}

/* Remove qualquer estilo de validação nativa do navegador */
.form-input:invalid:not(.error) {
    border-color: #e9ecef !important;
    box-shadow: none !important;
}

.form-input:required:not(.error) {
    border-color: #e9ecef !important;
    box-shadow: none !important;
}

/* Força estilo normal para todos os campos por padrão */
input:not(.error), select:not(.error) {
    border-color: #e9ecef !important;
}

/* Só aplica estilo de erro quando a classe .error está presente */
.form-input.error {
    border-color: #dc3545 !important;
}

.form-input:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-input.error {
    border-color: #dc3545;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #495057;
}

.form-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error.show {
    display: block;
}

.form-help {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #6c757d;
    font-size: 0.9rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.google-login-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-direction: column;
}

.google-login-btn:hover:not(:disabled) {
    border-color: #db4437;
    color: #db4437;
}

.google-login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.google-login-btn small {
    font-size: 0.75rem;
    color: #6c757d;
}

.auth-message {
    margin: 1rem 2rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-footer {
    padding: 1rem 2rem 2rem;
    text-align: center;
}

.back-link {
    color: #8B4513;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #FFA500;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Seção de Endereço */
.address-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
}

.address-title {
    font-size: 1rem;
    font-weight: 600;
    color: #8B4513;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.address-help {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 1.5rem;
}

.cep-input-group {
    display: flex;
    gap: 0.5rem;
}

.cep-input-group .form-input {
    flex: 1;
}

.btn-search-cep {
    padding: 0.75rem 1rem;
    background: #FFA500 !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-search-cep:hover {
    background: #e6940a !important;
    transform: translateY(-1px);
}

.btn-search-cep:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-group.flex-1 {
    flex: 1;
}

.form-group.flex-2 {
    flex: 2;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        max-width: 100%;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .auth-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
}